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 1 out of 399 events...
Namenpc spawns
Event Lines npc spawns
Triggerswhen an NPC spawns.
Generated Exampleson npc spawns:
Has NPCAlways.
Switchesnpc:<npc> to only process the event if the spawned NPC matches.
reason:<reason> to only process the event if the NPC's spawn reason matches. See 🔗https://jd.citizensnpcs.co/net/citizensnpcs/api/event/SpawnReason.html for a list of reasons.
Contexts<context.location> returns the location the entity will spawn at.
<context.reason> returns the reason of the spawn.
CancellableTrue - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false'
Has LocationTrue - This adds the switches 'in:<area>', 'location_flagged:<flag>', ...
GroupNPC
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/npc/NPCSpawnScriptEvent.java#L16