Denizen Script Commands


Commands are always written with a '-' before them, and are the core component of any script, the primary way to cause things to happen.
Learn about how commands work in The Beginner's Guide.


Showing 1 out of 184 commands...
NameAnchor
Syntaxanchor [id:<name>] [remove/add <location>]
Short DescriptionControls an NPC's Anchor Trait.
Full DescriptionThe anchor system inside Citizens allows locations to be 'bound' to an NPC, saved by an 'id'.
The anchor command can add and remove new anchors.
The Anchors Trait can also be used as a sort of 'waypoints' system.
As the Anchor command is an NPC specific command, a valid npc object must be referenced in the script entry.
If none is provided by default, use the 'npc:<npc>' argument.
Related Tags<NPCTag.anchor[anchor_name]> Returns the location associated with the specified anchor, or null if it doesn't exist.
<NPCTag.list_anchors> Returns a list of anchor names currently assigned to the NPC.
<NPCTag.has_anchors> Returns whether the NPC has anchors assigned.
Usage Example
# Use to add and remove anchors to an NPC.
- define location_name <context.message>
- chat "I have saved this location as <[location_name]>.'
- anchor add <npc.location> id:<[location_name]>
Groupnpc
RequiresCitizens
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/npc/AnchorCommand.java#L26