Class PlayerPickEntityEvent

All Implemented Interfaces:
Cancellable

@NullMarked public class PlayerPickEntityEvent extends PlayerPickItemEvent
Event that is fired when a player uses the pick item functionality on an entity (middle-clicking an entity to get the appropriate item). After the handling of this event, the contents of the source and the target slot will be swapped, and the currently selected hotbar slot of the player will be set to the target slot.
  • Constructor Details

    • PlayerPickEntityEvent

      @Internal public PlayerPickEntityEvent(Player player, Entity entity, boolean includeData, int targetSlot, int sourceSlot)
  • Method Details

    • getEntity

      public Entity getEntity()
      Retrieves the entity associated with this event.
      Returns:
      the entity involved in the event