Denizen Script Events


Events are a way to listen to things that happened on your server and respond to them through a script. These usually pair with 'world' script containers.
Learn about how events work in The Beginner's Guide.


Showing 2 out of 390 events...

Categories:

Entity | Depenizen



Category: Entity


Nameentity dies|death
Event Lines <entity> dies|death
Triggerswhen an entity dies. Note that this fires *after* the entity dies, and thus some data may be lost from the entity.
The death can only be cancelled on Paper.
Generated Exampleson entity dies:
after entity dies:
Has Playerwhen the entity that died is a player. - this adds switches 'flagged:<flag name>' + 'permission:<node>', in addition to the '<player>' link.
Has NPCwhen the entity that died is an NPC.
Switchesby:<entity> to only process the event if the killer is known and matches the specified entity matcher.
cause:<cause> to only process the event if it was caused by a specific damage cause.
Contexts<context.entity> returns the EntityTag that died.
<context.damager> returns the EntityTag damaging the other entity, if any.
<context.projectile> returns the EntityTag of a projectile used to kill the entity, if one was used.
<context.message> returns an ElementTag of a player's death message.
<context.cause> returns an ElementTag of the cause of the death. See Language:damage cause for a list of possible damage causes.
<context.drops> returns a ListTag of all pending item drops.
<context.xp> returns an ElementTag of the amount of experience to be dropped.
<context.keep_inventory> returns true if the player dying is set to keep their inventory, false if not, or null if the dying entity is not a player.
DetermineElementTag to change the death message.
"NO_DROPS" to specify that any drops should be removed.
"NO_XP" to specify that any XP orbs should be removed.
ListTag(ItemTag) to specify new items to be dropped.
ElementTag(Number) to specify the new amount of XP to be dropped.
"KEEP_INV" to specify (if a player death) that the inventory should be kept.
"KEEP_LEVEL" to specify (if a player death) that the XP level should be kept.
"NO_MESSAGE" to hide a player death message.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupEntity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntityDeathScriptEvent.java#L27



Category: Depenizen


Namemythicmob mob dies|death|killed
Event Lines mythicmob <mob> dies|death|killed
Triggerswhen a MythicMob dies.
Generated Examplesafter mythicmob mob death:
after mythicmob mob killed:
Switchesby:<entity> to only process the event if the killer matches a specified entity type.
Contexts<context.mob> Returns the MythicMob that has been killed.
<context.entity> Returns the EntityTag for the MythicMob.
<context.killer> returns the EntityTag that killed the MythicMob (if available).
<context.level> Returns the level of the MythicMob.
<context.drops> Returns a list of items dropped.
DetermineListTag(ItemTag) to specify new items to be dropped.
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupDepenizen
RequiresDepenizen, MythicMobs
Sourcehttps://github.com/DenizenScript/Depenizen/blob/master/src/main/java/com/denizenscript/depenizen/bukkit/events/mythicmobs/MythicMobsDeathEvent.java#L22