Denizen/0.7/Interact Scripts/Commands: Difference between revisions

From Citizens Wiki
No edit summary
Line 44: Line 44:
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|
FLAG
FLAG
|'[Flag Name]' OR '[[Flag Name]:[Flag Value]]' OR [[Flag Name]:++|--]' (DURATION:[#])
|<nowiki>'[Flag Name]'&nbsp;OR&nbsp;'[[Flag Name]:[Flag Value]]'&nbsp;OR&nbsp;[[Flag Name]:++|--]'&nbsp;(DURATION:[#])</nowiki>
| <p>Requires one of the above arguments. <tt>FLAG</tt> store variables, or 'flags', to a Player. This can be used to keep track of information that can be check against with the FLAGGED requirement. Usage of the command is easy, and can be used in 3 different ways. A Boolean (true/false) value can be set with only a flag name. If set, the value is <tt>TRUE</tt>. When <tt>RESET</tt>, it is <tt>FALSE</tt>. <tt>FLAG</tt> can also set Integer (or number) variables, and easily increment or decrease them with the use of the <tt>++</tt> and <tt>--</tt> arguments accordingly. The command can also store a String value, see the example below. Using a <tt>DURATION</tt> will revert the value of the flag to the previous value, if during the duration the flag has not changed.</p>
| <p>Requires one of the above arguments. <tt>FLAG</tt> store variables, or 'flags', to a Player. This can be used to keep track of information that can be check against with the FLAGGED requirement. Usage of the command is easy, and can be used in 3 different ways. A Boolean (true/false) value can be set with only a flag name. If set, the value is <tt>TRUE</tt>. When <tt>RESET</tt>, it is <tt>FALSE</tt>. <tt>FLAG</tt> can also set Integer (or number) variables, and easily increment or decrease them with the use of the <tt>++</tt> and <tt>--</tt> arguments accordingly. The command can also store a String value, see the example below. Using a <tt>DURATION</tt> will revert the value of the flag to the previous value, if during the duration the flag has not changed.</p>
'''Example Usages'''
'''Example Usages'''
Line 51: Line 51:
- FLAG Alignment:--
- FLAG Alignment:--
- FLAG 'Active Item:60 Feathers'
- FLAG 'Active Item:60 Feathers'
- FLAG HasHealingFlag DURATION:180</pre>
- FLAG HasHealingFlag DURATION:180
</pre>
}}
}}
{{Denizen Command Color 2|mintcream|
{{Denizen Command Color 2|mintcream|

Revision as of 09:31, 18 August 2012

Interact Script Commands

Note: There are plenty more to come, be patient, more are coming! Have ideas for a good command? Let me know!

[] indicates required field, () indicates an optional field, OR indicates alternative usage.

Script Flow Commands

These commands have no external affect on the world, but can control the flow of scripts within Denizen. Though not required, and with the exception of WAIT, it is generally recommended to run these as Instant Commands to ensure smooth Script feedback to players.

Server Commands

Text Commands

These commands show some text to the player interacting, and usually to bystanders around. Note that all text commands must be surrounded by quotes single ' or double ". See: Which Quotes? for more information. Text commands also have some auto-formatting, such as making sure no words will be cut off on long messages, and applying color codes. See: Denizen Color Codes. Formatting for how NPCs and Players talk can be customized in the config.yml.

Denizen NPC Commands

Denizen NPC commands are meant to help bring your Denizen to life by allowing fine-control of small movements. These are not necessarily meant for making the Denizen NPC do large/long activities, those will instead be done by the Activity Engine, which is just now starting to be implemented into Denizen. The next 'large' update will focus on Activities.

* FOLLOW [PLAYER|NOBODY] *: Makes the Denizen follow the player, or stop following the player.

  • WALKTO [Location Bookmark]
    Makes the Denizen walk to a specified location.

Note: I've been having problems getting the NPCs to WALKTO a bookmarked location that is far away, perhaps in a different chunk? Working on it with the C2 team. I may have another workaround as well.

  • WALK [Z] [X] [Y] Note: Z(-NORTH(2)/+SOUTH(0)) X(-WEST(1)/+EAST(3)) Y (+UP/-DOWN)
    Makes the Denizen walk. This is not for making the Denizen to specific coordinates. The values for X Y and Z will get added or subtracted from the Denizen's current location.
  • RETURN
    Can be used after initiating a WALK command. This will make the denizen return to its previous location.

RESPAWN [Location Bookmark]

  • Despawns the Denizen and respawns it to a bookmarked location.

Note: There is something funny going on with NPCs spawning to a location you are very near to. You sometimes have to back away before they show up. This seems to be an issue with Craftbukkit and/or Minecraft Server.

Vault Commands

The commands below require Vault and a valid permissions and economy system. Though Vault is not required to use Denizen, the commands below DO require Vault and its dependencies to be installed. Remember: Vault is not an economy or permissions system, merely a hook to help Denizen connect to your favorite systems!

World Interaction Commands

These commands do something physical to the world or player.


  • SPAWN [ENTITY_TYPE] [AMOUNT] (Location Bookmark)
    Spawns a specified amount of entities. If the location bookmark is missing, they will spawn near the Denizen.
  • TELEPORT [Denizen Name] OR [BOOKMARK:BookmarkName] OR ['BOOKMARK:Denizen Name:BookmarkName']
    Teleports the player interacting to a bookmark or Denizen/

Player Interaction Commands