Interface EntityEvent.LivingAttack
- Enclosing interface:
- EntityEvent
public static interface EntityEvent.LivingAttack
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.InteractionResult
attack
(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float amount) Invoked before an entity is hurt by a damage source.
-
Method Details
-
attack
net.minecraft.world.InteractionResult attack(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source, float amount) Invoked before an entity is hurt by a damage source. Equivalent to Forge'sLivingAttackEvent
event.You currently cannot override the amount of damage the entity receives.
- Parameters:
entity
- The entity that is attacked.source
- The reason why the entity takes damage.amount
- The amount of damage the entity takes.- Returns:
- Returning
InteractionResult.FAIL
prevents the entity from taking damage.
-