Class PlayerPickBlockEvent

All Implemented Interfaces:
Cancellable

@NullMarked public class PlayerPickBlockEvent extends PlayerPickItemEvent
Event that is fired when a player uses the pick item functionality on a block (middle-clicking a block 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

    • PlayerPickBlockEvent

      @Internal public PlayerPickBlockEvent(Player player, Block block, boolean includeData, int targetSlot, int sourceSlot)
  • Method Details

    • getBlock

      public Block getBlock()
      Retrieves the block associated with this event.
      Returns:
      the block involved in the event