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
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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EntityInstanceEvent
getInstanceMethods inherited from interface PlayerEvent
getEntity
-
Constructor Details
-
PlayerUseItemOnBlockEvent
-
-
Method Details
-
getPosition
-
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:
getItemStackin interfaceItemEvent- Returns:
- the item
-
getPlayer
Description copied from interface:PlayerEventGets the player.- Specified by:
getPlayerin interfacePlayerEvent- Returns:
- the player
-