Class LivingUseTotemEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.entity.EntityEvent
net.minecraftforge.event.entity.living.LivingEvent
net.minecraftforge.event.entity.living.LivingUseTotemEvent
Fired when an Entity attempts to use a totem to prevent its death.
This event is cancellable, and does not have a result. If this event is cancelled, the totem will not prevent the entity's death.
This event is fired on the Forge event bus, only on the logical server.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.living.LivingEvent
LivingEvent.LivingJumpEvent, LivingEvent.LivingTickEvent, LivingEvent.LivingVisibilityEvent
Nested classes/interfaces inherited from class net.minecraftforge.event.entity.EntityEvent
EntityEvent.EnteringSection, EntityEvent.EntityConstructing, EntityEvent.EyeHeight, EntityEvent.Size
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final InteractionHand
private final DamageSource
private final ItemStack
-
Constructor Summary
ConstructorDescriptionLivingUseTotemEvent
(LivingEntity entity, DamageSource source, ItemStack totem, InteractionHand hand) -
Method Summary
Modifier and TypeMethodDescriptionReturns the hand holding the totem.Returns the damage source that caused the entity to die.getTotem()
Returns the totem of undying being used from the entity's inventory.Methods inherited from class net.minecraftforge.event.entity.living.LivingEvent
getEntity
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
source
-
totem
-
hand
-
-
Constructor Details
-
LivingUseTotemEvent
public LivingUseTotemEvent(LivingEntity entity, DamageSource source, ItemStack totem, InteractionHand hand)
-
-
Method Details
-
getSource
Returns the damage source that caused the entity to die.- Returns:
- the damage source that caused the entity to die
-
getTotem
Returns the totem of undying being used from the entity's inventory.- Returns:
- the totem of undying being used from the entity's inventory
-
getHandHolding
Returns the hand holding the totem.- Returns:
- the hand holding the totem
-