Package net.minestom.server.event.item
Class PlayerCancelItemUseEvent
java.lang.Object
net.minestom.server.event.item.PlayerCancelItemUseEvent
- All Implemented Interfaces:
Event
,EntityEvent
,EntityInstanceEvent
,InstanceEvent
,ItemEvent
,PlayerEvent
,PlayerInstanceEvent
Called when a player stops using an item before the item has completed its usage, including the amount of
time the item was used before cancellation.
This includes cases like half eating a food, but also includes shooting a bow.
-
Constructor Summary
ConstructorDescriptionPlayerCancelItemUseEvent
(@NotNull Player player, @NotNull PlayerHand hand, @NotNull ItemStack itemStack, long useDuration) -
Method Summary
Modifier and TypeMethodDescription@NotNull PlayerHand
getHand()
@NotNull ItemStack
@NotNull Player
Gets the player.long
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
-
PlayerCancelItemUseEvent
public PlayerCancelItemUseEvent(@NotNull @NotNull Player player, @NotNull @NotNull PlayerHand hand, @NotNull @NotNull ItemStack itemStack, long useDuration)
-
-
Method Details
-
getPlayer
Description copied from interface:PlayerEvent
Gets the player.- Specified by:
getPlayer
in interfacePlayerEvent
- Returns:
- the player
-
getHand
-
getItemStack
- Specified by:
getItemStack
in interfaceItemEvent
-
getUseDuration
public long getUseDuration()
-