Class LivingEntityUseItemEvent.Start
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
net.neoforged.neoforge.event.entity.living.LivingEntityUseItemEvent.Start
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
LivingEntityUseItemEvent
public static class LivingEntityUseItemEvent.Start
extends LivingEntityUseItemEvent
implements net.neoforged.bus.api.ICancellableEvent
Fired when a player starts 'using' an item, typically when they hold right mouse.
Examples:
Drawing a bow
Eating Food
Drinking Potions/Milk
Guarding with a sword
Cancel the event, or set the duration or <= 0 to prevent it from processing.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEntityUseItemEvent
LivingEntityUseItemEvent.Finish, LivingEntityUseItemEvent.Start, LivingEntityUseItemEvent.Stop, LivingEntityUseItemEvent.Tick
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.Size
-
Constructor Summary
ConstructorsConstructorDescriptionStart
(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack item, int duration) Deprecated, for removal: This API element is subject to removal in a future version.Start
(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack item, net.minecraft.world.InteractionHand hand, int duration) -
Method Summary
Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEntityUseItemEvent
getDuration, getHand, getItem, setDuration
Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Constructor Details
-
Start
@Deprecated(since="1.21.5", forRemoval=true) public Start(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack item, int duration) Deprecated, for removal: This API element is subject to removal in a future version.Usethe hand sensitive version
as this version provides wrong hand information -
Start
public Start(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.item.ItemStack item, net.minecraft.world.InteractionHand hand, int duration)
-
the hand sensitive version
as this version provides wrong hand information