Interface ServerLivingEntityEvents.AllowDamage
- 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.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
allowDamage
(LivingEntity entity, DamageSource source, float amount) Called when a living entity is going to take damage.
-
Method Details
-
allowDamage
Called when a living entity is going to take damage. Can be used to cancel the damage entirely.The amount corresponds to the "incoming" damage amount, before armor and other mitigations have been applied.
- Parameters:
entity
- the entitysource
- the source of the damageamount
- the amount of damage that the entity will take (before mitigations)- Returns:
- true if the damage should go ahead, false to cancel the damage.
-