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 anItemStackis used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceUseItemStackEvent.FinishFired when an item is finished 'normally', e.g.static interfaceUseItemStackEvent.ReplaceCalled afterUseItemStackEvent.Finish, when the item in the entity's hand is replaced.static interfaceUseItemStackEvent.ResetCalled before an entity's used item state is reset.static interfaceUseItemStackEvent.StartCalled beforeUseItemStackEvent.Tickwhen a player starts using anItemType, typically when they hold right mouse.static interfaceUseItemStackEvent.StopCalled afterUseItemStackEvent.Tickwhen anItemTypehas finished being used.static interfaceUseItemStackEvent.TickCalled afterUseItemStackEvent.Startduring each tick as anItemTypeis being used.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ItemStackSnapshotitemStackInUse()Gets theItemStackbeing consumed.TicksoriginalRemainingDuration()Gets the original remaining duration ofItemStackin use.TicksremainingDuration()Gets the remaining duration ofItemStackin use.voidsetRemainingDuration(Ticks duration)Sets the remaining duration ofItemStackin use.
-
-
-
Method Detail
-
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
void setRemainingDuration(Ticks duration)
Sets the remaining duration ofItemStackin use.- Parameters:
duration- The remaining duration to set
-
itemStackInUse
ItemStackSnapshot itemStackInUse()
Gets theItemStackbeing consumed.- Returns:
- The item being consumed
-
-