Class LivingUseTotemEvent

java.lang.Object
net.neoforged.bus.api.Event
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class LivingUseTotemEvent extends LivingEvent implements net.neoforged.bus.api.ICancellableEvent
Fired when an Entity attempts to use a totem to prevent its death.

This event is cancellable, and does not

invalid reference
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.

  • Field Details

  • Constructor Details

  • Method Details

    • getSource

      public DamageSource getSource()
      Returns the damage source that caused the entity to die.
      Returns:
      the damage source that caused the entity to die
    • getTotem

      public ItemStack 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

      public InteractionHand getHandHolding()
      Returns the hand holding the totem.
      Returns:
      the hand holding the totem