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
ConstructorsConstructorDescriptionPlayerUseItemOnBlockEvent
(Player player, PlayerHand hand, ItemStack itemStack, Point position, Point cursorPosition, BlockFace blockFace) -
Method Summary
Modifier and TypeMethodDescriptionGets which face the player has interacted with.Gets the cursor position of the interacted blockgetHand()
Gets which hand the player used to interact with the block.Gets with which item the player has interacted with the block.Gets the player.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
-
getCursorPosition
Gets the cursor position of the interacted block- Returns:
- the cursor position of the interaction
-
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
-