Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Check for player right click
The update for 1.13 is being worked on - please be patient. (Updated 02/14/19)
Sign in to follow this  
Followers 1
Merthew

Check for player right click

Started by Merthew, March 12, 2018

5 posts in this topic

Merthew    1

Merthew

Merthew    1

  • Creeper Killer
  • Merthew
  • Members
  • 1
  • 120 posts
  • Report post
Posted March 12, 2018

Is there a way to check for any time that a player right clicks with an empty hand? I want to create a chestpiece that when wearing and have an open hand, you could shoot fireballs.

 

For reference, here is my code:

https://github.com/Merthew/ModNameHere

 

Share this post


Link to post
Share on other sites

Merthew    1

Merthew

Merthew    1

  • Creeper Killer
  • Merthew
  • Members
  • 1
  • 120 posts
  • Report post
Posted March 12, 2018

Forgot to mention, 1.12.2

Share this post


Link to post
Share on other sites

Daeruin    22

Daeruin

Daeruin    22

  • Diamond Finder
  • Daeruin
  • Members
  • 22
  • 367 posts
  • Report post
Posted March 12, 2018

PlayerInteractEvent.RightClickEmpty

Share this post


Link to post
Share on other sites

Merthew    1

Merthew

Merthew    1

  • Creeper Killer
  • Merthew
  • Members
  • 1
  • 120 posts
  • Report post
Posted March 12, 2018

For the sake of convenience, i put the spawnFireball method in the event handler class. How would i call that? 

Share this post


Link to post
Share on other sites

Cadiboo    142

Cadiboo

Cadiboo    142

  • World Shaper
  • Cadiboo
  • Members
  • 142
  • 2075 posts
  • Report post
Posted March 14, 2018
On 13/03/2018 at 7:51 AM, Merthew said:

For the sake of convenience, i put the spawnFireball method in the event handler class. How would i call that? 

Look at how ItemBow does it,

 


Heres how I do it in my flamethrower class, adapt it to your situation

float velocity = 0.75F;
EntityPlayer entityplayer = (EntityPlayer)entityLiving;
if (!worldIn.isRemote)
{
	EntityNapalm entitynapalm = new EntityNapalm(worldIn, player);
	entitynapalm.shoot(player, player.rotationPitch, player.rotationYaw, 0.0F, velocity, 1.0F);
	worldIn.spawnEntity(entitynapalm);
}
worldIn.playSound(null, entityplayer.posX, entityplayer.posY, entityplayer.posZ, SoundEvents.ITEM_FIRECHARGE_USE, SoundCategory.PLAYERS, 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + velocity * 0.5F);


 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 1
Go To Topic Listing Modder Support

  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Savage_Killer13
      [1.13.2] Setting up Modding environment in NetBeans

      By Savage_Killer13 · Posted 6 minutes ago

      After finding out 1.13.2 forge beta is publicly released I wanted to start learning modding. I have now found out "gradlew setupDecompWorkspace" isn't a command anymore so Im wondering how I can setup forge for netbeans.

      Im not wanting to switch to another IDE as Ive had problems with setup and don't like the styles.    All im wondering is just how I can setup the forge environment for netbeans (even if at all I need to)
    • 20LeeBrian1
      I can't run forge jar file

      By 20LeeBrian1 · Posted 29 minutes ago

      I know that I can't post within an hour, but since it is 19 hours later I can post it here, right?   Anyways, I am concerned that I can't run the installer jar file, so please help me. I have java installed but the installer jar forge file does not work, so that's the problem I have.
    • diesieben07
      Is there a list of all the 1.12.2 events? [Solved]

      By diesieben07 · Posted 46 minutes ago

      Use your IDE.
    • diesieben07
      Adding Items To Armor Slots???

      By diesieben07 · Posted 51 minutes ago

      Not with MCreator. And since it's license does not allow you to use the produced code: Start re-writing your mod from scratch.   Glhf. Sorry to say, but this is why MCreator is kinda hated around here. Don't use this piece of garbo.
    • perigrine3
      Adding Items To Armor Slots???

      By perigrine3 · Posted 1 hour ago

      But aside from that, I just need to know how to add armor directly into the armor slots. 
  • Topics

    • Savage_Killer13
      0
      [1.13.2] Setting up Modding environment in NetBeans

      By Savage_Killer13
      Started 6 minutes ago

    • 20LeeBrian1
      1
      I can't run forge jar file

      By 20LeeBrian1
      Started 20 hours ago

    • UM3 F0R TH3 W1N
      1
      Is there a list of all the 1.12.2 events? [Solved]

      By UM3 F0R TH3 W1N
      Started 1 hour ago

    • perigrine3
      4
      Adding Items To Armor Slots???

      By perigrine3
      Started 1 hour ago

    • Orange
      8
      Minecraft 1.12.2 world not starting after leaving the world for a while.

      By Orange
      Started 2 hours ago

  • Who's Online (See full list)

    • DavidM
    • daruskiy
    • asgardec
    • Keitaro
    • PirateCody
    • crdlpls
    • Savage_Killer13
    • Michael2031
    • lehjr
    • minecrafter0204
    • iWasHere
    • Drachenbauer
    • dragonflii
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • Check for player right click
  • Theme
  • Contact Us

Copyright © 2017 ForgeDevelopment LLC Powered by Invision Community