| Name | entity killed by cause |
| Event Lines | <entity> killed (by <cause>)
<entity> killed (by <entity>)
<entity> kills <entity> |
| Triggers | when an entity is killed. |
| Generated Examples | after entity killed:
on monster killed by player: on living kills living: after entity killed by cause: after projectile killed by phantom: on npc kills cod: |
| Has Player | when the killer or entity that was killed is a player. Cannot be both. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link. |
| Has NPC | when the killer or entity that was killed is an NPC. Cannot be both. |
| Contexts | <context.entity> returns the EntityTag that was killed.
<context.cause> returns an ElementTag of reason the entity was damaged - see damage cause for causes.
<context.damage> returns an ElementTag(Decimal) of the amount of damage dealt.
<context.final_damage> returns an ElementTag(Decimal) of the amount of damage dealt, after armor is calculated.
<context.damager> returns the EntityTag damaging the other entity.
<context.projectile> returns a EntityTag of the projectile shot by the damager, if any.
<context.damage_type_map> returns a MapTag the damage dealt by a specific damage type with keys: BASE, HARD_HAT, BLOCKING, ARMOR, RESISTANCE, MAGIC, ABSORPTION.
|
| Determine | ElementTag(Decimal) to set the amount of damage the entity receives, instead of dying. |
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Entity |
| Warning(s) | This event may mis-fire in some cases, particularly with plugins or scripts modify the damage from scripts. If you need reliable death tracking, the entity death event may be better. |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityKilledScriptEvent.java#L22 |