Package net.minestom.server.event.player
Class PlayerUseItemEvent
java.lang.Object
net.minestom.server.event.Event
net.minestom.server.event.CancellableEvent
net.minestom.server.event.player.PlayerUseItemEvent
public class PlayerUseItemEvent extends CancellableEvent
Event when an item is used without clicking on a block.
-
Constructor Summary
Constructors Constructor Description PlayerUseItemEvent(Player player, Player.Hand hand, ItemStack itemStack)
-
Method Summary
Modifier and Type Method Description Player.Hand
getHand()
Gets which hand the player used.ItemStack
getItemStack()
Gets the item which have been used.Player
getPlayer()
Gets the player who used an item.
-
Constructor Details
-
PlayerUseItemEvent
public PlayerUseItemEvent(@NotNull Player player, @NotNull Player.Hand hand, @NotNull ItemStack itemStack)
-
-
Method Details
-
getPlayer
Gets the player who used an item.- Returns:
- the player
-
getHand
Gets which hand the player used.- Returns:
- the hand used
-
getItemStack
Gets the item which have been used.- Returns:
- the item
-