Im trying to make it where when you eat a Chorus Fruit, you will still get the hunger healed but you will not teleport, but my code does not seem to work.. Help? Code: @EventHandler public void onTeleport(PlayerTeleportEvent event) { if(event.getCause().equals(TeleportCause.CHORUS_FRUIT)) { event.setCancelled(true);
You can debug by sending a message to console telling you the cause? Then just simply run the event ingame(Eat the fruit) and then see whats wrong.
@Kyleyocats What do you mean by "does not work"? Are you still able to eat the fruit? Are you able to be healed? Are you sure you registered the events?