Class PlayerEatEvent

java.lang.Object
net.minestom.server.event.player.PlayerEatEvent
All Implemented Interfaces:
Event, EntityEvent, EntityInstanceEvent, InstanceEvent, ItemEvent, PlayerEvent, PlayerInstanceEvent

public class PlayerEatEvent extends Object implements ItemEvent, PlayerInstanceEvent
Called when a player is finished eating.
  • Constructor Details

    • PlayerEatEvent

      public PlayerEatEvent(@NotNull @NotNull Player player, @NotNull @NotNull ItemStack foodItem, @NotNull Player.Hand hand)
  • Method Details

    • getFoodItem

      @Deprecated @NotNull public @NotNull ItemStack getFoodItem()
      Deprecated.
      use getItemStack() for the eaten item
      Gets the food item that has been eaten.
      Returns:
      the food item
    • getHand

      @NotNull public Player.Hand getHand()
    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player
    • getItemStack

      @NotNull public @NotNull ItemStack getItemStack()
      Gets the food item that has been eaten.
      Specified by:
      getItemStack in interface ItemEvent
      Returns:
      the food item