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