Interface UseItemStackEvent.Replace
-
- All Superinterfaces:
Cancellable
,Event
,UseItemStackEvent
- Enclosing interface:
- UseItemStackEvent
public static interface UseItemStackEvent.Replace extends UseItemStackEvent, Cancellable
Called afterUseItemStackEvent.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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.event.item.inventory.UseItemStackEvent
UseItemStackEvent.Finish, UseItemStackEvent.Replace, UseItemStackEvent.Reset, UseItemStackEvent.Start, UseItemStackEvent.Stop, UseItemStackEvent.Tick
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Transaction<ItemStackSnapshot>
itemStackResult()
Gets theItemStack
that is placed in the player's inventory in replacement of the stack that is currently being used.-
Methods inherited from interface org.spongepowered.api.event.Cancellable
isCancelled, setCancelled
-
Methods inherited from interface org.spongepowered.api.event.item.inventory.UseItemStackEvent
itemStackInUse, originalRemainingDuration, remainingDuration, setRemainingDuration
-
-
-
-
Method Detail
-
itemStackResult
Transaction<ItemStackSnapshot> itemStackResult()
Gets theItemStack
that is placed in the player's inventory in replacement of the stack that is currently being used.- Returns:
- The result
ItemStack
-
-