Denizen/Commands: Difference between revisions
< Denizen
Davidcernat (talk | contribs) |
Davidcernat (talk | contribs) |
||
Line 53: | Line 53: | ||
{{Denizen Command | {{Denizen Command | ||
|determine|[true<nowiki>|</nowiki>false] | |determine|[true<nowiki>|</nowiki>false] | ||
|This command only works together with the [[Denizen/Script Requirements#procedure procedure]] requirement. It is put in the task script run by the procedure requirement and sets the requirement's value to true or false. | |This command only works together with the [[Denizen/Script Requirements#procedure|procedure]] requirement. It is put in the task script run by the procedure requirement and sets the requirement's value to true or false. | ||
Revision as of 16:24, 15 February 2013
List of commands
Script flow
assignment | [{set}|remove] (script:name) |
---|---|
Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.
- assignment set "script:Evil Wizard" - assignment remove - assignment "script:Pet Cat" |
clear | (queue:name) (...) |
---|---|
Empties a queue of all the commands in it that haven't been executed. If no queue name is specified, the current queue is emptied. You can also use the queue argument more than once to specify more queues to empty.
Use this command to stop a script from another script or a script from an action.
- clear - clear queue:magicalattacks queue:movingwalls |
cooldown | (duration:#{60s}) (global|player:name{attached player}) (script:name) |
---|---|
Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.
You can also make the script not get executed for another player, or make it unavailable globally, and you can also choose another script instead of this one.
- cooldown - cooldown duration:30s player:Bob "script:Offer Quest" |
determine | [true|false] |
---|---|
This command only works together with the procedure requirement. It is put in the task script run by the procedure requirement and sets the requirement's value to true or false.
- determine true - determine false |
random | [#] |
---|---|
Runs a single one out of a number of commands, chosen at random.
- random 3 - chat "One." - chat "Two." - chat "Three." In the above example, only one of the three chat commands will be run. - random 2 - chat "One." - chat "Two." - chat "Three." In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed. - random 3 - attack - chat "Get out of here!" - runtask "script:Call Reinforcements" Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements. |
Messages
announce | ["announcement text"] (to_ops) |
---|---|
Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.
- announce "The skeleton invasion has ended." - announce "<player.name> has joined the blue team!" - announce to_ops "<player.name> is requesting help from operators." |
chat | ['message to chat'] (npcid:#) (target(s):npc.#|player.player_name{attached player}) |
---|---|
Sends a message from this NPC to the player.
If a different NPC's ID is chosen in the npcid argument, the message is sent from that NPC. The message can also be sent to a different player or even to another NPC if you use the target argument.
- chat "It's nice to see you again, <player.name>." - chat "I would like to introduce you to <player.name>." target:npc.7 - chat "Bob, do you know <player.name>?" target:player.Bob - chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob |
Denizen interaction
attack | (stop) |
---|---|
Makes the NPC attack or stop attacking the player.
- attack - attack stop |
chair | (sit|stand) (location:x,y,z,world) |
---|---|
Makes the NPC sit or stand at a location.
- sit location:300,65,300,world - sit location:<anchor:Chair> - stand |
follow | (stop) |
---|---|
Makes the NPC follow or stop following the player.
- follow - follow stop |
look | [location:x,y,z,world] |
---|---|
Makes the NPC look towards a certain location.
- look location:300,60,500,world - look location:<player.location> - look location:<anchor:Lever> |
shoot | [entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name) |
---|---|
Makes the NPC shoot out an entity. All valid entity names are found here.
Entities can be shot towards a location. If no location is specified, they will be shot in the direction the NPC is looking. You can also choose a script that will be run when the entity reaches the location. Moreover, you can use the ride argument to ride an entity, the burn one to set it on fire, and the explode one to have it explode once it reaches the location or gets stuck. Examples - shoot entity:zombie - shoot entity:arrow location:<player.location> - shoot entity:fireball location:<player.location> "script:Shoot Another Fireball" - shoot entity:minecart ride location:<anchor:Rollercoaster> - shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction" |
Player interaction
cast | [potion_effect_type] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.player_name|entity_name) |
---|---|
Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found here.
If you do not choose a target, the potion effect is given to the player talking to this NPC. You can use more targets at once by putting them between commas. You can choose the effect's duration, which is 60 seconds by default, and its power, which is 1 by default. Often, a power of 3 is the most you can have for a potion effect, and a value larger than that will not do anything.
- cast blindness power:3 duration:7 In the above example, the player talking to this NPC will be blinded strongly for 7 seconds. - cast regeneration power:1 duration:10 target:player.<npc.owner> In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.
|
World interaction
drop | [item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world) |
---|---|
Drops an item or some experience at a location, in a certain quantity (which is 1 if not specified). You can choose either the item's ID or its material. All block and item IDs are found here and all valid material names are found here.
The ID or material can also be followed by a special data value for the item, so you can - for instance - drop a specific kind of wood or color of wool. Examples - drop item:38 location:500,63,500,world - drop item:diamond qty:5 location:<anchor:Treasury> - drop xp qty:30 location:<anchor:Altar> - drop item:wood:3 qty:30 location:<anchor:Jungle> |
strike | (no_damage) [location:x,y,z,world] |
---|---|
Makes lightning strike a location, optionally without causing any damage.
- strike location:200,73,200,world - strike location:<player.location> - strike no_damage location:<anchor:Mountaintop> |