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
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFired when an item is finished 'normally', e.g.static interfaceCalled afterUseItemStackEvent.Finish, when the item in the entity's hand is replaced.static interfaceCalled before an entity's used item state is reset.static interfaceCalled beforeUseItemStackEvent.Tickwhen a player starts using anItemType, typically when they hold right mouse.static interfaceCalled afterUseItemStackEvent.Tickwhen anItemTypehas finished being used.static interfaceCalled afterUseItemStackEvent.Startduring each tick as anItemTypeis being used. -
Method Summary
-
Method Details
-
originalRemainingDuration
Ticks originalRemainingDuration()Gets the original remaining duration ofItemStackin use.- Returns:
- The original remaining duration
-
remainingDuration
Ticks remainingDuration()Gets the remaining duration ofItemStackin use.- Returns:
- The remaining duration
-
setRemainingDuration
Sets the remaining duration ofItemStackin use.- Parameters:
duration- The remaining duration to set
-
itemStackInUse
ItemStackSnapshot itemStackInUse()Gets theItemStackbeing consumed.- Returns:
- The item being consumed
-