Package org.bukkit.event.entity
Class EntityDeathEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityDeathEvent
- Direct Known Subclasses:
PlayerDeathEvent
public class EntityDeathEvent extends EntityEvent
Thrown whenever a LivingEntity dies
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
Constructors Constructor Description EntityDeathEvent(LivingEntity entity, List<ItemStack> drops)EntityDeathEvent(LivingEntity what, List<ItemStack> drops, int droppedExp) -
Method Summary
Modifier and Type Method Description intgetDroppedExp()Gets how much EXP should be dropped from this death.List<ItemStack>getDrops()Gets all the items which will drop when the entity diesLivingEntitygetEntity()Returns the Entity involved in this eventstatic HandlerListgetHandlerList()HandlerListgetHandlers()voidsetDroppedExp(int exp)Sets how much EXP should be dropped from this death.
-
Constructor Details
-
EntityDeathEvent
-
EntityDeathEvent
public EntityDeathEvent(@NotNull LivingEntity what, @NotNull List<ItemStack> drops, int droppedExp)
-
-
Method Details
-
getEntity
Description copied from class:EntityEventReturns the Entity involved in this event- Overrides:
getEntityin classEntityEvent- Returns:
- Entity who is involved in this event
-
getDroppedExp
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
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
Gets all the items which will drop when the entity dies- Returns:
- Items to drop when the entity dies
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-