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 NPC receives an assignment via '/npc assign --set Name'.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java#L60

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#L120

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#L87

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#L140

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#L154

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#L217

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#L97

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#L43

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#L64

Action Linesdamage
Triggerswhen the NPC is damaged by a player.
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#L54

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#L68

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/npc/traits/AssignmentTrait.java#L231

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#L46

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#L56

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/npc/traits/AssignmentTrait.java#L287

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/npc/traits/AssignmentTrait.java#L298

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#L66

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#L32

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#L42

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#L77

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#L135

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#L180

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#L206

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 NPC loses its assignment.
ContextsNone
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/npc/traits/AssignmentTrait.java#L139

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#L84

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#L151

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#L68

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#L93

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#L161

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#L180