Class LivingEntityUseItemEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
net.neoforged.neoforge.event.entity.living.LivingEntityUseItemEvent
- Direct Known Subclasses:
LivingEntityUseItemEvent.Finish,LivingEntityUseItemEvent.Start,LivingEntityUseItemEvent.Stop,LivingEntityUseItemEvent.Tick
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFired after an item has fully finished being used.static classFired when a player starts 'using' an item, typically when they hold right mouse.static classFired when a player stops using an item without the use duration timing out.static classFired every tick that a player is 'using' an item, seeLivingEntityUseItemEvent.Startfor info.Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEventNested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intprivate final InteractionHandprivate final ItemStack -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLivingEntityUseItemEvent(LivingEntity entity, ItemStack item, int duration) privateLivingEntityUseItemEvent(LivingEntity entity, ItemStack item, InteractionHand hand, int duration) -
Method Summary
Modifier and TypeMethodDescriptionintgetHand()Returns the hand the entity is using the item in.getItem()voidsetDuration(int duration) Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
-
Field Details
-
item
-
hand
-
duration
private int duration
-
-
Constructor Details
-
LivingEntityUseItemEvent
-
LivingEntityUseItemEvent
private LivingEntityUseItemEvent(LivingEntity entity, ItemStack item, InteractionHand hand, int duration)
-
-
Method Details
-
getItem
-
getDuration
public int getDuration() -
setDuration
public void setDuration(int duration) -
getHand
Returns the hand the entity is using the item in.- Returns:
- the hand the entity is using the item in
-