Jump to content

Do actions when jumping


Vazelek

Recommended Posts

Hey,
I am trying to learn how to mod forge 1.12.2 and I would like to succeed in detecting and doing an action when the player jumps. For this I use the LivingJumpEvent event but I'm not sure how it works. I tried to make it display a message, but this code does not work. Maybe something is missing or there is an error.
My code:

@SubscribeEvent
	public void jumpEvent(LivingJumpEvent e) {
		if(e.getEntity() instanceof EntityPlayer) {
			EntityPlayer player = (EntityPlayer) e.getEntity();
			player.sendMessage(new TextComponentString("hi"));
		}
	}


Thanks for your help

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.