Denizen/0.7/Interact Scripts/Commands: Difference between revisions
< Denizen | 0.7 | Interact Scripts
No edit summary |
|||
(89 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
= | |||
For more up-to-date information and full details on specific features (individual commands or tags, for example), check the [https://meta.denizenscript.com/ Meta Documentation]. | |||
If you want a full tutorial to help get you set up, check out the [https://guide.denizenscript.com/ Beginner's Guide] text website. | |||
If you need quick help, visit our [https://discord.gg/Q6pZGSR Discord group]. | |||
<br><br><br> | |||
<span style="font-family:natalya-alternate-one; font-size:300%; margin-right:-7px; margin-left:-10px;">This wiki is outdated, please view the tutorial videos/guide, meta documentation, or Discord group (all linked above) for up-to-date information!</span> | |||
<br><br><br> | |||
<div style="margin-right:2.0em; padding:10px; font-family:museo-sans; font-size:110%;"> | <div style="margin-right:2.0em; padding:10px; font-family:museo-sans; font-size:110%;"> | ||
Interact Script Commands are used to make the Denizen perform actions in an Interact Script. They are written in a [[YAML]] sequence under the Script node of an [[Denizen/Interact_Scripts/Triggers|Interact Trigger]]. A single entry in the sequence contains a Command and Modifiers. Some commands have no available modifiers. | |||
</div> | </div> | ||
====Script Flow | ===Syntax=== | ||
<div style=" | Syntax is very important for proper execution. | ||
These commands have no external | *Placing a caret ^ in front of the command name causes that command to ignore the normal 0.5 second delay between commands. | ||
*The command must be upper-case (i.e CHAT not chat) | |||
*Modifiers are not case sensitive. | |||
*Modifiers in '''[Brackets]''' are '''required''' for the command to execute. [A or B] means ''either'' A or B is required. | |||
*Modifiers in '''(Parentheses)''' are optional, and generally change the default behavior of the command. | |||
*Modifiers that take a value are of the form MODIFIER:VALUE. | |||
**If the VALUE of the modifier contains a space, such as in the case of a NPC or script name, the whole modifier must be put in quotes. | |||
::Example: <code>- TELEPORT BOOKMARK:Bob:Bobshouse</code> is okay, but <code>- TELEPORT 'BOOKMARK:Bob Jones:Bobshouse'</code> requires the quotes to function properly. | |||
Example: | |||
<pre> | |||
Some Trigger: | |||
Script: | |||
- COMMAND1 MODIFIER1 MODIFIER2:VALUE | |||
- COMMAND2 'MODIFIER1:Value With Spaces' | |||
- ^COMMAND3 'This will run instantly after COMMAND2' | |||
</pre> | |||
===List of Commands=== | |||
====Script Flow==== | |||
<div style="font-family:museo-sans;"> | |||
These commands have no external effect on the world, but can control the flow of scripts within Denizen. Though not required, and with the exception of <tt>WAIT</tt>, it is generally recommended to run these as <tt>Instant Commands</tt> to ensure smooth Script feedback to players. | |||
{{Denizen Command Color 2|mintcream| | |||
CANCELTASK | |||
|['SCRIPT:Name of Script'] | |||
|Cancels a task that has been scheduled for the interacting player using RUNTASK DELAY | |||
'''Example Usages''' | |||
<pre> | |||
- CANCELTASK SCRIPT:RaceEnd | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | |||
COOLDOWN | |||
|[# or DURATION:#] (GLOBAL) ('SCRIPT:Name of Script') | |||
|Sets a cooldown period for this script. Defaults to the currently running script and the interacting player. Until the script has cooled down, it will not be selected to run again. Requires a number of seconds to be specified with or without the DURATION: modifier name. | |||
Modifiers: | |||
*GLOBAL makes the script unavailable to everyone, instead of just the interacting player. | |||
*SCRIPT: Sets the cooldown a different script. | |||
'''Example Usages''' | |||
<pre> | |||
- COOLDOWN 60 | |||
- COOLDOWN GLOBAL 100 | |||
- COOLDOWN 'SCRIPT:A Different Script' 600 | |||
- COOLDOWN DURATION:15 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | |||
DISENGAGE | |||
|(NPCID:#) | |||
|<p>Allowed an <tt>ENGAGED</tt> Denizen to be interacted with again, the counterpart to the <tt>ENGAGE</tt> command. Can also specify the NPCID of a different Denizen</p> | |||
'''Example Usages''' | |||
<pre> | |||
- ENGAGE | |||
- (Other Commands) | |||
- DISENGAGE | |||
- DISENGAGE NPCID:7 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
ENGAGE | ENGAGE | ||
|DURATION: | |(DURATION:#) (NPCID:#) | ||
| <p>Blocks player interaction from triggering the NPC. This may be useful if a long script required the player to listen or watch a series of events and you didn't want the Player to be able to interact while these commands were being taken out. Use with either a <tt>DURATION</tt> or <tt>DISENGAGE</tt>. <tt>DURATION</tt> will automatically <tt>DISENGAGE</tt> after the specified amount of seconds. If no <code>NPCID</code> is included, the Denizen triggered is used. Remember: While <tt>ENGAGED</tt>, no scripts will trigger, so be diligent in using!</p> | | <p>Blocks player interaction from triggering the NPC. This may be useful if a long script required the player to listen or watch a series of events and you didn't want the Player to be able to interact while these commands were being taken out. Use with either a <tt>DURATION</tt> or <tt>DISENGAGE</tt>. <tt>DURATION</tt> will automatically <tt>DISENGAGE</tt> after the specified amount of seconds. If no <code>NPCID</code> is included, the Denizen triggered is used. Remember: While <tt>ENGAGED</tt>, no scripts will trigger, so be diligent in using!</p> | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre>- ENGAGE | <pre> | ||
- ENGAGE DURATION:12 | - ENGAGE | ||
- (Other Commands) | |||
- DISENGAGE | |||
- ENGAGE DURATION:12 | |||
- ENGAGE NPCID:2</pre> | - ENGAGE NPCID:2</pre> | ||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
FAIL | |||
|( | |('SCRIPT:Name of Script') | ||
| <p> | | <p>Marks a script as 'Failed' to check against with the <tt>FAILED</tt> requirement. This is identical to the <tt>FINISH</tt> command, except keeps track of 'fails' instead. Again, this is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can <tt>FAIL</tt> a script multiple times and it will keep track of the total number, unless <tt>RESET</tt>. Note: A script can be both 'finished' and 'failed', the two commands work independently.</p> | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre>- | <pre>- FAIL | ||
- | - FAIL 'SCRIPT:Magic Feathers'</pre> | ||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
FINISH | |||
| | |('SCRIPT:Name of Script') | ||
| <p>Marks a script as 'Finished' to check against with the <tt>FINISHED</tt> requirement. This is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can <tt>FINISH</tt> a script multiple times and it will keep track of the total number, unless <tt>RESET</tt>.</p> | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre>- | <pre>- FINISH | ||
- | - FINISH 'SCRIPT:Another Script'</pre> | ||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
FLAG | FLAG | ||
| | |['Flag Name' or 'Flag Name:Flag Value' or 'Flag Name:++' or 'Flag Name:--'] (PLAYER or DENIZEN or GLOBAL) (DURATION:#) | ||
| <p>Requires one of the above arguments. <tt>FLAG</tt> | | <p>Requires one of the above arguments. <tt>FLAG</tt> stores variables, or 'flags', by default 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. Using the PLAYER modifier will set the flag on the Player (which is the default behavior). Using the DENIZEN modifier will set a flag on the Denizen instead of the Player. Using the GLOBAL modifier will set a flag independent of a Player or Denizen.</p> | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre>- FLAG 'Sample Boolean Flag' | <pre>- FLAG 'Sample Boolean Flag' | ||
Line 51: | Line 131: | ||
- FLAG Alignment:-- | - FLAG Alignment:-- | ||
- FLAG 'Active Item:60 Feathers' | - FLAG 'Active Item:60 Feathers' | ||
- FLAG WorldBossDead GLOBAL | |||
- FLAG HasHealingFlag DURATION:180 | - FLAG HasHealingFlag DURATION:180 | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
IF | |||
|('SCRIPT: | |(EXACTLY) (PLAYER or DENIZEN or GLOBAL) (-)[FLAG:Name or FLAG:Name:Value] (IS_NUMBER) ['SCRIPT:Script Run When Condition Met'] (QUEUE:TRIGGER or QUEUE:TASK) (APPEND) (ELSE 'SCRIPT:Script Run When Condition Not Met') | ||
| | |Checks the value of a FLAG and runs a TASK script if the condition is met. By default the TASK script will run before the interact script continues. | ||
Modifiers: | |||
*EXACTLY - For integer flags, the IF condition is met only if the value matches exactly. By default, the condition is met if the flag's value is greater than or equal to the value it is checked against, i.e. IF 'FLAG:AGE:13' will pass for any AGE that is at least 13, but IF EXACTLY 'FLAG:AGE:13' will only pass if the AGE is 13. | |||
*PLAYER - Check a flag set on this Player (which is the default behavior) | |||
*DENIZEN - Check a DENIZEN flag set on the Denizen itself instead of a flag on this Player | |||
*GLOBAL - Check a GLOBAL flag instead of a flag on this Player | |||
*IS_NUMBER - The IF condition is met only if the value of the flag is an integer or double. | |||
*APPEND - Runs the TASK after this script completes, instead of before the next command. | |||
*QUEUE - Specify which queue to run the commands in, defaults to the executing queue type. | |||
*ELSE - Choose a TASK script to run when the IF condition is not met. | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre>- | <pre> | ||
- | - IF FLAG:BossDead SCRIPT:Reward APPEND | ||
- IF EXACTLY FLAG:Stage:4 SCRIPT:Stage4Instructions | |||
- IF 'FLAG:AGE:13' 'SCRIPT:Meets Minimum Age' ELSE 'SCRIPT:Does Not Meet Minimum Age' | |||
</pre> | |||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
RANDOM | |||
| | |[#] | ||
| | |Selects a single command to run from the next # lines in the script and discards the rest. | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre>- | <pre> | ||
- | - CHAT "I'm going to say the name of an animal" | ||
- RANDOM 3 | |||
- CHAT "Cow" | |||
- CHAT "Zebra" | |||
- CHAT "Elephant" | |||
- CHAT "Wasn't that fun?" | |||
</pre> | |||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
RESET | RESET | ||
|('SCRIPT: | |[FINISHED or FAILED or FLAG:FlagName] ('SCRIPT:Name of Script') | ||
| <p>Sets | | <p>Sets the FINISHED or FAILED count of the specified script to 0, or sets the specified boolean flag to False. Remember: Script and Flag names are case sensitive!</p> | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- RESET FINISHED 'SCRIPT:Magic Feathers'</pre> | - RESET FINISHED 'SCRIPT:Magic Feathers' | ||
- RESET FLAG:SomeFlag | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | |||
RUNTASK | |||
|['SCRIPT:Name of Script'] (DELAY:#) (NPCID:#) | |||
|Runs a TASK script as the Denizen on the interacting player. | |||
Modifiers: | |||
*DELAY waits this number of seconds before running the task. specific to the interacting player. If this task is already pending for this player, it is canceled and re-applied with the new delay. | |||
*NPCID runs the task as a different Denizen. | |||
'''Example Usages''' | |||
<pre> | |||
- RUNTASK 'SCRIPT:Apple Reward' | |||
- RUNTASK SCRIPT:RaceEnd DELAY:60 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | |||
WAIT | |||
|[# of Seconds] (QUEUE:TASK) (QUEUE:TRIGGER) | |||
| <p>Pauses a Queue for a specified amount of seconds. If no <tt>QUEUE</tt> is specified, the sending queue is used. For example, if the command is sent from an Interact (Triggered) Script, the queue that will be held is the 'Trigger Queue'. Could be useful in advanced usage situations when using both Task Scripts and Interact Scripts together.</p> | |||
'''Example Usages''' | |||
<pre>- WAIT 6 | |||
- WAIT 30 QUEUE:TASK</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | |||
ZAP | |||
|(Step #) ('SCRIPT:Name of Script') (DURATION:#) (RANDOM:#-#) | |||
| <p>A very powerful command, indeed. This is how Scripts progress through their steps. It is not done automatically, instead, you get to decide how to progress. ZAP used alone will simply progress the Player to the next step in the Script. Note: Denizen does not check whether the step exists, so you can use that to your advantage in an Overlay Script Assignment. If an Integer is used, that step will be used.</p> | |||
<p>Specify a <tt>SCRIPT</tt> to change the active step for a Player in a specific Script. If not specified, the triggering Script is used. A <tt>DURATION</tt> can be set to provide an automatic "DEZAP" of sorts, reverting the step back after a specific amount of seconds, unless, in that duration another ZAP command has taken place. This can be used as a 'timeout' of sorts. <tt>RANDOM</tt> can be used to let chance select the step to progress the Player to. If one Integer is included, steps 1 through the chosen number will be randomly selected. You can also use a range of numbers if two Integers are used.</p> | |||
'''Example Usages''' | |||
<pre> | |||
- ZAP | |||
- ZAP 5 | |||
- ZAP RANDOM:6 | |||
- ZAP RANDOM:3-6 DURATION:60 | |||
- ZAP 6 'SCRIPT:Another Script' | |||
</pre> | |||
}} | }} | ||
</div> | </div> | ||
====Server | ====Server==== | ||
{{Denizen Command Color 2|aliceblue| | {{Denizen Command Color 2|aliceblue| | ||
EXECUTE | EXECUTE | ||
| [ASPLAYER or ASSERVER or ASNPC] ["command and arguments"] | | [ASPLAYER or ASSERVER or ASNPC] ["command and arguments"] | ||
| <p>Runs a Minecraft/Bukkit command. Specifying <tt>ASPLAYER, ASSERVER, or ASNPC</tt> defines how the command should be executed. ASNPC will run the command as the Denizen interacting, temporarily granting OP privileges, if the Denizen NPC is a Human-type NPC. Running ASSERVER will run as a console command, and running ASPLAYER will simply run the command as the Player. When specifying the command and arguments, it is not necessary to use the '/' that is generally used when running commands in-game. You may also use <PLAYER> | | <p>Runs a Minecraft/Bukkit command. Specifying <tt>ASPLAYER, ASSERVER, or ASNPC</tt> defines how the command should be executed. ASNPC will run the command as the Denizen interacting, temporarily granting OP privileges, if the Denizen NPC is a Human-type NPC. Running ASSERVER will run as a console command, and running ASPLAYER will simply run the command as the Player. When specifying the command and arguments, it is not necessary to use the '/' that is generally used when running commands in-game. You may also use <PLAYER>, <WORLD>, or <NPCID> as variables inside the command arguments.</p> | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre>EXECUTE ASSERVER 'gamemode <PLAYER> 2' | <pre>EXECUTE ASSERVER 'gamemode <PLAYER> 2' | ||
Line 91: | Line 233: | ||
EXECUTE ASPLAYER 'spawn'</pre> | EXECUTE ASPLAYER 'spawn'</pre> | ||
}} | }} | ||
<div style="font-family:museo-sans; font-size:110%;"> | <div style="font-family:museo-sans; font-size:110%;"> | ||
The commands below require Vault and a valid permissions system. | |||
The commands below require [[http://dev.bukkit.org/server-mods/vault/ Vault]] and a valid permissions system. | |||
</div> | </div> | ||
{{Denizen Command Color 2| aliceblue| | {{Denizen Command Color 2| aliceblue| | ||
PERMISS | PERMISS | ||
| | |[permission.node or 'GROUP:Group Name'] (WORLD) ('WORLD:World Name') | ||
| <p>Gives the Player either a permissions node or adds a group, if supported by your permissions system. Note: You should not include both a permissions node and a group. If you specify a <tt>WORLD</tt> argument, it will apply the permissions node/group only to the current world. You can alternatively specify a world with <tt>WORLD:worldName</tt>.</p> | |<p>Gives the Player either a permissions node or adds a group, if supported by your permissions system. Note: You should not include both a permissions node and a group. If you specify a <tt>WORLD</tt> argument, it will apply the permissions node/group only to the current world. You can alternatively specify a world with <tt>WORLD:worldName</tt>.</p> | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
Line 108: | Line 253: | ||
{{Denizen Command Color 2| aliceblue| | {{Denizen Command Color 2| aliceblue| | ||
REFUSE | REFUSE | ||
| | |[permission.node or 'GROUP:Group Name'] (WORLD) ('WORLD:World Name') | ||
| Removes from the Player either a permissions node or a group, if supported by your permissions system. Note: You should not include both a permissions node and a group. If you specify a <tt>WORLD</tt> argument, it will remove the permissions node/group only to the current world. You can alternatively specify a world with <tt>WORLD:worldName</tt>. Generally, however you add your permissions or group with <tt>PERMISS</tt>, you should do the same when removing with <tt>REFUSE</tt>. | | Removes from the Player either a permissions node or a group, if supported by your permissions system. Note: You should not include both a permissions node and a group. If you specify a <tt>WORLD</tt> argument, it will remove the permissions node/group only to the current world. You can alternatively specify a world with <tt>WORLD:worldName</tt>. Generally, however you add your permissions or group with <tt>PERMISS</tt>, you should do the same when removing with <tt>REFUSE</tt>. | ||
'''Example Usages''' | '''Example Usages''' | ||
Line 118: | Line 263: | ||
}} | }} | ||
==== | ====Speech==== | ||
<div style=" | <div style="font-family:museo-sans;"> | ||
These commands show some text to the player interacting, and usually to bystanders around | These commands show some text to the player interacting, and usually to bystanders around. 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: [[Color_Codes|Denizen Color Codes]]. Formatting for how NPCs and Players talk can be customized in the [[Denizen/config.yml]]. | ||
*All Speech commands '''require quotes''' (single (' ') or double (" ")) around the text. If your text has an apostrophe (') in it, you '''MUST''' use double quotes (" ")!! | |||
There are various placeholders you can use to fill in specific information. The basic ones are: | |||
*<NPC> - The Denizens's name. | |||
*<PLAYER> - The interacting Player's name | |||
*<DISPLAYNAME> - The interacting Player's display name | |||
*<HEALTH> - The interacting Player's heath | |||
*<WORLD> - The name of the Denizen's world | |||
If you use the NOPLAYER modifier on a text command the <PLAYER>, <DISPLAYNAME> and <HEALTH> tags are not available. | |||
A list of all available placeholders can be found in [[Replaceables]]. | |||
{{Denizen Command Color 2|lavender| | |||
ANNOUNCE | |||
|['The text to announce.'] | |||
| Sends the text as a sever announcement to all players, regardless of their place in the world. Could be especially useful for any kind of administration script. | |||
'''Example Usages''' | |||
<pre> | |||
- ANNOUNCE "<PLAYER> has found a secret!" | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|lavender| | {{Denizen Command Color 2|lavender| | ||
CHAT | CHAT | ||
|["The text to chat."] (NPCID: | |["The text to chat."] (NPCID:#) (NOPLAYER) | ||
| Makes the Denizen talk to the player. This is the standard chat mechanism in Denizen. You can also change the NPC doing the talking by specifying a Denizen's C2 NPCID. If you would rather the Denizen NPC not speak to the Player directly, use the <tt>NOPLAYER</tt> argument. | | Makes the Denizen talk to the player. This is the standard chat mechanism in Denizen. You can also change the NPC doing the talking by specifying a Denizen's C2 NPCID. If you would rather the Denizen NPC not speak to the Player directly, use the <tt>NOPLAYER</tt> argument. | ||
'''Example Usages''' | '''Example Usages''' | ||
Line 133: | Line 301: | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|lavender| | {{Denizen Command Color 2|lavender| | ||
EMOTE | |||
|[ | |['The text to emote.'] (NPCID:#) | ||
| | | Let's the Denizen NPC show emotion. Similar to the /me command in IRC, for example. Could be useful for describing to the player what an NPC Denizen may need, or how the NPC Denizen is feeling. <tt>NPCID</tt> can be specified to change the Denizen NPC doing the 'emote'. | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - EMOTE 'is looking a bit nervous.' | ||
- | - EMOTE NPCID:82 'thinks you should ask a few questions.' | ||
- EMOTE "could use a stiff drink." | |||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|lavender| | {{Denizen Command Color 2|lavender| | ||
HINT | |||
| | |(SHORT) | ||
| | | If called from an Interact Script Step with a Chat Trigger, this will output a list of all possible things the player can say to activate a chat trigger. | ||
Modifiers: | |||
*SHORT | |||
::The Denizen will only say the list of trigger words, instead of the full sentence. | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - HINT | ||
- | - HINT SHORT | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|lavender| | {{Denizen Command Color 2|lavender| | ||
NARRATE | NARRATE | ||
Line 173: | Line 337: | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|lavender| | {{Denizen Command Color 2|lavender| | ||
SHOUT | |||
|[ | |["The text to chat."] (NPCID:#) (NOPLAYER) | ||
| | | Shouts the text to players nearby. The range that a bystander can hear an NPC Denizen shout is larger then that of a standard <tt>CHAT</tt>, so it also has some technical advantages. <tt>NPCID</tt> can be specified. Using <tt>NOPLAYER</tt> will drop reference to the Player when talking. You can still reference <PLAYER>, however, if need be. See the example below for an idea for usage. | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - SHOUT "EEEK! a spider!" | ||
- SHOUT NOPLAYER "<PLAYER> is a thief! Get him!" | |||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|lavender| | {{Denizen Command Color 2|lavender| | ||
WHISPER | |||
|( | |["The text to whisper."] (NPCID:#) (NOPLAYER) | ||
| | | Whispers the text to the player. Really just an alternative to CHAT. By default, bystanders can't hear what the NPC whispers to the interacting Player. As with the <tt>CHAT</tt> command, NPCID can be specified. Using NOPLAYER is possible too, since it may be of use in some circumstances. But remember: by default, no bystanders can see the actual text the NPC Denizen whispers. This can be changed in the [[config.yml]]. | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - WHISPER "The password is.. 42." | ||
- | - WHISPER NPCID:2 "Hey, I didn't want to blurt this out so everyone could hear, but..." | ||
</pre> | </pre> | ||
}} | }} | ||
</div> | </div> | ||
====Denizen | ====Denizen Interaction==== | ||
Denizen | Denizen interaction commands are meant to help bring your Denizen to life by allowing fine control of movement and actions during scripts. These are not meant for making the Denizen do continuous movement and actions, that should instead be done via [[Denizen/Activity_Scripts/Activities|Activities]]. | ||
{{Denizen Command Color 2|mintcream| | |||
HOLD | |||
| [ID or ID:Data or MATERIAL or MATERIAL:Data] | |||
| Makes the Denizen hold a specific block or item. | |||
'''Example Usages''' | |||
<pre> | |||
- HOLD IRON_PICKAXE | |||
- HOLD 98:3 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
LOOK | LOOK | ||
| | |[DIRECTION or BOOKMARK:BookamrkName or 'BOOKMARK:Denizen Name:BookmarkName' or CLOSE or AWAY] (NPCID:#) (DURATION:#) | ||
| <p>This command controls where the NPC Denizen is looking. It requires either a Direction, Bookmark, or look-close trait state. Valid directions: <tt>UP, DOWN, LEFT, RIGHT, NORTH, SOUTH, EAST, WEST, AT, and BACK</tt>. Looking <tt>AT</tt> or <tt>BACK</tt> takes the Player's position for reference. AT will look at the Player, <tt>BACK</tt> will look away from the player. Using <tt>CLOSE|AWAY</tt> will toggle the NPC's <tt>look-close trait</tt>. <tt>CLOSE</tt> will make the NPC's head follow the closest Player to it. You can toggle off this behavior by using <tt>AWAY</tt>, not to be confused with <tt>BACK</tt>. If you specify a Location Bookmark instead of a direction, the NPC will take the pitch and yaw from the information stored in the bookmark. Note: This does not affect the actual position of the NPC Denizen, only the head position. Using a <tt>DURATION</tt> argument will restore the previous head position after that amount of time. Note: The script queue will continue as normal, so if the NPC moves or uses another LOOK command in this duration, it may get glitchy. Either time your commands appropriately, or use a <tt>WAIT</tt> command to compensate. The optional argument <tt>NPCID</tt> will change the Denizen NPC doing the looking. | | <p>This command controls where the NPC Denizen is looking. It requires either a Direction, Bookmark, or look-close trait state. Valid directions: <tt>UP, DOWN, LEFT, RIGHT, NORTH, SOUTH, EAST, WEST, AT, and BACK</tt>. Looking <tt>AT</tt> or <tt>BACK</tt> takes the Player's position for reference. AT will look at the Player, <tt>BACK</tt> will look away from the player. Using <tt>CLOSE|AWAY</tt> will toggle the NPC's <tt>look-close trait</tt>. <tt>CLOSE</tt> will make the NPC's head follow the closest Player to it. You can toggle off this behavior by using <tt>AWAY</tt>, not to be confused with <tt>BACK</tt>. If you specify a Location Bookmark instead of a direction, the NPC will take the pitch and yaw from the information stored in the bookmark. Note: This does not affect the actual position of the NPC Denizen, only the head position. Using a <tt>DURATION</tt> argument will restore the previous head position after that amount of time. Note: The script queue will continue as normal, so if the NPC moves or uses another LOOK command in this duration, it may get glitchy. Either time your commands appropriately, or use a <tt>WAIT</tt> command to compensate. The optional argument <tt>NPCID</tt> will change the Denizen NPC doing the looking. | ||
'''Example Usages''' | '''Example Usages''' | ||
Line 210: | Line 385: | ||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | |||
PAUSE | |||
|(DURATION:#) | |||
|Causes the Denizen to stop any pathing or activities. Useful for keeping it in place during an interaction. | |||
Modifiers: | |||
*DURATION: | |||
::Automatically RESUME after the specified number of seconds. | |||
'''Example Usages''' | |||
<pre> | |||
- PAUSE | |||
- PAUSE DURATION:30 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
RESUME | |||
| | | | ||
| | |Cancels a previous PAUSE command. | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - RESUME | ||
</pre> | </pre> | ||
}} | }} | ||
Line 226: | Line 411: | ||
{{Denizen Command Color 2|mintcream| | {{Denizen Command Color 2|mintcream| | ||
RETURN | RETURN | ||
| | |(SPEED:#) | ||
| Makes the denizen walk back to the | |Makes the denizen walk back to the position it was at before a call to WALKTO or WALK. Will resume NPC pathing if set. | ||
Modifiers: | |||
* SPEED: is the movement speed, generally should be between 0.1 and 1.5 | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- WALKTO | - WALKTO BOOKMARK:Somewhere | ||
- RETURN | - RETURN | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|mintcream| | |||
WALK | |||
|(FORWARD:#) (NORTH:#) (SOUTH:#) (EAST:#) (WEST:#) (UP:#) (DOWN:#) (X:#) (Y:#) (Z:#) (SPEED:#) | |||
|Makes the denizen walk some distance from its current position. Interrupts any current movement, and pauses the NPC pathing if active. All provided directions are added into one movement. Decimal and negative values are accepted. | |||
Modifiers: | |||
* SPEED: is the movement speed, generally should be between 0.1 and 1.5 | |||
* FORWARD: makes the Denizen walk in whatever direction it is currently facing. Combine LOOK CLOSE and a negative value to walk directly away from the player. | |||
* +X is the same as EAST | |||
* +Y is the same as UP | |||
* +Z is the same as NORTH | |||
'''Example Usages''' | |||
<pre> | |||
- WALK NORTH;4 EAST:2.5 | |||
- WALK FORWARD:1 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|mintcream| | |||
WALKTO | |||
|[BOOKMARK:LocationBookmark or 'BOOKMARK:DenizenName:LocationBookmark' or PLAYER] (SPEED:#) | |||
|Makes the denizen walk to the specified location bookmark, or to the interacting player. Interrupts any current movement, and pauses the NPC pathing if active. | |||
Modifiers: | |||
* SPEED: is the movement speed, generally should be between 0.1 and 1.5 | |||
'''Example Usages''' | |||
<pre> | |||
- WALKTO PLAYER | |||
- WALKTO 'BOOKMARK:Gary:GarysHouse' | |||
</pre> | |||
}} | |||
====World Interaction==== | |||
{{Denizen Command Color 2|lightgoldenrodyellow| | |||
DROP | |||
| [ID or ID:Data or MATERIAL or MATERIAL:Data or XP] (QTY:#) (BOOKMARK:LocationBookmark) | |||
| Drop an item at the Denizen's location, or at a location bookmark if one is specified. | |||
'''Example Usages''' | |||
<pre> | |||
- DROP DIAMOND QTY:3 | |||
- DROP 18:3 QTY:1 BOOKMARK:LargeTree | |||
- DROP XP QTY:10 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2| | {{Denizen Command Color 2|lightgoldenrodyellow| | ||
LISTEN KILL | |||
|[ | |[TYPE:GROUP or TYPE:PLAYER or TYPE:ENTITY or TYPE:NPC] [NAME:Name or NPCID:#] (QTY:#) [SCRIPT:Task Script] (ID:Name) | ||
| This command | | This command starts the Denizen listening for the player to kill the specified number of specified targets, then runs a task script. Use the NAME:Name modifier when specifying a group name, player name, or [[Types|entity type]] (like 'ZOMBIE'). Use NPCID:# modifier when using TYPE:NPC. | ||
Modifiers: | Optional Modifiers: | ||
* | *QTY: - The number things the player must kill before the script is run. | ||
: | *ID: - The name of the kill listener; without it, the listener will take on the name of the script run upon completion. | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - LISTEN KILL TYPE:ENTITY NAME:ZOMBIE QTY:5 SCRIPT:ZombieReward | ||
- | - LISTEN KILL ID:BossListener TYPE:NPC NPCID:12 'SCRIPT:Kill Boss Reward' | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2| | {{Denizen Command Color 2|lightgoldenrodyellow| | ||
SPAWN | SPAWN | ||
|[ENTITY_TYPE] (QTY:#) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (SPREAD:#) ('EFFECT:[POTION_EFFECT] [LEVEL]') ('OPTION:[OPTIONS]') | |[ENTITY_TYPE] (QTY:#) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (SPREAD:#) ('EFFECT:[POTION_EFFECT] [LEVEL]') ('OPTION:[OPTIONS]') | ||
Line 276: | Line 498: | ||
****SHEEP can have SHEARED and COLORED | ****SHEEP can have SHEARED and COLORED | ||
****WOLF and PIG_ZOMBIE can have ANGRY | ****WOLF and PIG_ZOMBIE can have ANGRY | ||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
Line 288: | Line 509: | ||
}} | }} | ||
{{Denizen Command Color 2| | {{Denizen Command Color 2|lightgoldenrodyellow| | ||
STRIKE | |||
|(DENIZEN) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (NODAMAGE) (NPCID:#) | |||
|Lightning at your fingertips. | |||
Modifiers: | |||
*DENIZEN | |||
:: Strike lightning at the Denizen's location instead of the player. | |||
*LocationBookmark | |||
:: Strike lightning at the location bookmark instead of the player. | |||
*NPCID:# | |||
:: Strike lightning at the location of the specified NPC (using the npc id) | |||
*NODAMAGE | |||
:: Lightning is cosmetic and does no damage. | |||
'''Example Usages''' | |||
<pre> | |||
- STRIKE | |||
- STRIKE BOOKMARK:BigTree | |||
- STRIKE DENIZEN NODAMAGE | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|lightgoldenrodyellow| | |||
SWITCH | |||
|[BOOKMARK:BlockBookmark] or [BOOKMARK:DenizenName:BlockBookmark] (DURATION:#) | |||
| This command will activate a button, switch or pressure plate at the designated '''block''' bookmark. | |||
Modifiers: | |||
*DURATION:# | |||
:: Will switch the device again after the specified number of seconds. | |||
'''Example Usages''' | |||
<pre> | |||
- SWITCH BOOKMARK:LightSwitch DURATION:30 | |||
- SWITCH BOOKMARK:Jimbo:JimbosButton | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|lightgoldenrodyellow| | |||
WEATHER | WEATHER | ||
| [SUNNY or STORMY or PRECIPITATING] | | [SUNNY or STORMY or PRECIPITATING] | ||
Line 298: | Line 554: | ||
}} | }} | ||
{{Denizen Command Color 2| | ====Player Interaction==== | ||
These commands default to affecting the interacting player. Most have modifiers to affect the executing Denizen instead. | |||
|( | |||
| | {{Denizen Command Color 2|palegreen| | ||
CAST | |||
| [SpellName] (DURATION:#) (POWER:#) (NPC:#) (PLAYER:PlayerName) | |||
| Gives the specified target a potion effect. [[Alchemist#Valid_Effects | Valid potion names are the same as the Alchemist's.]] | |||
Modifiers: | Modifiers: | ||
* | *DURATION:# | ||
:: | ::The effect duration, in seconds. Default is 60. | ||
*POWER:# | |||
::The level of the effect, usually 1-5. Default is 1. | |||
*NPC:# | |||
::The NPC to cast the effect on, instead of the interacting player. Specify with the NPC id. | |||
*PLAYER:PlayerName | |||
::The Player to cast the effect on, instead of the interacting player. | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - CAST SPELL:confusion DURATION:300 POWER:3 | ||
- | - CAST SPELL:speed | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2| | {{Denizen Command Color 2|palegreen| | ||
FEED | |||
|( | |(AMOUNT:#) | ||
| | |Feeds the interacting player. Provides food and saturation. | ||
Modifiers: | Modifiers: | ||
AMOUNT: The amount to feed. Default is 20. | |||
: | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - FEED | ||
- | - FEED 5 | ||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|palegreen| | {{Denizen Command Color 2|palegreen| | ||
GIVE | GIVE | ||
| [MONEY or ID or ID:Data or MATERIAL:Data | |[MONEY or XP or HEROESEXP or ID or ID:Data or MATERIAL or MATERIAL:Data] (QTY:#) | ||
| | | | ||
Gives something to the Player. If QTY: is not specified default is 1. | Gives something to the Player. If QTY: is not specified, its default value is 1. You can also give Minecraft XP by using 'XP'. | ||
Using HEROESEXP type will give the Player (or Hero) Questing Experience. Note: This requires HEROES to be installed on your server! | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
Line 346: | Line 601: | ||
- GIVE 17:2 QTY:3 | - GIVE 17:2 QTY:3 | ||
- GIVE LEAVES:2 | - GIVE LEAVES:2 | ||
- GIVE HEROESEXP QTY:25 | |||
</pre> | </pre> | ||
}} | }} | ||
{{Denizen Command Color 2|palegreen| | |||
HARM | |||
|(DENIZEN) (AMOUNT:#) | |||
|Hurts the the interacting player. | |||
Modifiers: | |||
*DENIZEN | |||
::Hurts the Denizen instead of the player. | |||
*AMOUNT: | |||
::The amount to hurt, if not specified defaults to 1 point. | |||
'''Example Usages''' | |||
<pre> | |||
- HARM AMOUNT:5 | |||
- HARM DENIZEN | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|palegreen| | |||
HEAL | |||
|(DENIZEN) (AMOUNT:#) | |||
|Heals the interacting player. | |||
Modifiers: | |||
*DENIZEN | |||
::Heals the Denizen instead of the player. | |||
*AMOUNT: | |||
::The amount to heal, will not heal beyond the maximum. Defaults to a full heal if not specified. | |||
'''Example Usages''' | |||
<pre> | |||
- HEAL | |||
- HEAL DENIZEN AMOUNT:1 | |||
</pre> | |||
}} | |||
{{Denizen Command Color 2|palegreen| | {{Denizen Command Color 2|palegreen| | ||
TAKE | TAKE | ||
| [MONEY or ITEMINHAND or ID or ID:Data or MATERIAL:Data | | [MONEY or ITEMINHAND or ID or ID:Data or MATERIAL or MATERIAL:Data] (QTY:#) | ||
| | | | ||
Takes something from the Player. If QTY: is not specified default is 1. | Takes something from the Player. If QTY: is not specified, its default value is 1. | ||
'''Example Usages''' | '''Example Usages''' | ||
Line 364: | Line 653: | ||
{{Denizen Command Color 2|palegreen| | {{Denizen Command Color 2|palegreen| | ||
TELEPORT | |||
| | |(DENIZEN) [BOOKMARK:LocationBookmark or 'BOOKMARK:Denizen Name:LocationBookmark'] | ||
| | |Teleports the interacting to player or denizen to the specified bookmark. | ||
Modifiers: | Modifiers: | ||
* | *DENIZEN | ||
::Teleport the Denizen instead of the player. | |||
:: | |||
'''Example Usages''' | '''Example Usages''' | ||
<pre> | <pre> | ||
- | - TELEPORT BOOKMARK:FarAwayPlace | ||
- | - TELEPORT DENIZEN 'BOOKMARK:Jim:JimsBasement' | ||
</pre> | </pre> | ||
}} | }} | ||
[[Category:Denizen 0.7]] |
Latest revision as of 19:02, 3 September 2021
For more up-to-date information and full details on specific features (individual commands or tags, for example), check the Meta Documentation.
If you want a full tutorial to help get you set up, check out the Beginner's Guide text website.
If you need quick help, visit our Discord group.
This wiki is outdated, please view the tutorial videos/guide, meta documentation, or Discord group (all linked above) for up-to-date information!
Interact Script Commands are used to make the Denizen perform actions in an Interact Script. They are written in a YAML sequence under the Script node of an Interact Trigger. A single entry in the sequence contains a Command and Modifiers. Some commands have no available modifiers.
Syntax
Syntax is very important for proper execution.
- Placing a caret ^ in front of the command name causes that command to ignore the normal 0.5 second delay between commands.
- The command must be upper-case (i.e CHAT not chat)
- Modifiers are not case sensitive.
- Modifiers in [Brackets] are required for the command to execute. [A or B] means either A or B is required.
- Modifiers in (Parentheses) are optional, and generally change the default behavior of the command.
- Modifiers that take a value are of the form MODIFIER:VALUE.
- If the VALUE of the modifier contains a space, such as in the case of a NPC or script name, the whole modifier must be put in quotes.
- Example:
- TELEPORT BOOKMARK:Bob:Bobshouse
is okay, but- TELEPORT 'BOOKMARK:Bob Jones:Bobshouse'
requires the quotes to function properly.
- Example:
Example:
Some Trigger: Script: - COMMAND1 MODIFIER1 MODIFIER2:VALUE - COMMAND2 'MODIFIER1:Value With Spaces' - ^COMMAND3 'This will run instantly after COMMAND2'
List of Commands
Script Flow
These commands have no external effect 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.
CANCELTASK |
['SCRIPT:Name of Script'] | |
---|---|---|
Cancels a task that has been scheduled for the interacting player using RUNTASK DELAY
Example Usages - CANCELTASK SCRIPT:RaceEnd |
COOLDOWN |
[# or DURATION:#] (GLOBAL) ('SCRIPT:Name of Script') | |
---|---|---|
Sets a cooldown period for this script. Defaults to the currently running script and the interacting player. Until the script has cooled down, it will not be selected to run again. Requires a number of seconds to be specified with or without the DURATION: modifier name.
Modifiers:
Example Usages - COOLDOWN 60 - COOLDOWN GLOBAL 100 - COOLDOWN 'SCRIPT:A Different Script' 600 - COOLDOWN DURATION:15 |
DISENGAGE |
(NPCID:#) | |
---|---|---|
Allowed an ENGAGED Denizen to be interacted with again, the counterpart to the ENGAGE command. Can also specify the NPCID of a different Denizen Example Usages - ENGAGE - (Other Commands) - DISENGAGE - DISENGAGE NPCID:7 |
ENGAGE |
(DURATION:#) (NPCID:#) | |
---|---|---|
Blocks player interaction from triggering the NPC. This may be useful if a long script required the player to listen or watch a series of events and you didn't want the Player to be able to interact while these commands were being taken out. Use with either a DURATION or DISENGAGE. DURATION will automatically DISENGAGE after the specified amount of seconds. If no Example Usages - ENGAGE - (Other Commands) - DISENGAGE - ENGAGE DURATION:12 - ENGAGE NPCID:2 |
FAIL |
('SCRIPT:Name of Script') | |
---|---|---|
Marks a script as 'Failed' to check against with the FAILED requirement. This is identical to the FINISH command, except keeps track of 'fails' instead. Again, this is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can FAIL a script multiple times and it will keep track of the total number, unless RESET. Note: A script can be both 'finished' and 'failed', the two commands work independently. Example Usages - FAIL - FAIL 'SCRIPT:Magic Feathers' |
FINISH |
('SCRIPT:Name of Script') | |
---|---|---|
Marks a script as 'Finished' to check against with the FINISHED requirement. This is kind of like a built-in flag for scripts, and acts much like a Counter, ie. You can FINISH a script multiple times and it will keep track of the total number, unless RESET. Example Usages - FINISH - FINISH 'SCRIPT:Another Script' |
FLAG |
['Flag Name' or 'Flag Name:Flag Value' or 'Flag Name:++' or 'Flag Name:--'] (PLAYER or DENIZEN or GLOBAL) (DURATION:#) | |
---|---|---|
Requires one of the above arguments. FLAG stores variables, or 'flags', by default 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 TRUE. When RESET, it is FALSE. FLAG can also set Integer (or number) variables, and easily increment or decrease them with the use of the ++ and -- arguments accordingly. The command can also store a String value, see the example below. Using a DURATION will revert the value of the flag to the previous value, if during the duration the flag has not changed. Using the PLAYER modifier will set the flag on the Player (which is the default behavior). Using the DENIZEN modifier will set a flag on the Denizen instead of the Player. Using the GLOBAL modifier will set a flag independent of a Player or Denizen. Example Usages - FLAG 'Sample Boolean Flag' - FLAG Alignment:++ - FLAG Alignment:-- - FLAG 'Active Item:60 Feathers' - FLAG WorldBossDead GLOBAL - FLAG HasHealingFlag DURATION:180 |
IF |
(EXACTLY) (PLAYER or DENIZEN or GLOBAL) (-)[FLAG:Name or FLAG:Name:Value] (IS_NUMBER) ['SCRIPT:Script Run When Condition Met'] (QUEUE:TRIGGER or QUEUE:TASK) (APPEND) (ELSE 'SCRIPT:Script Run When Condition Not Met') | |
---|---|---|
Checks the value of a FLAG and runs a TASK script if the condition is met. By default the TASK script will run before the interact script continues.
Modifiers:
Example Usages - IF FLAG:BossDead SCRIPT:Reward APPEND - IF EXACTLY FLAG:Stage:4 SCRIPT:Stage4Instructions - IF 'FLAG:AGE:13' 'SCRIPT:Meets Minimum Age' ELSE 'SCRIPT:Does Not Meet Minimum Age' |
RANDOM |
[#] | |
---|---|---|
Selects a single command to run from the next # lines in the script and discards the rest.
Example Usages - CHAT "I'm going to say the name of an animal" - RANDOM 3 - CHAT "Cow" - CHAT "Zebra" - CHAT "Elephant" - CHAT "Wasn't that fun?" |
RESET |
[FINISHED or FAILED or FLAG:FlagName] ('SCRIPT:Name of Script') | |
---|---|---|
Sets the FINISHED or FAILED count of the specified script to 0, or sets the specified boolean flag to False. Remember: Script and Flag names are case sensitive! Example Usages - RESET FINISHED 'SCRIPT:Magic Feathers' - RESET FLAG:SomeFlag |
RUNTASK |
['SCRIPT:Name of Script'] (DELAY:#) (NPCID:#) | |
---|---|---|
Runs a TASK script as the Denizen on the interacting player.
Modifiers:
Example Usages - RUNTASK 'SCRIPT:Apple Reward' - RUNTASK SCRIPT:RaceEnd DELAY:60 |
WAIT |
[# of Seconds] (QUEUE:TASK) (QUEUE:TRIGGER) | |
---|---|---|
Pauses a Queue for a specified amount of seconds. If no QUEUE is specified, the sending queue is used. For example, if the command is sent from an Interact (Triggered) Script, the queue that will be held is the 'Trigger Queue'. Could be useful in advanced usage situations when using both Task Scripts and Interact Scripts together. Example Usages - WAIT 6 - WAIT 30 QUEUE:TASK |
ZAP |
(Step #) ('SCRIPT:Name of Script') (DURATION:#) (RANDOM:#-#) | |
---|---|---|
A very powerful command, indeed. This is how Scripts progress through their steps. It is not done automatically, instead, you get to decide how to progress. ZAP used alone will simply progress the Player to the next step in the Script. Note: Denizen does not check whether the step exists, so you can use that to your advantage in an Overlay Script Assignment. If an Integer is used, that step will be used. Specify a SCRIPT to change the active step for a Player in a specific Script. If not specified, the triggering Script is used. A DURATION can be set to provide an automatic "DEZAP" of sorts, reverting the step back after a specific amount of seconds, unless, in that duration another ZAP command has taken place. This can be used as a 'timeout' of sorts. RANDOM can be used to let chance select the step to progress the Player to. If one Integer is included, steps 1 through the chosen number will be randomly selected. You can also use a range of numbers if two Integers are used. Example Usages - ZAP - ZAP 5 - ZAP RANDOM:6 - ZAP RANDOM:3-6 DURATION:60 - ZAP 6 'SCRIPT:Another Script' |
Server
EXECUTE |
[ASPLAYER or ASSERVER or ASNPC] ["command and arguments"] | |
---|---|---|
Runs a Minecraft/Bukkit command. Specifying ASPLAYER, ASSERVER, or ASNPC defines how the command should be executed. ASNPC will run the command as the Denizen interacting, temporarily granting OP privileges, if the Denizen NPC is a Human-type NPC. Running ASSERVER will run as a console command, and running ASPLAYER will simply run the command as the Player. When specifying the command and arguments, it is not necessary to use the '/' that is generally used when running commands in-game. You may also use <PLAYER>, <WORLD>, or <NPCID> as variables inside the command arguments. Example Usages EXECUTE ASSERVER 'gamemode <PLAYER> 2' EXECUTE ASNPC 'toggledownfall' EXECUTE ASPLAYER 'spawn' |
The commands below require [Vault] and a valid permissions system.
PERMISS |
[permission.node or 'GROUP:Group Name'] (WORLD) ('WORLD:World Name') | |
---|---|---|
Gives the Player either a permissions node or adds a group, if supported by your permissions system. Note: You should not include both a permissions node and a group. If you specify a WORLD argument, it will apply the permissions node/group only to the current world. You can alternatively specify a world with WORLD:worldName. Example Usages - PERMISS modifyworld.* - PERMISS GROUP:HillsideEnemy - PERMISS citizens.* WORLD:testworld |
REFUSE |
[permission.node or 'GROUP:Group Name'] (WORLD) ('WORLD:World Name') | |
---|---|---|
Removes from the Player either a permissions node or a group, if supported by your permissions system. Note: You should not include both a permissions node and a group. If you specify a WORLD argument, it will remove the permissions node/group only to the current world. You can alternatively specify a world with WORLD:worldName. Generally, however you add your permissions or group with PERMISS, you should do the same when removing with REFUSE.
Example Usages - REFUSE modifyworld.* - REFUSE GROUP:HillsideEnemy - REFUSE citizens.* WORLD:testworld |
Speech
These commands show some text to the player interacting, and usually to bystanders around. 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 Denizen/config.yml.
- All Speech commands require quotes (single (' ') or double (" ")) around the text. If your text has an apostrophe (') in it, you MUST use double quotes (" ")!!
There are various placeholders you can use to fill in specific information. The basic ones are:
- <NPC> - The Denizens's name.
- <PLAYER> - The interacting Player's name
- <DISPLAYNAME> - The interacting Player's display name
- <HEALTH> - The interacting Player's heath
- <WORLD> - The name of the Denizen's world
If you use the NOPLAYER modifier on a text command the <PLAYER>, <DISPLAYNAME> and <HEALTH> tags are not available.
A list of all available placeholders can be found in Replaceables.
ANNOUNCE |
['The text to announce.'] | |
---|---|---|
Sends the text as a sever announcement to all players, regardless of their place in the world. Could be especially useful for any kind of administration script.
Example Usages - ANNOUNCE "<PLAYER> has found a secret!" |
CHAT |
["The text to chat."] (NPCID:#) (NOPLAYER) | |
---|---|---|
Makes the Denizen talk to the player. This is the standard chat mechanism in Denizen. You can also change the NPC doing the talking by specifying a Denizen's C2 NPCID. If you would rather the Denizen NPC not speak to the Player directly, use the NOPLAYER argument.
Example Usages - CHAT NOPLAYER "Here ye, hear ye!" - CHAT "Hello there, children!" - CHAT NPCID:6 'I only supply tools to builders!' |
EMOTE |
['The text to emote.'] (NPCID:#) | |
---|---|---|
Let's the Denizen NPC show emotion. Similar to the /me command in IRC, for example. Could be useful for describing to the player what an NPC Denizen may need, or how the NPC Denizen is feeling. NPCID can be specified to change the Denizen NPC doing the 'emote'.
Example Usages - EMOTE 'is looking a bit nervous.' - EMOTE NPCID:82 'thinks you should ask a few questions.' - EMOTE "could use a stiff drink." |
HINT |
(SHORT) | |
---|---|---|
If called from an Interact Script Step with a Chat Trigger, this will output a list of all possible things the player can say to activate a chat trigger.
Modifiers:
Example Usages - HINT - HINT SHORT |
NARRATE |
['The text to narrate.'] | |
---|---|---|
Makes a message appear to player without sender information.
Example Usages - NARRATE "There is a small mailbox here." |
SHOUT |
["The text to chat."] (NPCID:#) (NOPLAYER) | |
---|---|---|
Shouts the text to players nearby. The range that a bystander can hear an NPC Denizen shout is larger then that of a standard CHAT, so it also has some technical advantages. NPCID can be specified. Using NOPLAYER will drop reference to the Player when talking. You can still reference <PLAYER>, however, if need be. See the example below for an idea for usage.
Example Usages - SHOUT "EEEK! a spider!" - SHOUT NOPLAYER "<PLAYER> is a thief! Get him!" |
WHISPER |
["The text to whisper."] (NPCID:#) (NOPLAYER) | |
---|---|---|
Whispers the text to the player. Really just an alternative to CHAT. By default, bystanders can't hear what the NPC whispers to the interacting Player. As with the CHAT command, NPCID can be specified. Using NOPLAYER is possible too, since it may be of use in some circumstances. But remember: by default, no bystanders can see the actual text the NPC Denizen whispers. This can be changed in the config.yml.
Example Usages - WHISPER "The password is.. 42." - WHISPER NPCID:2 "Hey, I didn't want to blurt this out so everyone could hear, but..." |
Denizen Interaction
Denizen interaction commands are meant to help bring your Denizen to life by allowing fine control of movement and actions during scripts. These are not meant for making the Denizen do continuous movement and actions, that should instead be done via Activities.
HOLD |
[ID or ID:Data or MATERIAL or MATERIAL:Data] | |
---|---|---|
Makes the Denizen hold a specific block or item.
Example Usages - HOLD IRON_PICKAXE - HOLD 98:3 |
LOOK |
[DIRECTION or BOOKMARK:BookamrkName or 'BOOKMARK:Denizen Name:BookmarkName' or CLOSE or AWAY] (NPCID:#) (DURATION:#) | |
---|---|---|
This command controls where the NPC Denizen is looking. It requires either a Direction, Bookmark, or look-close trait state. Valid directions: UP, DOWN, LEFT, RIGHT, NORTH, SOUTH, EAST, WEST, AT, and BACK. Looking AT or BACK takes the Player's position for reference. AT will look at the Player, BACK will look away from the player. Using CLOSE |
PAUSE |
(DURATION:#) | |
---|---|---|
Causes the Denizen to stop any pathing or activities. Useful for keeping it in place during an interaction.
Modifiers:
Example Usages - PAUSE - PAUSE DURATION:30 |
RESUME |
||
---|---|---|
Cancels a previous PAUSE command.
Example Usages - RESUME |
RETURN |
(SPEED:#) | |
---|---|---|
Makes the denizen walk back to the position it was at before a call to WALKTO or WALK. Will resume NPC pathing if set.
Modifiers:
Example Usages - WALKTO BOOKMARK:Somewhere - RETURN |
WALK |
(FORWARD:#) (NORTH:#) (SOUTH:#) (EAST:#) (WEST:#) (UP:#) (DOWN:#) (X:#) (Y:#) (Z:#) (SPEED:#) | |
---|---|---|
Makes the denizen walk some distance from its current position. Interrupts any current movement, and pauses the NPC pathing if active. All provided directions are added into one movement. Decimal and negative values are accepted.
Modifiers:
Example Usages - WALK NORTH;4 EAST:2.5 - WALK FORWARD:1 |
WALKTO |
[BOOKMARK:LocationBookmark or 'BOOKMARK:DenizenName:LocationBookmark' or PLAYER] (SPEED:#) | |
---|---|---|
Makes the denizen walk to the specified location bookmark, or to the interacting player. Interrupts any current movement, and pauses the NPC pathing if active.
Modifiers:
Example Usages - WALKTO PLAYER - WALKTO 'BOOKMARK:Gary:GarysHouse' |
World Interaction
DROP |
[ID or ID:Data or MATERIAL or MATERIAL:Data or XP] (QTY:#) (BOOKMARK:LocationBookmark) | |
---|---|---|
Drop an item at the Denizen's location, or at a location bookmark if one is specified.
Example Usages - DROP DIAMOND QTY:3 - DROP 18:3 QTY:1 BOOKMARK:LargeTree - DROP XP QTY:10 |
LISTEN KILL |
[TYPE:GROUP or TYPE:PLAYER or TYPE:ENTITY or TYPE:NPC] [NAME:Name or NPCID:#] (QTY:#) [SCRIPT:Task Script] (ID:Name) | |
---|---|---|
This command starts the Denizen listening for the player to kill the specified number of specified targets, then runs a task script. Use the NAME:Name modifier when specifying a group name, player name, or entity type (like 'ZOMBIE'). Use NPCID:# modifier when using TYPE:NPC.
Optional Modifiers:
Example Usages - LISTEN KILL TYPE:ENTITY NAME:ZOMBIE QTY:5 SCRIPT:ZombieReward - LISTEN KILL ID:BossListener TYPE:NPC NPCID:12 'SCRIPT:Kill Boss Reward' |
SPAWN |
[ENTITY_TYPE] (QTY:#) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (SPREAD:#) ('EFFECT:[POTION_EFFECT] [LEVEL]') ('OPTION:[OPTIONS]') | |
---|---|---|
Spawns a specified amount of entities. If the location bookmark is missing, they will spawn near the Denizen.
Modifiers:
Example Usages - SPAWN BOAT - SPAWN QTY:3 COW BOOKMARK:Cage - SPAWN VILLAGER 'BOOKMARK:El Notcho:Gate' - SPAWN QTY:10 PIG_ZOMBIE SPREAD:5 - SPAWN QTY:25 ZOMBIE SPREAD:20 'EFFECT:INCREASE_DAMAGE 2' - SPAWN QTY:2 SHEEP 'OPTION:COLORED RED' |
STRIKE |
(DENIZEN) (BOOKMARK:LocationBookmark) ('BOOKMARK:Denizen Name:LocationBookmark') (NODAMAGE) (NPCID:#) | |
---|---|---|
Lightning at your fingertips.
Modifiers:
Example Usages - STRIKE - STRIKE BOOKMARK:BigTree - STRIKE DENIZEN NODAMAGE |
SWITCH |
[BOOKMARK:BlockBookmark] or [BOOKMARK:DenizenName:BlockBookmark] (DURATION:#) | |
---|---|---|
This command will activate a button, switch or pressure plate at the designated block bookmark.
Modifiers:
Example Usages - SWITCH BOOKMARK:LightSwitch DURATION:30 - SWITCH BOOKMARK:Jimbo:JimbosButton |
WEATHER |
[SUNNY or STORMY or PRECIPITATING] | |
---|---|---|
Changes the Denizen's world's weather to the designated type.
Example Usages - WEATHER SUNNY |
Player Interaction
These commands default to affecting the interacting player. Most have modifiers to affect the executing Denizen instead.
CAST |
[SpellName] (DURATION:#) (POWER:#) (NPC:#) (PLAYER:PlayerName) | |
---|---|---|
Gives the specified target a potion effect. Valid potion names are the same as the Alchemist's.
Modifiers:
Example Usages - CAST SPELL:confusion DURATION:300 POWER:3 - CAST SPELL:speed |
FEED |
(AMOUNT:#) | |
---|---|---|
Feeds the interacting player. Provides food and saturation.
Modifiers: AMOUNT: The amount to feed. Default is 20. Example Usages - FEED - FEED 5 |
GIVE |
[MONEY or XP or HEROESEXP or ID or ID:Data or MATERIAL or MATERIAL:Data] (QTY:#) | |
---|---|---|
Gives something to the Player. If QTY: is not specified, its default value is 1. You can also give Minecraft XP by using 'XP'. Using HEROESEXP type will give the Player (or Hero) Questing Experience. Note: This requires HEROES to be installed on your server! Example Usages - GIVE MONEY QTY:10 - GIVE 17:2 QTY:3 - GIVE LEAVES:2 - GIVE HEROESEXP QTY:25 |
HARM |
(DENIZEN) (AMOUNT:#) | |
---|---|---|
Hurts the the interacting player.
Modifiers:
Example Usages - HARM AMOUNT:5 - HARM DENIZEN |
HEAL |
(DENIZEN) (AMOUNT:#) | |
---|---|---|
Heals the interacting player.
Modifiers:
Example Usages - HEAL - HEAL DENIZEN AMOUNT:1 |
TAKE |
[MONEY or ITEMINHAND or ID or ID:Data or MATERIAL or MATERIAL:Data] (QTY:#) | |
---|---|---|
Takes something from the Player. If QTY: is not specified, its default value is 1. Example Usages - TAKE MONEY QTY:1000 - TAKE 17:2 QTY:1 - TAKE LOG:2 - TAKE ITEMINHAND |
TELEPORT |
(DENIZEN) [BOOKMARK:LocationBookmark or 'BOOKMARK:Denizen Name:LocationBookmark'] | |
---|---|---|
Teleports the interacting to player or denizen to the specified bookmark.
Modifiers:
Example Usages - TELEPORT BOOKMARK:FarAwayPlace - TELEPORT DENIZEN 'BOOKMARK:Jim:JimsBasement' |