Interface EntityEvent.LivingDeath

Enclosing interface:
EntityEvent

public static interface EntityEvent.LivingDeath
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionResult
    die(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source)
    Invoked before a living entity dies.
  • Method Details

    • die

      net.minecraft.world.InteractionResult die(net.minecraft.world.entity.LivingEntity entity, net.minecraft.world.damagesource.DamageSource source)
      Invoked before a living entity dies. Equivalent to Forge's LivingDeathEvent event.
      Parameters:
      entity - The entity that is about to die.
      source - The source of damage triggering the death.
      Returns:
      Returning InteractionResult.FAIL prevents the entity from dying.