Package net.minestom.server.event.player
Class PlayerUseItemOnBlockEvent
java.lang.Object
net.minestom.server.event.player.PlayerUseItemOnBlockEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,ItemEvent
,PlayerEvent
,PlayerInstanceEvent
Used when a player is clicking on a block with an item (but is not a block in item form).
-
Constructor Summary
ConstructorDescriptionPlayerUseItemOnBlockEvent
(@NotNull Player player, Player.Hand hand, @NotNull ItemStack itemStack, @NotNull Point position, @NotNull Point cursorPosition, @NotNull BlockFace blockFace) -
Method Summary
Modifier and TypeMethodDescription@NotNull BlockFace
Gets which face the player has interacted with.getHand()
Gets which hand the player used to interact with the block.@NotNull ItemStack
Gets with which item the player has interacted with the block.@NotNull Player
Gets the player.@NotNull Point
Gets the position of the interacted block.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.event.trait.EntityInstanceEvent
getInstance
Methods inherited from interface net.minestom.server.event.trait.PlayerEvent
getEntity
-
Constructor Details
-
PlayerUseItemOnBlockEvent
-
-
Method Details
-
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.- Specified by:
getItemStack
in interfaceItemEvent
- Returns:
- the item
-
getPlayer
Description copied from interface:PlayerEvent
Gets the player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player
-