Interface UseItemStackEvent
- All Superinterfaces:
Event
- All Known Subinterfaces:
UseItemStackEvent.Finish
,UseItemStackEvent.Replace
,UseItemStackEvent.Reset
,UseItemStackEvent.Start
,UseItemStackEvent.Stop
,UseItemStackEvent.Tick
Fired when an
ItemStack
is used.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Fired when an item is finished 'normally', e.g.static interface
Called afterUseItemStackEvent.Finish
, when the item in the entity's hand is replaced.static interface
Called before an entity's used item state is reset.static interface
Called beforeUseItemStackEvent.Tick
when a player starts using anItemType
, typically when they hold right mouse.static interface
Called afterUseItemStackEvent.Tick
when anItemType
has finished being used.static interface
Called afterUseItemStackEvent.Start
during each tick as anItemType
is being used. -
Method Summary
-
Method Details
-
originalRemainingDuration
Ticks originalRemainingDuration()Gets the original remaining duration ofItemStack
in use.- Returns:
- The original remaining duration
-
remainingDuration
Ticks remainingDuration()Gets the remaining duration ofItemStack
in use.- Returns:
- The remaining duration
-
setRemainingDuration
Sets the remaining duration ofItemStack
in use.- Parameters:
duration
- The remaining duration to set
-
itemStackInUse
ItemStackSnapshot itemStackInUse()Gets theItemStack
being consumed.- Returns:
- The item being consumed
-