Denizen Script NPC Actions


NPC Actions go in 'assignment' scripts, and work like 'events' but linked to the assigned NPC.
Learn about how NPC Actions work in The Beginner's Guide.


Showing all 39 NPC Actions...
Action Linesassignment
Triggerswhen the assignment script is added to an NPC.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java#L72

Action Linesattack
attack on <entity>
Triggerswhen the NPC is about to attack an enemy.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L133

Action Linesbegin navigation
Triggerswhen the NPC has received a 'walk' command,
or is about to follow a path.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L100

Action Linescancel navigation
cancel navigation due to <reason>
Triggerswhen a plugin or script cancels an NPC's navigation.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L153

Action Linescast fishing rod
Triggerswhen the NPC casts a fishing rod. See also Command:fish.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/FishingTrait.java#L172

Action Linescatch fish
Triggerswhen the NPC catches a fish. See also Command:fish.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/FishingTrait.java#L236

Action Lineschat
Triggerswhen a player chats to the NPC.
Contexts<context.message> returns the triggering message
<context.keyword> returns the keyword matched by a RegEx trigger
Determine"CANCELLED" to stop the player from chatting.
ElementTag to change the message.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ChatTrigger.java#L110

Action Linesclick
Triggerswhen the NPC is clicked by a player.
ContextsNone
Determine"cancelled" to cancel the click event completely.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ClickTrigger.java#L68

Action Linescomplete navigation
Triggerswhen the NPC has finished a 'walk' command,
or has reached a path point.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L77

Action Linesdamage
Triggerswhen the NPC is damaged by a player and the Damage trigger fires. Action does not run if you do not enable the Damage trigger.
Contexts<context.damage> returns how much damage was done.
Determine"cancelled" to cancel the damage event.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java#L56

Action Linesdamaged
Triggerswhen the NPC is damaged by an entity.
Contexts<context.damage> returns how much damage was done.
<context.damager> returns the entity that did the damage.
Determine"cancelled" to cancel the damage event.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java#L70

Action Linesdeath
death by entity
death by <entity>
death by block
death by <cause>
Triggerswhen the NPC dies.
Contexts<context.killer> returns the entity that killed the NPC (if any)
<context.shooter> returns the shooter of the killing projectile (if any)
<context.damage> returns the last amount of damage applied (if any)
<context.death_cause> returns the last damage cause (if any)
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L206

Action Linesdespawn
Triggerswhen the NPC is despawned.
This can be because a command was issued, or a chunk has been unloaded.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java#L114

Action Linesdig
Triggerswhen the NPC breaks a block with the Break Command
Contexts<context.location> returns the location the NPC Dug
<context.material> Returns the Block dug
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/BreakCommand.java#L106

Action Linesenter proximity
Triggerswhen a player enters the NPC's proximity trigger's radius.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java#L43

Action Linesexhausted
Triggerswhen the NPC is exhausted (Requires the Hunger trait)
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/HungerTrait.java#L54

Action Linesexit proximity
Triggerswhen a player exits the NPC's proximity trigger's radius.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java#L53

Action Lineshit
hit on <entity>
Triggerswhen the NPC hits an enemy.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L262

Action Lineskill
kill of <entity>
Triggerswhen the NPC kills an enemy.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L273

Action Linesmob enter proximity
<entity> enter proximity
Triggerswhen a mob enters the proximity of the NPC (Requires MobProx trait).
Contexts<context.entity> returns the mob that entered the proximity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java#L68

Action Linesmob exit proximity
<entity> exit proximity
Triggerswhen a mob exits the proximity of the NPC (Requires MobProx trait).
Contexts<context.entity> returns the mob that exited the proximity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java#L79

Action Linesmob move proximity
<entity> move proximity
Triggerswhen a mob moves in the proximity of the NPC (Requires MobProx trait).
(Fires at a rate of specified by the 'mobprox_timer' flag, default of 2 seconds)
Contexts<context.entity> returns the mob that entered the proximity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/MobproxTrait.java#L90

Action Linesmove proximity
Triggerswhen a player moves inside the NPC's proximity trigger's radius.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java#L63

Action Linesno click trigger
Triggerswhen the NPC is clicked but no click trigger fires.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ClickTrigger.java#L57

Action Linesno damage trigger
Triggerswhen the NPC is damaged by a player but no damage trigger fires.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/DamageTrigger.java#L44

Action Linesproximity
Triggerswhen a player moves inside the NPC's proximity trigger's radius.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/triggers/core/ProximityTrigger.java#L74

Action Linespush
Triggerswhen the NPC is pushed by a player
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/PushableTrait.java#L136

Action Linespush return
Triggerswhen the NPC returns to its center after being pushed by a player.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/PushableTrait.java#L181

Action Linesreel in fishing rod
Triggerswhen the NPC reels in its fishing rod. See also Command:fish.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/FishingTrait.java#L225

Action Linesremove
Triggerswhen the NPC is removed.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java#L140

Action Linesremove assignment
Triggerswhen the assignment script is removed from an NPC.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java#L94

Action Linessit
Triggerswhen the NPC sits down.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/SittingTrait.java#L99

Action Linessneak
Triggerswhen the NPC starts sneaking.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/SneakingTrait.java#L22

Action Linesspawn
Triggerswhen the NPC is spawned.
This will fire whenever an NPC's chunk is loaded, or a spawn command is issued.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/DenizenNPCHelper.java#L89

Action Linesstand
Triggerswhen the NPC stands up.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/SittingTrait.java#L175

Action Linesstart fishing
Triggerswhen the NPC starts fishing. See also Command:fish.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/FishingTrait.java#L86

Action Linesstop fishing
Triggerswhen the NPC stops fishing. See also Command:fish.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/FishingTrait.java#L111

Action Linesstuck
Triggerswhen the NPC's navigator is stuck.
Contexts<context.action> returns 'teleport' or 'none'
Determine"NONE" to do nothing.
"TELEPORT" to teleport.
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/tags/core/NPCTagBase.java#L174

Action Linesunavailable
Triggerswhen a trigger fires but the NPC is engaged.
Contexts<context.trigger_type> return the type of trigger fired
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/TriggerTrait.java#L186