public interface UseItemStackEvent extends GameEvent, Cancellable, CauseTracked
Modifier and Type | Interface and Description |
---|---|
static interface |
UseItemStackEvent.Finish
Called after
UseItemStackEvent.Stop when an ItemType has finished being
used. |
static interface |
UseItemStackEvent.Start
Called before
UseItemStackEvent.Tick when a player starts using an
ItemType , typically when they hold right mouse. |
static interface |
UseItemStackEvent.Stop
Called after
UseItemStackEvent.Tick when an ItemType has finished being
used. |
static interface |
UseItemStackEvent.Tick
Called after
UseItemStackEvent.Start during each tick as an ItemType is
being used. |
Modifier and Type | Method and Description |
---|---|
Transaction<ItemStackSnapshot> |
getItemStackInUse()
Gets the
ItemStack being consumed. |
int |
getOriginalRemainingDuration()
Gets the original remaining duration of
ItemStack in use. |
int |
getRemainingDuration()
Gets the remaining duration of
ItemStack in use. |
void |
setRemainingDuration(int duration)
Sets the remaining duration of
ItemStack in use. |
isCancelled, setCancelled
getCause
int getOriginalRemainingDuration()
ItemStack
in use.int getRemainingDuration()
ItemStack
in use.void setRemainingDuration(int duration)
ItemStack
in use.duration
- The remaining duration to setTransaction<ItemStackSnapshot> getItemStackInUse()
ItemStack
being consumed.