namespace Minecraft.Server.FourKit.Event.Entity;
using FourKitEntity = Minecraft.Server.FourKit.Entity;
using Minecraft.Server.FourKit.Inventory;
///
/// Thrown whenever a LivingEntity dies.
///
public class EntityDeathEvent : EntityEvent
{
private readonly List _drops;
private int _droppedExp;
internal EntityDeathEvent(FourKitEntity.LivingEntity entity, List drops)
: this(entity, drops, 0)
{
}
internal EntityDeathEvent(FourKitEntity.LivingEntity what, List drops, int droppedExp)
: base(what)
{
_drops = drops;
_droppedExp = droppedExp;
}
///
/// Returns the Entity involved in this event.
///
/// Entity who is involved in this event.
public new FourKitEntity.LivingEntity getEntity() => (FourKitEntity.LivingEntity)entity;
///
/// 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.
///
/// Amount of EXP to drop.
public int getDroppedExp() => _droppedExp;
///
/// 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.
///
/// Amount of EXP to drop.
public void setDroppedExp(int exp) => _droppedExp = exp;
///
/// Gets all the items which will drop when the entity dies.
///
/// Items to drop when the entity dies.
public List getDrops() => _drops;
}