public static interface UseItemStackEvent.Replace extends UseItemStackEvent, Cancellable
UseItemStackEvent.Finish
, when the item in the entity's
hand is replaced.
For example, this event is called to decrement the amount of food in the stack being eaten.
In Vanilla, setting the remaining duration for this event is ignored.
Cancelling the event, or marking the transaction as invalid, will leave the entity's hand untouched.
UseItemStackEvent.Finish, UseItemStackEvent.Replace, UseItemStackEvent.Reset, UseItemStackEvent.Start, UseItemStackEvent.Stop, UseItemStackEvent.Tick
Modifier and Type | Method and Description |
---|---|
Transaction<ItemStackSnapshot> |
getItemStackResult()
Gets the
ItemStack that is placed in the player's
inventory in replacement of the stack that is currently being used. |
getItemStackInUse, getOriginalRemainingDuration, getRemainingDuration, setRemainingDuration
getCause, getContext, getSource
isCancelled, setCancelled
Transaction<ItemStackSnapshot> getItemStackResult()
ItemStack
that is placed in the player's
inventory in replacement of the stack that is currently being used.ItemStack