Interface UseItemStackEvent
-
- All Superinterfaces:
Event
- All Known Subinterfaces:
UseItemStackEvent.Finish
,UseItemStackEvent.Replace
,UseItemStackEvent.Reset
,UseItemStackEvent.Start
,UseItemStackEvent.Stop
,UseItemStackEvent.Tick
public interface UseItemStackEvent extends Event
Fired when anItemStack
is used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
UseItemStackEvent.Finish
Fired when an item is finished 'normally', e.g.static interface
UseItemStackEvent.Replace
Called afterUseItemStackEvent.Finish
, when the item in the entity's hand is replaced.static interface
UseItemStackEvent.Reset
Called before an entity's used item state is reset.static interface
UseItemStackEvent.Start
Called beforeUseItemStackEvent.Tick
when a player starts using anItemType
, typically when they hold right mouse.static interface
UseItemStackEvent.Stop
Called afterUseItemStackEvent.Tick
when anItemType
has finished being used.static interface
UseItemStackEvent.Tick
Called afterUseItemStackEvent.Start
during each tick as anItemType
is being used.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ItemStackSnapshot
itemStackInUse()
Gets theItemStack
being consumed.Ticks
originalRemainingDuration()
Gets the original remaining duration ofItemStack
in use.Ticks
remainingDuration()
Gets the remaining duration ofItemStack
in use.void
setRemainingDuration(Ticks duration)
Sets the remaining duration ofItemStack
in use.
-
-
-
Method Detail
-
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
void setRemainingDuration(Ticks duration)
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
-
-