Class PlayerUseItemOnBlockEvent

java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.player.PlayerUseItemOnBlockEvent

public class PlayerUseItemOnBlockEvent
extends Event
Used when a player is clicking on a block with an item (but is not a block in item form).
  • Constructor Details

  • Method Details

    • getPlayer

      @NotNull public Player getPlayer()
      Gets the player who used an item while clicking on a block.
      Returns:
      the player
    • getPosition

      @NotNull public BlockPosition getPosition()
      Gets the position of the interacted block.
      Returns:
      the block position
    • getBlockFace

      @NotNull public Direction getBlockFace()
      Gets which face the player has interacted with.
      Returns:
      the block face
    • getHand

      @NotNull public Player.Hand getHand()
      Gets which hand the player used to interact with the block.
      Returns:
      the hand
    • getItemStack

      @NotNull public ItemStack getItemStack()
      Gets with which item the player has interacted with the block.
      Returns:
      the item