Interface EntityEvent.LivingHurt

Enclosing interface:
EntityEvent

public static interface EntityEvent.LivingHurt
  • Method Summary

    Modifier and Type
    Method
    Description
    hurt(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

    • hurt

      EventResult hurt(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's LivingAttackEvent 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:
      A EventResult determining the outcome of the event, the execution of the entity attack may be cancelled by the result.