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...
NameLeash
Syntaxleash (cancel) [<entity>|...] (holder:<entity>/<location>)
Short DescriptionSticks a leash on target entity, held by a fence or another entity.
Full DescriptionAttaches a leash to the specified entity.
The leash may be attached to a fence, or another entity.
Players and Player NPCs may not be leashed.
Note that releasing a mob from a fence post may leave the leash attached to that fence post.

Non-player NPCs can be leashed if '/npc leashable' is enabled.
Related Tags<EntityTag.is_leashed> Returns whether the entity is leashed.
<EntityTag.leash_holder> Returns the leash holder of entity.
Usage Example
# Use to attach a leash to the player's target.
- leash <player.target> holder:<player>
Usage Example
# Use to attach the closest cow in 10 blocks to the fence the player is looking at.
- leash <player.location.find_entities[cow].within[10].first> holder:<player.cursor_on>
Usage Example
# Use to release the target entity.
- leash cancel <player.target>
Groupentity
Sourcehttps://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/scripts/commands/entity/LeashCommand.java#L27