Class EntityDeathEvent

Direct Known Subclasses:
PlayerDeathEvent

public class EntityDeathEvent extends EntityEvent
Thrown whenever a LivingEntity dies
  • Constructor Details Link icon

  • Method Details Link icon

    • getEntity Link icon

      @NotNull public LivingEntity getEntity()
      Description copied from class: EntityEvent
      Returns the Entity involved in this event
      Overrides:
      getEntity in class EntityEvent
      Returns:
      Entity who is involved in this event
    • getDamageSource Link icon

      @NotNull public DamageSource getDamageSource()
      Gets the source of damage which caused the death.
      Returns:
      a DamageSource detailing the source of the damage for the death.
    • getDroppedExp Link icon

      public int getDroppedExp()
      Gets how much EXP should be dropped from this death.

      This does not indicate how much EXP should be taken from the entity in question, merely how much should be created after its death.

      Returns:
      Amount of EXP to drop.
    • setDroppedExp Link icon

      public void setDroppedExp(int exp)
      Sets how much EXP should be dropped from this death.

      This does not indicate how much EXP should be taken from the entity in question, merely how much should be created after its death.

      Parameters:
      exp - Amount of EXP to drop.
    • getDrops Link icon

      @NotNull public List<ItemStack> getDrops()
      Gets all the items which will drop when the entity dies
      Returns:
      Items to drop when the entity dies
    • getHandlers Link icon

      @NotNull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList Link icon

      @NotNull public static HandlerList getHandlerList()