类 LivingUseTotemEvent

java.lang.Object
net.neoforged.bus.api.Event
所有已实现的接口:
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

引用无效
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.

  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getSource

      public DamageSource getSource()
      返回 the damage source that caused the entity to die。
      返回:
      the damage source that caused the entity to die
    • getTotem

      public ItemStack getTotem()
      返回 the totem of undying being used from the entity's inventory。
      返回:
      the totem of undying being used from the entity's inventory
    • getHandHolding

      public InteractionHand getHandHolding()
      返回 the hand holding the totem。
      返回:
      the hand holding the totem