Interface ServerLivingEntityEvents.AllowDeath

Enclosing class:
ServerLivingEntityEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ServerLivingEntityEvents.AllowDeath
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allowDeath(LivingEntity entity, DamageSource damageSource, float damageAmount)
    Called when a living entity takes fatal damage (before totems of undying can take effect).
  • Method Details

    • allowDeath

      boolean allowDeath(LivingEntity entity, DamageSource damageSource, float damageAmount)
      Called when a living entity takes fatal damage (before totems of undying can take effect).
      Parameters:
      entity - the entity
      damageSource - the source of the fatal damage
      damageAmount - the amount of damage that has killed the entity
      Returns:
      true if the death should go ahead, false to cancel the death.