Interface ServerLivingEntityEvents.AfterDamage

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.AfterDamage
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    afterDamage(LivingEntity entity, DamageSource source, float baseDamageTaken, float damageTaken, boolean blocked)
    Called after a living entity took damage, unless they were killed.
  • Method Details

    • afterDamage

      void afterDamage(LivingEntity entity, DamageSource source, float baseDamageTaken, float damageTaken, boolean blocked)
      Called after a living entity took damage, unless they were killed. The base damage taken is given as damage taken before armor or enchantments are applied, but after other effects like shields are applied.
      Parameters:
      entity - the entity that was damaged
      source - the source of the damage
      baseDamageTaken - the amount of damage initially dealt
      damageTaken - the amount of damage actually taken by the entity, before armor and enchantment effects
      blocked - whether the damage was blocked by a shield