Fruit Issue

Discussion in 'Plugin Development' started by icedmoca, Apr 12, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    icedmoca

    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);
    
     
  2. Offline

    Lightspeed

    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.
     
  3. Offline

    Zombie_Striker

    @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?
     
Thread Status:
Not open for further replies.

Share This Page