Class PlayerPickBlockEvent

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

public class PlayerPickBlockEvent extends Object implements PlayerInstanceEvent, BlockEvent
Called when a player tries to pick a block (middle-click).
  • Constructor Details

    • PlayerPickBlockEvent

      public PlayerPickBlockEvent(@NotNull @NotNull Player player, @NotNull @NotNull Block block, @NotNull @NotNull BlockVec blockPosition, boolean includeData)
  • Method Details

    • getBlock

      @NotNull public @NotNull Block getBlock()
      Gets the block which was picked.
      Specified by:
      getBlock in interface BlockEvent
      Returns:
      the block which was picked
    • getBlockPosition

      @NotNull public @NotNull BlockVec getBlockPosition()
      Gets the picked block position.
      Specified by:
      getBlockPosition in interface BlockEvent
      Returns:
      the picked block position
    • isIncludeData

      public boolean isIncludeData()
      Get if the entity data should be included in the result (control middle-click).
      Returns:
      if the entity data should be included.
    • getPlayer

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