Package net.minestom.server.event.player
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 Summary
Constructors Constructor Description PlayerUseItemOnBlockEvent(Player player, Player.Hand hand, ItemStack itemStack, BlockPosition position, Direction blockFace)
-
Method Summary
Modifier and Type Method Description Direction
getBlockFace()
Gets which face the player has interacted with.Player.Hand
getHand()
Gets which hand the player used to interact with the block.ItemStack
getItemStack()
Gets with which item the player has interacted with the block.Player
getPlayer()
Gets the player who used an item while clicking on a block.BlockPosition
getPosition()
Gets the position of the interacted block.
-
Constructor Details
-
PlayerUseItemOnBlockEvent
public PlayerUseItemOnBlockEvent(@NotNull Player player, @NotNull Player.Hand hand, @NotNull ItemStack itemStack, @NotNull BlockPosition position, @NotNull Direction blockFace)
-
-
Method Details
-
getPlayer
Gets the player who used an item while clicking on a block.- Returns:
- the player
-
getPosition
Gets the position of the interacted block.- Returns:
- the block position
-
getBlockFace
Gets which face the player has interacted with.- Returns:
- the block face
-
getHand
Gets which hand the player used to interact with the block.- Returns:
- the hand
-
getItemStack
Gets with which item the player has interacted with the block.- Returns:
- the item
-