https://wiki.citizensnpcs.co/api.php?action=feedcontributions&user=Morphan1&feedformat=atomCitizens Wiki - User contributions [en-gb]2024-03-29T13:26:07ZUser contributionsMediaWiki 1.39.3https://wiki.citizensnpcs.co/index.php?title=Builder&diff=5098Builder2016-08-29T05:23:44Z<p>Morphan1: /* Updates */</p>
<hr />
<div>{{Trait<br />
| PICTURE = Builder.png<br />
| AUTHOR = jrbudda<br />
| NAME = Builder<br />
| VERSION = 0.9.1 build 2<br />
| CITIZENSBUILD = [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.20] (Craftbukkit 1.10+)<br />
| DEVSTATUS = Release<br />
| DEPENDS = None required.<br />
| DOWNLOADLINK = http://ci.citizensnpcs.co/job/Builder/lastSuccessfulBuild/<br />
| DESCRIPTION = Citizens NPCs that build schematics.<br />
}}<br />
<br />
===ATTENTION:===<br />
===The author of this plugin has gone inactive. Currently, this plugin is only being maintained to allow compatibility with new Minecraft updates. The stability and functionality of these builds cannot be promised.===<br />
<br />
'''Builder''' is a Citizens 2.0 [[Characters|character trait]] that gives NPCs the ability to:<br />
* Build MCEdit/Worldedit schematics, block by block.<br />
* Rebuild an area, fixing anything that has been changed.<br />
* Collect the required materials from players before building.<br />
<br />
__TOC__<br />
==Updates==<br />
{{scrollbox|<br />
<br />
'''Builder For CraftBukkit 1.10+''' [http://ci.citizensnpcs.co/job/Builder/18/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9.4''' [http://ci.citizensnpcs.co/job/Builder/13/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9''' [http://ci.citizensnpcs.co/job/Builder/12/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.7''' [http://ci.citizensnpcs.co/job/Builder/9/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.3''' [http://ci.citizensnpcs.co/job/Builder/4/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8''' [http://ci.citizensnpcs.co/job/Builder/3/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''v. 0.9.1 build 2''' 6/3/2014 [http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar download]<br />
* Update for craftbukkit 1.7.10<br />
<br />
'''v. 0.9.1''' 6/3/2014 [http://www.sendspace.com/file/646mvv download]<br />
* Update for craftbukkit 1.7.9<br />
<br />
'''v. 0.9.0''' 12/11/2013 [http://www.sendspace.com/file/5q3v9h download]<br />
* Update for craftbukkit 1.7.2<br />
<br />
'''v. 0.8.2''' 9/20/2013 [http://www.sendspace.com/file/3qk2qa download]<br />
* Update for craftbukkit 1.6.4<br />
<br />
'''v. 0.8.1''' 8/8/2013 [http://www.sendspace.com/file/sb8tfc download]<br />
* added ''silent'' build option that suppresses the messages builder sends to the person who started a build.<br />
* Fixed excavate option so it works.<br />
<br />
'''v. 0.8''' 7/29/2013 [http://www.sendspace.com/file/4yhc12 download]<br />
*Builders have gone to engineering school and now support tile entities (chest contents, sign text, skull types, command blocks, etc...)<br />
*Added command /builder origin x,y,z<br />
*Maybe some improvements to memory usage on large schematics.<br />
*Added command block to default list of blocks not needed for supply mode.<br />
*Fix warning at startup.<br />
<br />
'''v. 0.7.2 ''' 7/9/2013 [http://www.sendspace.com/file/imftlv download]<br />
*Compatible with Bukkit 1.6.2<br />
<br />
'''v. 0.7.1 ''' 7/3/2013 [http://www.sendspace.com/file/xkjvbb download]<br />
*Compatible with Bukkit 1.6.1<br />
*Compatible with Denizen .9<br />
<br />
'''v. 0.7 ''' 6/27/2013 [http://www.sendspace.com/file/v7td6n download]<br />
*Supply mode is now customizable<br />
<br />
'''v. 0.6.9 ''' 5/4/2013 [http://www.sendspace.com/file/smy3z8 download]<br />
* Update for craftbukkit 1.5.2<br />
* Properly group new blocks from 1.4.7 and 1.5.x updates.<br />
* Add server-wide setting so that Supply mode requires exact blocks.<br />
<br />
'''v. 0.6.8.1 ''' 3/21/2013 [http://www.sendspace.com/file/nv50m2 download]<br />
* Update for craftbukkit 1.5.1<br />
<br />
'''v. 0.6.8 ''' 3/19/2013 [http://www.sendspace.com/file/x36t95 download]<br />
* Compatibility with cb 1.5, citizens 2.0.8, and Denizen .8<br />
<br />
'''v. 0.6.7 ''' 1/19/2013 [http://www.sendspace.com/file/dwm2gl download]<br />
* Compatibility with cb 1.4.7<br />
<br />
'''v. 0.6.6 final ''' 1/4/2013 [http://www.sendspace.com/file/49vrxe download]<br />
* Use with cb 1.4.6<br />
* Fix persistence bug with needed materials in supply mode and layers build option.<br />
<br />
'''v. 0.6.6b ''' 12/22/2012 [http://www.sendspace.com/file/634eev download]<br />
* Compatibility with CraftBukkit 1.4.6r0.1 and Citizens2 2.0.6.<br />
<br />
'''v. 0.6.5''' 12/20/2012 [http://www.sendspace.com/file/5xpctb download]<br />
* Compatibility with CraftBukkit 1.4.5r1.0 and Citizens2 2.0.5 Release.<br />
<br />
'''v. 0.6.4''' 12/9/2012<br />
* Compatibility with latest craftbukkit 1.4.5 r.03 and citizens2 build 606+.<br />
<br />
'''v. 0.6.3''' 11/30/2012<br />
* Compatible with craftbukkit 1.4.4 - 1.4.5 r0.2 and citizens2 build 597.<br />
* Fix crops/seeds error.<br />
* Accept either type of pressure plate for supply mode.<br />
<br />
'''v. 0.6.2''' 10/29/2012<br />
* Update for cb 1.4.2... with NOT work with 1.3 !<br />
<br />
'''v. 0.6.1''' 10/25/2012<br />
* Final fixes to supply mode. Release of .6<br />
<br />
'''v. 0.6 ALPHA3''' 10/19/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Fixed supply requirement for glass blocks and panes, melon, bookshelves, ender chests, snow, ice, double slabs.<br />
* Changed supply requirement for stairs: all wood stairs count as 'oak wood stairs'. All stone stairs (except nether brick) count as 'stone brick stairs'. This is to match the behavior with slabs.<br />
<br />
'''v. 0.6 ALPHA2''' 10/15/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Added builder.donate permission. This allows players to donate to a builder in supply mode.<br />
* Fix calling ''build'' from the console.<br />
<br />
'''v. 0.6 ALPHA''' 10/14/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* '''Supply Mode''' - Builders can now be set so that players must provide all the materials before the builder will start building. use ''/builder supply true'' to turn this on, then call ''/builder build'' as usual.<br />
** Once build is called the Builder will go into [[#Supply Mode|Supply mode]]. See section for details.<br />
** Only those blocks actually needed will be required (if some are already in place)<br />
** The collected materials will persist if the server is restarted.<br />
** Localized names are used for all items and blocks. (based on server language setting)<br />
** If the build is canceled the collected items are lost.<br />
** Unobtainable blocks are supplied by giving their normal drop type (example: Cobwebs require players to supply String). Please let me know if I missed any.<br />
* Fixed 'mark' and 'schematic origin' sometimes being off by 1 block.<br />
* Moved the 'nohold' build option to its own command: /builder hold true/false<br />
* Added onstart: build option, this will run a Denizen task when the builder starts building (after collecting required materials, if set)<br />
<br />
'''v. 0.5.1 Beta''' 10/4/2012<br />
* Added command /builder list<br />
* Added build option: yoffset<br />
<br />
'''v. 0.5 Beta''' 9/25/2012<br />
* It is highly recommenced you use this with build 382+ of citizens2. 382 has some pathfinding fixes that make high /npc speed settings less... undesirable.<br />
* Builders loaded with the same schematic will share it in memory. Reduces RAM overhead.<br />
* Schematics are now pre-processed right when you call build, this has the following consequences:<br />
** Less memory usage for the to-build list<br />
** /builder info now shows total block count, blocks remaining, and a % complete during the build.<br />
** new command: '''survey''' shows the material list required to build in the current location, taking into account what is already there.<br />
** You may experience a small server hiccup when you call build for VERY large schematics (millions of blocks) Hope to reduce this for the future.<br />
* New command: '''timeout''' sets the maximum time between blocks. Can be set as low as 0.1 seconds. (The fastest possible build speed is about 5 blocks per second.)<br />
<br />
'''v. 0.4.1 Beta''' 9/18/2012<br />
* '''Verical Build options''' you can now specify layers:X to build X number of layers at a time. Significantly speeds up building.<br />
* '''Grouping option''' you can specify groupall to build ALL of one group of materials at a time (instead of doing it at every set of layers)<br />
* added commands: origin me, origin current<br />
* excavate works from the top down, as you would expect.<br />
<br />
'''v. 0.4 Beta''' 9/16/2012<br />
* '''New build order''' Builder now places items in groupings based on item type: base blocks, furniture, redstone, liquids, and decorations. This is done ''per layer'' because I didn't like how it looked building all the layers of one type first. Maybe configurable later.<br />
* '''New build patterns!''' builders can use: spiral, linear, reversespiral or reverselinear (this is for the x-z plane, builders still build from the bottom layer up, 1 layer at a time... for now!) the default is spiral.<br />
*(Okay I'll admit this sort of lets you use up to 4 builders on 1 schematic if they have the same origin and different patterns... but shhh it's our secret :))<br />
* '''Excavate mode!''' builders can optionally dig out the area before building!<br />
* '''Configuration!''' Builder now makes a config.yml that can be used to change the default schematics directory. messages and allowable 'marking' materials.<br />
* Holding items! Player and Endermen-type builders will now hold the item they are about to place, or a pickaxe if breaking blocks.<br />
* Fix mob-type builders, they no longer crash clients because cows can't swing their arms!<br />
* the ignoreliquid and ignoreair commands have been {{color|red|white|removed}} specify these options when calling /builder build.<br />
* Hooked into dynmap to trigger an area render on completion/cancellation of build.<br />
<br />
'''v. 0.3.2 Beta''' 9/13/2012<br />
* Builder will remove previous marks before building or placing new ones.<br />
* Fix skipping first block in schematic.<br />
* Improved error messages an other minor fixes.<br />
* Target Java 6 instead of 7.<br />
<br />
'''v. 0.3.1 Alpha''' 9/12/2012<br />
* Pathing and other minor bugfixes.<br />
* fix /builder mark<br />
* /builder help actually provides help.<br />
<br />
'''v. 0.3 Alpha''' 9/11/2012<br />
* Added Denizen Task script execution option on build completion and cancellation.<br />
* Reduced memory usage of loaded schematics by 80%.<br />
* Last loaded schematic is now persistent.<br />
* Lots of updates to messages and info.<br />
<br />
'''v. 0.2.1 Alpha''' 9/9/2012<br />
* added commands origin clear, origin schematic, check, compare<br />
<br />
'''v. 0.2 Alpha''' 9/9/2012<br />
*Added commands ignoreair, ignoreliquid, origin, info<br />
<br />
'''v. 0.1.1 Alpha''' 9/9/2012<br />
*Added Mark command.<br />
*Better pathing.<br />
<br />
'''v. 0.1 Alpha''' 9/9/2012<br />
* First release<br />
}}<br />
<br />
<!-- THIS SECTION IS BROKEN<br />
{|<br />
{{#ev:youtube|UyAR7-_17XY|}} |{{#ev:youtube|ZiYhFZi5vB0|}} | {{#ev:youtube|HOxX9pb--NQ|}} | {{#ev:youtube|KS4v17Y8xcA|}} <br />
|}<br />
--><br />
<br />
==Installation==<br />
*Install Citizens 2<br />
*Place Builder.jar file in /plugins directory. <br />
*Place .schematic files in /plugins/Builder/schematics/<br />
*Start Server<br />
*Create NPC and give the Builder trait.<br />
/npc create Bob --trait builder<br />
or<br />
/npc create Bob<br />
/trait builder<br />
<br />
==Permissions==<br />
*''builder.*'' Give access to all Builder permissions.<br />
*''builder.[command]'' Give access to [command].<br />
*''builder.donate'' Allows players to donate to a builder in Supply Mode (useful for locking out creative mode players)<br />
<br />
==Configuration==<br />
See [[Builder/Configuration|Configuration]].<br />
<br />
Builder will create ''Builder/config.yml'' if it does not exist already. Be sure to check the configuration page if new options are added.<br />
<br />
==Commands==<br />
All commands can be run on a selected NPC as shown (<code>/builder [command]</code>), or on a target NPC with <code>/builder [npcid] [command]</code>.<br />
<br />
'''/builder list''' - Lists all available schematics in the configured schematics folder. Does not require a builder selected.<br />
<br />
'''/builder load [schematic]''' - Loads a .schematic file. simply use the name of the schematic.<br />
Example<br />
/builder load house<br />
<br />
'''/builder origin''' - Sets the origin of the builder's projects to the builder's current location. Allows you to re-build in the same spot. If this is not set the builder will always start from his current location.<br />
<br />
'''/builder origin clear''' - Clears the saved build origin.<br />
<br />
'''/builder origin schematic''' - Sets the origin of the builder's projects to the origin of the loaded schematic. Best used for schematics created from the builder's world with worldedit.<br />
<br />
'''/builder origin me''' - Sets the origin of the builder's projects to the player's position. Does not work from the console.<br />
<br />
'''/builder origin current''' - Sets the origin of the builder's projects to the origin of the project currently being built. Use this if you forgot to set the origin before starting to build, and need to cancel it to resume later.<br />
<br />
'''/builder origin x,y,z''' - Sets the origin of the builder's projects to the location x,y,z of the builder's current world.<br />
<br />
'''/builder mark (item)''' - Places a block at the 4 corners of the footprint, then returns to the origin, so you can see where it's going to build. You can specify the item to use, although that item must be allowed in the config.yml. The first item on the list in the config is the default if no item is specified. If the config is missing the builder will use GLASS.<br />
<br />
'''/builder timeout [value]''' - Sets the maximum time, in seconds, between blocks. Valid values are 0.1 - 2000000.0. Default is 2.0. Default can be changed in the config.yml.<br />
<br />
'''/builder build (option1) (option2) ... etc''' - Start building the schematic. This command takes several optional arguments. The order does not matter. you can add to this command the following:<br />
*linear - build north to south<br />
*reverselinear - build south to north<br />
*sprial - build inside to outside (this is the default and thus does not need to be specified.)<br />
*reversespiral - build outside to inside.<br />
*excavate - The builder will clear out the area of blocks before starting to place them.<br />
*layers:# - The builder will build # number of layers at a time, the default is 1.<br />
*yoffset:# - The builder will start building the specified number of blocks up or down from the set starting location.<br />
*groupall - the builder will build all of a group of materials at once, instead of doing it per layer.<br />
*ignoreair - the builder will not place air blocks. (Use to build into an existing structure, pointless if used with excavate)<br />
*ignoreliquid - the builder will not place lava or water blocks. (Use if the schematic has unconstrained liquids on the bottom.)<br />
*onstart:Task - the builder will run the [[Denizen]] task script on start of build (after material collection). See [[#Advanced Usage]]<br />
*oncomplete:Task - the builder will run the [[Denizen]] task script on completion of build. See [[#Advanced Usage]]<br />
*oncancel:Task - the builder will run the [[Denizen]] task script on cancellation of build. See [[#Advanced Usage]]<br />
*silent - the builder will not send completion/error messages to the command sender.<br />
<br />
Examples:<br />
/builder build<br />
/builder build excavate reverselinear yoffset:-3<br />
/builder build ignoreair ignoreliquid oncomplete:Celebrate<br />
/builder build groupall layers:3<br />
<br />
'''/builder cancel''' - Cancel a build job.<br />
<br />
'''/builder info''' - View a Builder's loaded schematic name and size, as well as the builder's options and status.<br />
<br />
'''/builder survey (excavate)''' - Display a list of all the block types/count it would require to build at the current location. Specify excavate to show the list of materials if excavation is used. Does not show water or lava.<br />
<br />
'''/builder supply true|false''' set whether the builder will need to be given the materials before he will start building. See [[#Supply Mode]]<br />
<br />
'''/builder hold true|false''' set whether the builder will hold the items he is placing (Turn off only for compatibility with other plugins like [[Sentry]])<br />
<br />
'''/builder reload ''' - reload options from the builder config.yml<br />
<br />
'''/builder help''' - Display the help.<br />
<br />
==Usage==<br />
*.schematic files should be placed in the ''/plugins/Builder/schematics/'' directory. This directory can be configured in the config.yml<br />
* Position the builder, or set the builder's '''origin''', to the ''center'' of the footpoint you want to build before calling '''build'''. The size of the schematic is shown upon load.<br />
* You can cancel a build and resume it later if you have an Origin set. You can use <code> /builder origin current </code> to set the origin after building has started if you forgot.<br />
* Do not try to resume a build with the excavate option!<br />
* The builder will ignore any empty space underneath the schematic object so that it will always rest on the ground where the builder starts. If you want to build above or below the origin, use the yoffset: build option.<br />
* The builder will not attempt to replace blocks that are already set properly, this means you can use a builder to quickly 'restore' any changed blocks in something he has previously built.<br />
**To set up a builder to maintain an existing building:<br />
***Select the building with worldedit and save it as a schematic.<br />
***Copy the schematic to the builder's schematics directory.<br />
***Load the schematic to a builder and call <code> /builder origin schematic</code>.<br />
***Call /builder build and the builder will place any missing blocks or destroy new ones.<br />
*Rail and dispensers my not be placed correctly. (Hey this is Construction, not Engimaneerin'.)<br />
*By default, NPCs despawn when their chunk unloads. This behavior can be changed in the Citizens2 config.yml, and is recommended if you would like builders to continue to work unattended.<br />
<br />
==Supply Mode==<br />
If the Builder is set to require materials for building (with ''/builder supply true''), he will go into Supply Mode when ''/builder build'' is called. When Supply Mode starts the Builder will survey the build site and generate a list of required materials to start building. Players must provide these materials for the builder to begin. <br />
<br />
While in Supply Mode:<br />
* Right-Click the Builder with an empty hand to view the list of materials still needed.<br />
* Right-Click the Builder with any block or item to see if he needs it. If he does, he will tell you how much he still needs.<br />
* After clicking with a needed material, Right-Click again within a few seconds to give it to the Builder. <br />
* After receiving a material the Builder will say how many more blocks he needs in total to begin, or he will begin building if he has everything.<br />
<br />
What materials are required:<br />
*By default all blocks require their normal drop type (i.e. Cobwebs require String)<br />
*This behavior can be overridden via the 'supply.txt' file found in the \Builder folder.<br />
**Each line contains the Item ID of the block in the schematic, and the ItemID of the block/Item that is required.<br />
**Optionally you can specify the number of blocks/items required for each source block.<br />
**Setting the required Item ID to 0 will not include that source block in the requirements.<br />
<br />
{| class="wikitable collapsible collapsed" <br />
! Default Supply Mode configuration<br />
|-<br />
|<pre><br />
Original Block Number:Require Item Number:Amount(Optional)<br />
Set to 0 to never require block. Blocks not specified will require their normal drop item.<br />
90:0<br />
97:0<br />
95:54<br />
78:0<br />
34:0<br />
119:0<br />
80:80<br />
92:354<br />
43:44:2<br />
125:126:2<br />
20:20<br />
102:102<br />
47:47<br />
103:362<br />
130:130<br />
134:53<br />
135:53<br />
136:53<br />
128:67<br />
109:67<br />
108:67<br />
79:332<br />
51:0<br />
59:295<br />
72:70<br />
71:330:0.5<br />
26:335:0.5<br />
</pre><br />
|}<br />
<br />
All blocks are currently matched on Item ID only. This means:<br />
* All Wool is Wool. Color is ignored building the list, and any color wool can be given to fulfill the requirement.<br />
* The same goes for saplings, slabs, logs, and wood planks.<br />
* Stairs are similar. All wood stairs count as 'oak'. All stone/brick stairs count as 'stone' with the exception of nether brick stairs which are separate.<br />
<br />
If the build is canceled at any point, the collected materials are lost.<br />
<br />
==Advanced Usage==<br />
* Builder can be set to run [[Denizen]] Task Scripts on start, completion, or cancellation of a build.<br />
**The NPC must have both the Builder and [[Denizen]] Trait.<br />
**Call <code>/builder build</code> with the optional modifiers <br />
***<code>onstart:TaskName</code><br />
***<code>oncomplete:TaskName</code> <br />
***<code>oncancel:TaskName</code>. <br />
Example:<br />
/builder build oncomplete:DespawnTask oncancel:AnnounceTask<br />
<br />
*Builder can also run [[Denizen Actions]] at the 3 indicated events. Add the following to the NPC's actions:<br />
**"Build Start"<br />
**"Build Complete"<br />
**"Build Cancel"<br />
Example:<br />
<br />
<code><br />
BuilderAssignment:<br />
type: assignment<br />
actions:<br />
on Build Start:<br />
- ANNOUNCE "Let's do this!"<br />
on Build Complete:<br />
- ANNOUNCE "I have finished!"<br />
</code><br />
<br />
For more complex examples with Denizen and Builder see [[Builder/Builder_and_Denizen|Builder and Denizen Examples]]<br />
<br />
==FAQ==<br />
Q: How can I use multiple builders on one project?<br />
<br />
A: You can use up to 4 builders on one project by giving them all the same schematic and origin, but different build patterns. You can also manually split your schematic into multiple parts with WorldEdit or MCEdit.<br />
<br />
Q: How can I make builders go faster?<br />
<br />
A: Use the /builder timeout command to set the max time between blocks. You can also make the builder walk faster with "/npc speed"<br />
<br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Donate to jrbudda]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Builder&diff=5097Builder2016-08-29T04:41:02Z<p>Morphan1: </p>
<hr />
<div>{{Trait<br />
| PICTURE = Builder.png<br />
| AUTHOR = jrbudda<br />
| NAME = Builder<br />
| VERSION = 0.9.1 build 2<br />
| CITIZENSBUILD = [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.20] (Craftbukkit 1.10+)<br />
| DEVSTATUS = Release<br />
| DEPENDS = None required.<br />
| DOWNLOADLINK = http://ci.citizensnpcs.co/job/Builder/lastSuccessfulBuild/<br />
| DESCRIPTION = Citizens NPCs that build schematics.<br />
}}<br />
<br />
===ATTENTION:===<br />
===The author of this plugin has gone inactive. Currently, this plugin is only being maintained to allow compatibility with new Minecraft updates. The stability and functionality of these builds cannot be promised.===<br />
<br />
'''Builder''' is a Citizens 2.0 [[Characters|character trait]] that gives NPCs the ability to:<br />
* Build MCEdit/Worldedit schematics, block by block.<br />
* Rebuild an area, fixing anything that has been changed.<br />
* Collect the required materials from players before building.<br />
<br />
__TOC__<br />
==Updates==<br />
{{scrollbox|<br />
<br />
'''Builder For CraftBukkit 1.10+''' [http://ci.citizensnpcs.co/job/Builder/14/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9.4''' [http://ci.citizensnpcs.co/job/Builder/13/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9''' [http://ci.citizensnpcs.co/job/Builder/12/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.7''' [http://ci.citizensnpcs.co/job/Builder/9/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.3''' [http://ci.citizensnpcs.co/job/Builder/4/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8''' [http://ci.citizensnpcs.co/job/Builder/3/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''v. 0.9.1 build 2''' 6/3/2014 [http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar download]<br />
* Update for craftbukkit 1.7.10<br />
<br />
'''v. 0.9.1''' 6/3/2014 [http://www.sendspace.com/file/646mvv download]<br />
* Update for craftbukkit 1.7.9<br />
<br />
'''v. 0.9.0''' 12/11/2013 [http://www.sendspace.com/file/5q3v9h download]<br />
* Update for craftbukkit 1.7.2<br />
<br />
'''v. 0.8.2''' 9/20/2013 [http://www.sendspace.com/file/3qk2qa download]<br />
* Update for craftbukkit 1.6.4<br />
<br />
'''v. 0.8.1''' 8/8/2013 [http://www.sendspace.com/file/sb8tfc download]<br />
* added ''silent'' build option that suppresses the messages builder sends to the person who started a build.<br />
* Fixed excavate option so it works.<br />
<br />
'''v. 0.8''' 7/29/2013 [http://www.sendspace.com/file/4yhc12 download]<br />
*Builders have gone to engineering school and now support tile entities (chest contents, sign text, skull types, command blocks, etc...)<br />
*Added command /builder origin x,y,z<br />
*Maybe some improvements to memory usage on large schematics.<br />
*Added command block to default list of blocks not needed for supply mode.<br />
*Fix warning at startup.<br />
<br />
'''v. 0.7.2 ''' 7/9/2013 [http://www.sendspace.com/file/imftlv download]<br />
*Compatible with Bukkit 1.6.2<br />
<br />
'''v. 0.7.1 ''' 7/3/2013 [http://www.sendspace.com/file/xkjvbb download]<br />
*Compatible with Bukkit 1.6.1<br />
*Compatible with Denizen .9<br />
<br />
'''v. 0.7 ''' 6/27/2013 [http://www.sendspace.com/file/v7td6n download]<br />
*Supply mode is now customizable<br />
<br />
'''v. 0.6.9 ''' 5/4/2013 [http://www.sendspace.com/file/smy3z8 download]<br />
* Update for craftbukkit 1.5.2<br />
* Properly group new blocks from 1.4.7 and 1.5.x updates.<br />
* Add server-wide setting so that Supply mode requires exact blocks.<br />
<br />
'''v. 0.6.8.1 ''' 3/21/2013 [http://www.sendspace.com/file/nv50m2 download]<br />
* Update for craftbukkit 1.5.1<br />
<br />
'''v. 0.6.8 ''' 3/19/2013 [http://www.sendspace.com/file/x36t95 download]<br />
* Compatibility with cb 1.5, citizens 2.0.8, and Denizen .8<br />
<br />
'''v. 0.6.7 ''' 1/19/2013 [http://www.sendspace.com/file/dwm2gl download]<br />
* Compatibility with cb 1.4.7<br />
<br />
'''v. 0.6.6 final ''' 1/4/2013 [http://www.sendspace.com/file/49vrxe download]<br />
* Use with cb 1.4.6<br />
* Fix persistence bug with needed materials in supply mode and layers build option.<br />
<br />
'''v. 0.6.6b ''' 12/22/2012 [http://www.sendspace.com/file/634eev download]<br />
* Compatibility with CraftBukkit 1.4.6r0.1 and Citizens2 2.0.6.<br />
<br />
'''v. 0.6.5''' 12/20/2012 [http://www.sendspace.com/file/5xpctb download]<br />
* Compatibility with CraftBukkit 1.4.5r1.0 and Citizens2 2.0.5 Release.<br />
<br />
'''v. 0.6.4''' 12/9/2012<br />
* Compatibility with latest craftbukkit 1.4.5 r.03 and citizens2 build 606+.<br />
<br />
'''v. 0.6.3''' 11/30/2012<br />
* Compatible with craftbukkit 1.4.4 - 1.4.5 r0.2 and citizens2 build 597.<br />
* Fix crops/seeds error.<br />
* Accept either type of pressure plate for supply mode.<br />
<br />
'''v. 0.6.2''' 10/29/2012<br />
* Update for cb 1.4.2... with NOT work with 1.3 !<br />
<br />
'''v. 0.6.1''' 10/25/2012<br />
* Final fixes to supply mode. Release of .6<br />
<br />
'''v. 0.6 ALPHA3''' 10/19/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Fixed supply requirement for glass blocks and panes, melon, bookshelves, ender chests, snow, ice, double slabs.<br />
* Changed supply requirement for stairs: all wood stairs count as 'oak wood stairs'. All stone stairs (except nether brick) count as 'stone brick stairs'. This is to match the behavior with slabs.<br />
<br />
'''v. 0.6 ALPHA2''' 10/15/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Added builder.donate permission. This allows players to donate to a builder in supply mode.<br />
* Fix calling ''build'' from the console.<br />
<br />
'''v. 0.6 ALPHA''' 10/14/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* '''Supply Mode''' - Builders can now be set so that players must provide all the materials before the builder will start building. use ''/builder supply true'' to turn this on, then call ''/builder build'' as usual.<br />
** Once build is called the Builder will go into [[#Supply Mode|Supply mode]]. See section for details.<br />
** Only those blocks actually needed will be required (if some are already in place)<br />
** The collected materials will persist if the server is restarted.<br />
** Localized names are used for all items and blocks. (based on server language setting)<br />
** If the build is canceled the collected items are lost.<br />
** Unobtainable blocks are supplied by giving their normal drop type (example: Cobwebs require players to supply String). Please let me know if I missed any.<br />
* Fixed 'mark' and 'schematic origin' sometimes being off by 1 block.<br />
* Moved the 'nohold' build option to its own command: /builder hold true/false<br />
* Added onstart: build option, this will run a Denizen task when the builder starts building (after collecting required materials, if set)<br />
<br />
'''v. 0.5.1 Beta''' 10/4/2012<br />
* Added command /builder list<br />
* Added build option: yoffset<br />
<br />
'''v. 0.5 Beta''' 9/25/2012<br />
* It is highly recommenced you use this with build 382+ of citizens2. 382 has some pathfinding fixes that make high /npc speed settings less... undesirable.<br />
* Builders loaded with the same schematic will share it in memory. Reduces RAM overhead.<br />
* Schematics are now pre-processed right when you call build, this has the following consequences:<br />
** Less memory usage for the to-build list<br />
** /builder info now shows total block count, blocks remaining, and a % complete during the build.<br />
** new command: '''survey''' shows the material list required to build in the current location, taking into account what is already there.<br />
** You may experience a small server hiccup when you call build for VERY large schematics (millions of blocks) Hope to reduce this for the future.<br />
* New command: '''timeout''' sets the maximum time between blocks. Can be set as low as 0.1 seconds. (The fastest possible build speed is about 5 blocks per second.)<br />
<br />
'''v. 0.4.1 Beta''' 9/18/2012<br />
* '''Verical Build options''' you can now specify layers:X to build X number of layers at a time. Significantly speeds up building.<br />
* '''Grouping option''' you can specify groupall to build ALL of one group of materials at a time (instead of doing it at every set of layers)<br />
* added commands: origin me, origin current<br />
* excavate works from the top down, as you would expect.<br />
<br />
'''v. 0.4 Beta''' 9/16/2012<br />
* '''New build order''' Builder now places items in groupings based on item type: base blocks, furniture, redstone, liquids, and decorations. This is done ''per layer'' because I didn't like how it looked building all the layers of one type first. Maybe configurable later.<br />
* '''New build patterns!''' builders can use: spiral, linear, reversespiral or reverselinear (this is for the x-z plane, builders still build from the bottom layer up, 1 layer at a time... for now!) the default is spiral.<br />
*(Okay I'll admit this sort of lets you use up to 4 builders on 1 schematic if they have the same origin and different patterns... but shhh it's our secret :))<br />
* '''Excavate mode!''' builders can optionally dig out the area before building!<br />
* '''Configuration!''' Builder now makes a config.yml that can be used to change the default schematics directory. messages and allowable 'marking' materials.<br />
* Holding items! Player and Endermen-type builders will now hold the item they are about to place, or a pickaxe if breaking blocks.<br />
* Fix mob-type builders, they no longer crash clients because cows can't swing their arms!<br />
* the ignoreliquid and ignoreair commands have been {{color|red|white|removed}} specify these options when calling /builder build.<br />
* Hooked into dynmap to trigger an area render on completion/cancellation of build.<br />
<br />
'''v. 0.3.2 Beta''' 9/13/2012<br />
* Builder will remove previous marks before building or placing new ones.<br />
* Fix skipping first block in schematic.<br />
* Improved error messages an other minor fixes.<br />
* Target Java 6 instead of 7.<br />
<br />
'''v. 0.3.1 Alpha''' 9/12/2012<br />
* Pathing and other minor bugfixes.<br />
* fix /builder mark<br />
* /builder help actually provides help.<br />
<br />
'''v. 0.3 Alpha''' 9/11/2012<br />
* Added Denizen Task script execution option on build completion and cancellation.<br />
* Reduced memory usage of loaded schematics by 80%.<br />
* Last loaded schematic is now persistent.<br />
* Lots of updates to messages and info.<br />
<br />
'''v. 0.2.1 Alpha''' 9/9/2012<br />
* added commands origin clear, origin schematic, check, compare<br />
<br />
'''v. 0.2 Alpha''' 9/9/2012<br />
*Added commands ignoreair, ignoreliquid, origin, info<br />
<br />
'''v. 0.1.1 Alpha''' 9/9/2012<br />
*Added Mark command.<br />
*Better pathing.<br />
<br />
'''v. 0.1 Alpha''' 9/9/2012<br />
* First release<br />
}}<br />
<br />
<!-- THIS SECTION IS BROKEN<br />
{|<br />
{{#ev:youtube|UyAR7-_17XY|}} |{{#ev:youtube|ZiYhFZi5vB0|}} | {{#ev:youtube|HOxX9pb--NQ|}} | {{#ev:youtube|KS4v17Y8xcA|}} <br />
|}<br />
--><br />
<br />
==Installation==<br />
*Install Citizens 2<br />
*Place Builder.jar file in /plugins directory. <br />
*Place .schematic files in /plugins/Builder/schematics/<br />
*Start Server<br />
*Create NPC and give the Builder trait.<br />
/npc create Bob --trait builder<br />
or<br />
/npc create Bob<br />
/trait builder<br />
<br />
==Permissions==<br />
*''builder.*'' Give access to all Builder permissions.<br />
*''builder.[command]'' Give access to [command].<br />
*''builder.donate'' Allows players to donate to a builder in Supply Mode (useful for locking out creative mode players)<br />
<br />
==Configuration==<br />
See [[Builder/Configuration|Configuration]].<br />
<br />
Builder will create ''Builder/config.yml'' if it does not exist already. Be sure to check the configuration page if new options are added.<br />
<br />
==Commands==<br />
All commands can be run on a selected NPC as shown (<code>/builder [command]</code>), or on a target NPC with <code>/builder [npcid] [command]</code>.<br />
<br />
'''/builder list''' - Lists all available schematics in the configured schematics folder. Does not require a builder selected.<br />
<br />
'''/builder load [schematic]''' - Loads a .schematic file. simply use the name of the schematic.<br />
Example<br />
/builder load house<br />
<br />
'''/builder origin''' - Sets the origin of the builder's projects to the builder's current location. Allows you to re-build in the same spot. If this is not set the builder will always start from his current location.<br />
<br />
'''/builder origin clear''' - Clears the saved build origin.<br />
<br />
'''/builder origin schematic''' - Sets the origin of the builder's projects to the origin of the loaded schematic. Best used for schematics created from the builder's world with worldedit.<br />
<br />
'''/builder origin me''' - Sets the origin of the builder's projects to the player's position. Does not work from the console.<br />
<br />
'''/builder origin current''' - Sets the origin of the builder's projects to the origin of the project currently being built. Use this if you forgot to set the origin before starting to build, and need to cancel it to resume later.<br />
<br />
'''/builder origin x,y,z''' - Sets the origin of the builder's projects to the location x,y,z of the builder's current world.<br />
<br />
'''/builder mark (item)''' - Places a block at the 4 corners of the footprint, then returns to the origin, so you can see where it's going to build. You can specify the item to use, although that item must be allowed in the config.yml. The first item on the list in the config is the default if no item is specified. If the config is missing the builder will use GLASS.<br />
<br />
'''/builder timeout [value]''' - Sets the maximum time, in seconds, between blocks. Valid values are 0.1 - 2000000.0. Default is 2.0. Default can be changed in the config.yml.<br />
<br />
'''/builder build (option1) (option2) ... etc''' - Start building the schematic. This command takes several optional arguments. The order does not matter. you can add to this command the following:<br />
*linear - build north to south<br />
*reverselinear - build south to north<br />
*sprial - build inside to outside (this is the default and thus does not need to be specified.)<br />
*reversespiral - build outside to inside.<br />
*excavate - The builder will clear out the area of blocks before starting to place them.<br />
*layers:# - The builder will build # number of layers at a time, the default is 1.<br />
*yoffset:# - The builder will start building the specified number of blocks up or down from the set starting location.<br />
*groupall - the builder will build all of a group of materials at once, instead of doing it per layer.<br />
*ignoreair - the builder will not place air blocks. (Use to build into an existing structure, pointless if used with excavate)<br />
*ignoreliquid - the builder will not place lava or water blocks. (Use if the schematic has unconstrained liquids on the bottom.)<br />
*onstart:Task - the builder will run the [[Denizen]] task script on start of build (after material collection). See [[#Advanced Usage]]<br />
*oncomplete:Task - the builder will run the [[Denizen]] task script on completion of build. See [[#Advanced Usage]]<br />
*oncancel:Task - the builder will run the [[Denizen]] task script on cancellation of build. See [[#Advanced Usage]]<br />
*silent - the builder will not send completion/error messages to the command sender.<br />
<br />
Examples:<br />
/builder build<br />
/builder build excavate reverselinear yoffset:-3<br />
/builder build ignoreair ignoreliquid oncomplete:Celebrate<br />
/builder build groupall layers:3<br />
<br />
'''/builder cancel''' - Cancel a build job.<br />
<br />
'''/builder info''' - View a Builder's loaded schematic name and size, as well as the builder's options and status.<br />
<br />
'''/builder survey (excavate)''' - Display a list of all the block types/count it would require to build at the current location. Specify excavate to show the list of materials if excavation is used. Does not show water or lava.<br />
<br />
'''/builder supply true|false''' set whether the builder will need to be given the materials before he will start building. See [[#Supply Mode]]<br />
<br />
'''/builder hold true|false''' set whether the builder will hold the items he is placing (Turn off only for compatibility with other plugins like [[Sentry]])<br />
<br />
'''/builder reload ''' - reload options from the builder config.yml<br />
<br />
'''/builder help''' - Display the help.<br />
<br />
==Usage==<br />
*.schematic files should be placed in the ''/plugins/Builder/schematics/'' directory. This directory can be configured in the config.yml<br />
* Position the builder, or set the builder's '''origin''', to the ''center'' of the footpoint you want to build before calling '''build'''. The size of the schematic is shown upon load.<br />
* You can cancel a build and resume it later if you have an Origin set. You can use <code> /builder origin current </code> to set the origin after building has started if you forgot.<br />
* Do not try to resume a build with the excavate option!<br />
* The builder will ignore any empty space underneath the schematic object so that it will always rest on the ground where the builder starts. If you want to build above or below the origin, use the yoffset: build option.<br />
* The builder will not attempt to replace blocks that are already set properly, this means you can use a builder to quickly 'restore' any changed blocks in something he has previously built.<br />
**To set up a builder to maintain an existing building:<br />
***Select the building with worldedit and save it as a schematic.<br />
***Copy the schematic to the builder's schematics directory.<br />
***Load the schematic to a builder and call <code> /builder origin schematic</code>.<br />
***Call /builder build and the builder will place any missing blocks or destroy new ones.<br />
*Rail and dispensers my not be placed correctly. (Hey this is Construction, not Engimaneerin'.)<br />
*By default, NPCs despawn when their chunk unloads. This behavior can be changed in the Citizens2 config.yml, and is recommended if you would like builders to continue to work unattended.<br />
<br />
==Supply Mode==<br />
If the Builder is set to require materials for building (with ''/builder supply true''), he will go into Supply Mode when ''/builder build'' is called. When Supply Mode starts the Builder will survey the build site and generate a list of required materials to start building. Players must provide these materials for the builder to begin. <br />
<br />
While in Supply Mode:<br />
* Right-Click the Builder with an empty hand to view the list of materials still needed.<br />
* Right-Click the Builder with any block or item to see if he needs it. If he does, he will tell you how much he still needs.<br />
* After clicking with a needed material, Right-Click again within a few seconds to give it to the Builder. <br />
* After receiving a material the Builder will say how many more blocks he needs in total to begin, or he will begin building if he has everything.<br />
<br />
What materials are required:<br />
*By default all blocks require their normal drop type (i.e. Cobwebs require String)<br />
*This behavior can be overridden via the 'supply.txt' file found in the \Builder folder.<br />
**Each line contains the Item ID of the block in the schematic, and the ItemID of the block/Item that is required.<br />
**Optionally you can specify the number of blocks/items required for each source block.<br />
**Setting the required Item ID to 0 will not include that source block in the requirements.<br />
<br />
{| class="wikitable collapsible collapsed" <br />
! Default Supply Mode configuration<br />
|-<br />
|<pre><br />
Original Block Number:Require Item Number:Amount(Optional)<br />
Set to 0 to never require block. Blocks not specified will require their normal drop item.<br />
90:0<br />
97:0<br />
95:54<br />
78:0<br />
34:0<br />
119:0<br />
80:80<br />
92:354<br />
43:44:2<br />
125:126:2<br />
20:20<br />
102:102<br />
47:47<br />
103:362<br />
130:130<br />
134:53<br />
135:53<br />
136:53<br />
128:67<br />
109:67<br />
108:67<br />
79:332<br />
51:0<br />
59:295<br />
72:70<br />
71:330:0.5<br />
26:335:0.5<br />
</pre><br />
|}<br />
<br />
All blocks are currently matched on Item ID only. This means:<br />
* All Wool is Wool. Color is ignored building the list, and any color wool can be given to fulfill the requirement.<br />
* The same goes for saplings, slabs, logs, and wood planks.<br />
* Stairs are similar. All wood stairs count as 'oak'. All stone/brick stairs count as 'stone' with the exception of nether brick stairs which are separate.<br />
<br />
If the build is canceled at any point, the collected materials are lost.<br />
<br />
==Advanced Usage==<br />
* Builder can be set to run [[Denizen]] Task Scripts on start, completion, or cancellation of a build.<br />
**The NPC must have both the Builder and [[Denizen]] Trait.<br />
**Call <code>/builder build</code> with the optional modifiers <br />
***<code>onstart:TaskName</code><br />
***<code>oncomplete:TaskName</code> <br />
***<code>oncancel:TaskName</code>. <br />
Example:<br />
/builder build oncomplete:DespawnTask oncancel:AnnounceTask<br />
<br />
*Builder can also run [[Denizen Actions]] at the 3 indicated events. Add the following to the NPC's actions:<br />
**"Build Start"<br />
**"Build Complete"<br />
**"Build Cancel"<br />
Example:<br />
<br />
<code><br />
BuilderAssignment:<br />
type: assignment<br />
actions:<br />
on Build Start:<br />
- ANNOUNCE "Let's do this!"<br />
on Build Complete:<br />
- ANNOUNCE "I have finished!"<br />
</code><br />
<br />
For more complex examples with Denizen and Builder see [[Builder/Builder_and_Denizen|Builder and Denizen Examples]]<br />
<br />
==FAQ==<br />
Q: How can I use multiple builders on one project?<br />
<br />
A: You can use up to 4 builders on one project by giving them all the same schematic and origin, but different build patterns. You can also manually split your schematic into multiple parts with WorldEdit or MCEdit.<br />
<br />
Q: How can I make builders go faster?<br />
<br />
A: Use the /builder timeout command to set the max time between blocks. You can also make the builder walk faster with "/npc speed"<br />
<br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Donate to jrbudda]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Builder&diff=5096Builder2016-08-29T04:40:01Z<p>Morphan1: /* Updates */</p>
<hr />
<div>{{Trait<br />
| PICTURE = Builder.png<br />
| AUTHOR = jrbudda<br />
| NAME = Builder<br />
| VERSION = 0.9.1 build 2<br />
| CITIZENSBUILD = [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.16] (Craftbukkit 1.8.7)<br />
| DEVSTATUS = Release<br />
| DEPENDS = None required.<br />
| DOWNLOADLINK = http://ci.citizensnpcs.co/job/Builder/lastSuccessfulBuild/<br />
| DESCRIPTION = Citizens NPCs that build schematics.<br />
}}<br />
<br />
===ATTENTION:===<br />
===The author of this plugin has gone inactive. Currently, this plugin is only being maintained to allow compatibility with new Minecraft updates. The stability and functionality of these builds cannot be promised.===<br />
<br />
'''Builder''' is a Citizens 2.0 [[Characters|character trait]] that gives NPCs the ability to:<br />
* Build MCEdit/Worldedit schematics, block by block.<br />
* Rebuild an area, fixing anything that has been changed.<br />
* Collect the required materials from players before building.<br />
<br />
__TOC__<br />
==Updates==<br />
{{scrollbox|<br />
<br />
'''Builder For CraftBukkit 1.10+''' [http://ci.citizensnpcs.co/job/Builder/14/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9.4''' [http://ci.citizensnpcs.co/job/Builder/13/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9''' [http://ci.citizensnpcs.co/job/Builder/12/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.7''' [http://ci.citizensnpcs.co/job/Builder/9/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.3''' [http://ci.citizensnpcs.co/job/Builder/4/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8''' [http://ci.citizensnpcs.co/job/Builder/3/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''v. 0.9.1 build 2''' 6/3/2014 [http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar download]<br />
* Update for craftbukkit 1.7.10<br />
<br />
'''v. 0.9.1''' 6/3/2014 [http://www.sendspace.com/file/646mvv download]<br />
* Update for craftbukkit 1.7.9<br />
<br />
'''v. 0.9.0''' 12/11/2013 [http://www.sendspace.com/file/5q3v9h download]<br />
* Update for craftbukkit 1.7.2<br />
<br />
'''v. 0.8.2''' 9/20/2013 [http://www.sendspace.com/file/3qk2qa download]<br />
* Update for craftbukkit 1.6.4<br />
<br />
'''v. 0.8.1''' 8/8/2013 [http://www.sendspace.com/file/sb8tfc download]<br />
* added ''silent'' build option that suppresses the messages builder sends to the person who started a build.<br />
* Fixed excavate option so it works.<br />
<br />
'''v. 0.8''' 7/29/2013 [http://www.sendspace.com/file/4yhc12 download]<br />
*Builders have gone to engineering school and now support tile entities (chest contents, sign text, skull types, command blocks, etc...)<br />
*Added command /builder origin x,y,z<br />
*Maybe some improvements to memory usage on large schematics.<br />
*Added command block to default list of blocks not needed for supply mode.<br />
*Fix warning at startup.<br />
<br />
'''v. 0.7.2 ''' 7/9/2013 [http://www.sendspace.com/file/imftlv download]<br />
*Compatible with Bukkit 1.6.2<br />
<br />
'''v. 0.7.1 ''' 7/3/2013 [http://www.sendspace.com/file/xkjvbb download]<br />
*Compatible with Bukkit 1.6.1<br />
*Compatible with Denizen .9<br />
<br />
'''v. 0.7 ''' 6/27/2013 [http://www.sendspace.com/file/v7td6n download]<br />
*Supply mode is now customizable<br />
<br />
'''v. 0.6.9 ''' 5/4/2013 [http://www.sendspace.com/file/smy3z8 download]<br />
* Update for craftbukkit 1.5.2<br />
* Properly group new blocks from 1.4.7 and 1.5.x updates.<br />
* Add server-wide setting so that Supply mode requires exact blocks.<br />
<br />
'''v. 0.6.8.1 ''' 3/21/2013 [http://www.sendspace.com/file/nv50m2 download]<br />
* Update for craftbukkit 1.5.1<br />
<br />
'''v. 0.6.8 ''' 3/19/2013 [http://www.sendspace.com/file/x36t95 download]<br />
* Compatibility with cb 1.5, citizens 2.0.8, and Denizen .8<br />
<br />
'''v. 0.6.7 ''' 1/19/2013 [http://www.sendspace.com/file/dwm2gl download]<br />
* Compatibility with cb 1.4.7<br />
<br />
'''v. 0.6.6 final ''' 1/4/2013 [http://www.sendspace.com/file/49vrxe download]<br />
* Use with cb 1.4.6<br />
* Fix persistence bug with needed materials in supply mode and layers build option.<br />
<br />
'''v. 0.6.6b ''' 12/22/2012 [http://www.sendspace.com/file/634eev download]<br />
* Compatibility with CraftBukkit 1.4.6r0.1 and Citizens2 2.0.6.<br />
<br />
'''v. 0.6.5''' 12/20/2012 [http://www.sendspace.com/file/5xpctb download]<br />
* Compatibility with CraftBukkit 1.4.5r1.0 and Citizens2 2.0.5 Release.<br />
<br />
'''v. 0.6.4''' 12/9/2012<br />
* Compatibility with latest craftbukkit 1.4.5 r.03 and citizens2 build 606+.<br />
<br />
'''v. 0.6.3''' 11/30/2012<br />
* Compatible with craftbukkit 1.4.4 - 1.4.5 r0.2 and citizens2 build 597.<br />
* Fix crops/seeds error.<br />
* Accept either type of pressure plate for supply mode.<br />
<br />
'''v. 0.6.2''' 10/29/2012<br />
* Update for cb 1.4.2... with NOT work with 1.3 !<br />
<br />
'''v. 0.6.1''' 10/25/2012<br />
* Final fixes to supply mode. Release of .6<br />
<br />
'''v. 0.6 ALPHA3''' 10/19/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Fixed supply requirement for glass blocks and panes, melon, bookshelves, ender chests, snow, ice, double slabs.<br />
* Changed supply requirement for stairs: all wood stairs count as 'oak wood stairs'. All stone stairs (except nether brick) count as 'stone brick stairs'. This is to match the behavior with slabs.<br />
<br />
'''v. 0.6 ALPHA2''' 10/15/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Added builder.donate permission. This allows players to donate to a builder in supply mode.<br />
* Fix calling ''build'' from the console.<br />
<br />
'''v. 0.6 ALPHA''' 10/14/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* '''Supply Mode''' - Builders can now be set so that players must provide all the materials before the builder will start building. use ''/builder supply true'' to turn this on, then call ''/builder build'' as usual.<br />
** Once build is called the Builder will go into [[#Supply Mode|Supply mode]]. See section for details.<br />
** Only those blocks actually needed will be required (if some are already in place)<br />
** The collected materials will persist if the server is restarted.<br />
** Localized names are used for all items and blocks. (based on server language setting)<br />
** If the build is canceled the collected items are lost.<br />
** Unobtainable blocks are supplied by giving their normal drop type (example: Cobwebs require players to supply String). Please let me know if I missed any.<br />
* Fixed 'mark' and 'schematic origin' sometimes being off by 1 block.<br />
* Moved the 'nohold' build option to its own command: /builder hold true/false<br />
* Added onstart: build option, this will run a Denizen task when the builder starts building (after collecting required materials, if set)<br />
<br />
'''v. 0.5.1 Beta''' 10/4/2012<br />
* Added command /builder list<br />
* Added build option: yoffset<br />
<br />
'''v. 0.5 Beta''' 9/25/2012<br />
* It is highly recommenced you use this with build 382+ of citizens2. 382 has some pathfinding fixes that make high /npc speed settings less... undesirable.<br />
* Builders loaded with the same schematic will share it in memory. Reduces RAM overhead.<br />
* Schematics are now pre-processed right when you call build, this has the following consequences:<br />
** Less memory usage for the to-build list<br />
** /builder info now shows total block count, blocks remaining, and a % complete during the build.<br />
** new command: '''survey''' shows the material list required to build in the current location, taking into account what is already there.<br />
** You may experience a small server hiccup when you call build for VERY large schematics (millions of blocks) Hope to reduce this for the future.<br />
* New command: '''timeout''' sets the maximum time between blocks. Can be set as low as 0.1 seconds. (The fastest possible build speed is about 5 blocks per second.)<br />
<br />
'''v. 0.4.1 Beta''' 9/18/2012<br />
* '''Verical Build options''' you can now specify layers:X to build X number of layers at a time. Significantly speeds up building.<br />
* '''Grouping option''' you can specify groupall to build ALL of one group of materials at a time (instead of doing it at every set of layers)<br />
* added commands: origin me, origin current<br />
* excavate works from the top down, as you would expect.<br />
<br />
'''v. 0.4 Beta''' 9/16/2012<br />
* '''New build order''' Builder now places items in groupings based on item type: base blocks, furniture, redstone, liquids, and decorations. This is done ''per layer'' because I didn't like how it looked building all the layers of one type first. Maybe configurable later.<br />
* '''New build patterns!''' builders can use: spiral, linear, reversespiral or reverselinear (this is for the x-z plane, builders still build from the bottom layer up, 1 layer at a time... for now!) the default is spiral.<br />
*(Okay I'll admit this sort of lets you use up to 4 builders on 1 schematic if they have the same origin and different patterns... but shhh it's our secret :))<br />
* '''Excavate mode!''' builders can optionally dig out the area before building!<br />
* '''Configuration!''' Builder now makes a config.yml that can be used to change the default schematics directory. messages and allowable 'marking' materials.<br />
* Holding items! Player and Endermen-type builders will now hold the item they are about to place, or a pickaxe if breaking blocks.<br />
* Fix mob-type builders, they no longer crash clients because cows can't swing their arms!<br />
* the ignoreliquid and ignoreair commands have been {{color|red|white|removed}} specify these options when calling /builder build.<br />
* Hooked into dynmap to trigger an area render on completion/cancellation of build.<br />
<br />
'''v. 0.3.2 Beta''' 9/13/2012<br />
* Builder will remove previous marks before building or placing new ones.<br />
* Fix skipping first block in schematic.<br />
* Improved error messages an other minor fixes.<br />
* Target Java 6 instead of 7.<br />
<br />
'''v. 0.3.1 Alpha''' 9/12/2012<br />
* Pathing and other minor bugfixes.<br />
* fix /builder mark<br />
* /builder help actually provides help.<br />
<br />
'''v. 0.3 Alpha''' 9/11/2012<br />
* Added Denizen Task script execution option on build completion and cancellation.<br />
* Reduced memory usage of loaded schematics by 80%.<br />
* Last loaded schematic is now persistent.<br />
* Lots of updates to messages and info.<br />
<br />
'''v. 0.2.1 Alpha''' 9/9/2012<br />
* added commands origin clear, origin schematic, check, compare<br />
<br />
'''v. 0.2 Alpha''' 9/9/2012<br />
*Added commands ignoreair, ignoreliquid, origin, info<br />
<br />
'''v. 0.1.1 Alpha''' 9/9/2012<br />
*Added Mark command.<br />
*Better pathing.<br />
<br />
'''v. 0.1 Alpha''' 9/9/2012<br />
* First release<br />
}}<br />
<br />
<!-- THIS SECTION IS BROKEN<br />
{|<br />
{{#ev:youtube|UyAR7-_17XY|}} |{{#ev:youtube|ZiYhFZi5vB0|}} | {{#ev:youtube|HOxX9pb--NQ|}} | {{#ev:youtube|KS4v17Y8xcA|}} <br />
|}<br />
--><br />
<br />
==Installation==<br />
*Install Citizens 2<br />
*Place Builder.jar file in /plugins directory. <br />
*Place .schematic files in /plugins/Builder/schematics/<br />
*Start Server<br />
*Create NPC and give the Builder trait.<br />
/npc create Bob --trait builder<br />
or<br />
/npc create Bob<br />
/trait builder<br />
<br />
==Permissions==<br />
*''builder.*'' Give access to all Builder permissions.<br />
*''builder.[command]'' Give access to [command].<br />
*''builder.donate'' Allows players to donate to a builder in Supply Mode (useful for locking out creative mode players)<br />
<br />
==Configuration==<br />
See [[Builder/Configuration|Configuration]].<br />
<br />
Builder will create ''Builder/config.yml'' if it does not exist already. Be sure to check the configuration page if new options are added.<br />
<br />
==Commands==<br />
All commands can be run on a selected NPC as shown (<code>/builder [command]</code>), or on a target NPC with <code>/builder [npcid] [command]</code>.<br />
<br />
'''/builder list''' - Lists all available schematics in the configured schematics folder. Does not require a builder selected.<br />
<br />
'''/builder load [schematic]''' - Loads a .schematic file. simply use the name of the schematic.<br />
Example<br />
/builder load house<br />
<br />
'''/builder origin''' - Sets the origin of the builder's projects to the builder's current location. Allows you to re-build in the same spot. If this is not set the builder will always start from his current location.<br />
<br />
'''/builder origin clear''' - Clears the saved build origin.<br />
<br />
'''/builder origin schematic''' - Sets the origin of the builder's projects to the origin of the loaded schematic. Best used for schematics created from the builder's world with worldedit.<br />
<br />
'''/builder origin me''' - Sets the origin of the builder's projects to the player's position. Does not work from the console.<br />
<br />
'''/builder origin current''' - Sets the origin of the builder's projects to the origin of the project currently being built. Use this if you forgot to set the origin before starting to build, and need to cancel it to resume later.<br />
<br />
'''/builder origin x,y,z''' - Sets the origin of the builder's projects to the location x,y,z of the builder's current world.<br />
<br />
'''/builder mark (item)''' - Places a block at the 4 corners of the footprint, then returns to the origin, so you can see where it's going to build. You can specify the item to use, although that item must be allowed in the config.yml. The first item on the list in the config is the default if no item is specified. If the config is missing the builder will use GLASS.<br />
<br />
'''/builder timeout [value]''' - Sets the maximum time, in seconds, between blocks. Valid values are 0.1 - 2000000.0. Default is 2.0. Default can be changed in the config.yml.<br />
<br />
'''/builder build (option1) (option2) ... etc''' - Start building the schematic. This command takes several optional arguments. The order does not matter. you can add to this command the following:<br />
*linear - build north to south<br />
*reverselinear - build south to north<br />
*sprial - build inside to outside (this is the default and thus does not need to be specified.)<br />
*reversespiral - build outside to inside.<br />
*excavate - The builder will clear out the area of blocks before starting to place them.<br />
*layers:# - The builder will build # number of layers at a time, the default is 1.<br />
*yoffset:# - The builder will start building the specified number of blocks up or down from the set starting location.<br />
*groupall - the builder will build all of a group of materials at once, instead of doing it per layer.<br />
*ignoreair - the builder will not place air blocks. (Use to build into an existing structure, pointless if used with excavate)<br />
*ignoreliquid - the builder will not place lava or water blocks. (Use if the schematic has unconstrained liquids on the bottom.)<br />
*onstart:Task - the builder will run the [[Denizen]] task script on start of build (after material collection). See [[#Advanced Usage]]<br />
*oncomplete:Task - the builder will run the [[Denizen]] task script on completion of build. See [[#Advanced Usage]]<br />
*oncancel:Task - the builder will run the [[Denizen]] task script on cancellation of build. See [[#Advanced Usage]]<br />
*silent - the builder will not send completion/error messages to the command sender.<br />
<br />
Examples:<br />
/builder build<br />
/builder build excavate reverselinear yoffset:-3<br />
/builder build ignoreair ignoreliquid oncomplete:Celebrate<br />
/builder build groupall layers:3<br />
<br />
'''/builder cancel''' - Cancel a build job.<br />
<br />
'''/builder info''' - View a Builder's loaded schematic name and size, as well as the builder's options and status.<br />
<br />
'''/builder survey (excavate)''' - Display a list of all the block types/count it would require to build at the current location. Specify excavate to show the list of materials if excavation is used. Does not show water or lava.<br />
<br />
'''/builder supply true|false''' set whether the builder will need to be given the materials before he will start building. See [[#Supply Mode]]<br />
<br />
'''/builder hold true|false''' set whether the builder will hold the items he is placing (Turn off only for compatibility with other plugins like [[Sentry]])<br />
<br />
'''/builder reload ''' - reload options from the builder config.yml<br />
<br />
'''/builder help''' - Display the help.<br />
<br />
==Usage==<br />
*.schematic files should be placed in the ''/plugins/Builder/schematics/'' directory. This directory can be configured in the config.yml<br />
* Position the builder, or set the builder's '''origin''', to the ''center'' of the footpoint you want to build before calling '''build'''. The size of the schematic is shown upon load.<br />
* You can cancel a build and resume it later if you have an Origin set. You can use <code> /builder origin current </code> to set the origin after building has started if you forgot.<br />
* Do not try to resume a build with the excavate option!<br />
* The builder will ignore any empty space underneath the schematic object so that it will always rest on the ground where the builder starts. If you want to build above or below the origin, use the yoffset: build option.<br />
* The builder will not attempt to replace blocks that are already set properly, this means you can use a builder to quickly 'restore' any changed blocks in something he has previously built.<br />
**To set up a builder to maintain an existing building:<br />
***Select the building with worldedit and save it as a schematic.<br />
***Copy the schematic to the builder's schematics directory.<br />
***Load the schematic to a builder and call <code> /builder origin schematic</code>.<br />
***Call /builder build and the builder will place any missing blocks or destroy new ones.<br />
*Rail and dispensers my not be placed correctly. (Hey this is Construction, not Engimaneerin'.)<br />
*By default, NPCs despawn when their chunk unloads. This behavior can be changed in the Citizens2 config.yml, and is recommended if you would like builders to continue to work unattended.<br />
<br />
==Supply Mode==<br />
If the Builder is set to require materials for building (with ''/builder supply true''), he will go into Supply Mode when ''/builder build'' is called. When Supply Mode starts the Builder will survey the build site and generate a list of required materials to start building. Players must provide these materials for the builder to begin. <br />
<br />
While in Supply Mode:<br />
* Right-Click the Builder with an empty hand to view the list of materials still needed.<br />
* Right-Click the Builder with any block or item to see if he needs it. If he does, he will tell you how much he still needs.<br />
* After clicking with a needed material, Right-Click again within a few seconds to give it to the Builder. <br />
* After receiving a material the Builder will say how many more blocks he needs in total to begin, or he will begin building if he has everything.<br />
<br />
What materials are required:<br />
*By default all blocks require their normal drop type (i.e. Cobwebs require String)<br />
*This behavior can be overridden via the 'supply.txt' file found in the \Builder folder.<br />
**Each line contains the Item ID of the block in the schematic, and the ItemID of the block/Item that is required.<br />
**Optionally you can specify the number of blocks/items required for each source block.<br />
**Setting the required Item ID to 0 will not include that source block in the requirements.<br />
<br />
{| class="wikitable collapsible collapsed" <br />
! Default Supply Mode configuration<br />
|-<br />
|<pre><br />
Original Block Number:Require Item Number:Amount(Optional)<br />
Set to 0 to never require block. Blocks not specified will require their normal drop item.<br />
90:0<br />
97:0<br />
95:54<br />
78:0<br />
34:0<br />
119:0<br />
80:80<br />
92:354<br />
43:44:2<br />
125:126:2<br />
20:20<br />
102:102<br />
47:47<br />
103:362<br />
130:130<br />
134:53<br />
135:53<br />
136:53<br />
128:67<br />
109:67<br />
108:67<br />
79:332<br />
51:0<br />
59:295<br />
72:70<br />
71:330:0.5<br />
26:335:0.5<br />
</pre><br />
|}<br />
<br />
All blocks are currently matched on Item ID only. This means:<br />
* All Wool is Wool. Color is ignored building the list, and any color wool can be given to fulfill the requirement.<br />
* The same goes for saplings, slabs, logs, and wood planks.<br />
* Stairs are similar. All wood stairs count as 'oak'. All stone/brick stairs count as 'stone' with the exception of nether brick stairs which are separate.<br />
<br />
If the build is canceled at any point, the collected materials are lost.<br />
<br />
==Advanced Usage==<br />
* Builder can be set to run [[Denizen]] Task Scripts on start, completion, or cancellation of a build.<br />
**The NPC must have both the Builder and [[Denizen]] Trait.<br />
**Call <code>/builder build</code> with the optional modifiers <br />
***<code>onstart:TaskName</code><br />
***<code>oncomplete:TaskName</code> <br />
***<code>oncancel:TaskName</code>. <br />
Example:<br />
/builder build oncomplete:DespawnTask oncancel:AnnounceTask<br />
<br />
*Builder can also run [[Denizen Actions]] at the 3 indicated events. Add the following to the NPC's actions:<br />
**"Build Start"<br />
**"Build Complete"<br />
**"Build Cancel"<br />
Example:<br />
<br />
<code><br />
BuilderAssignment:<br />
type: assignment<br />
actions:<br />
on Build Start:<br />
- ANNOUNCE "Let's do this!"<br />
on Build Complete:<br />
- ANNOUNCE "I have finished!"<br />
</code><br />
<br />
For more complex examples with Denizen and Builder see [[Builder/Builder_and_Denizen|Builder and Denizen Examples]]<br />
<br />
==FAQ==<br />
Q: How can I use multiple builders on one project?<br />
<br />
A: You can use up to 4 builders on one project by giving them all the same schematic and origin, but different build patterns. You can also manually split your schematic into multiple parts with WorldEdit or MCEdit.<br />
<br />
Q: How can I make builders go faster?<br />
<br />
A: Use the /builder timeout command to set the max time between blocks. You can also make the builder walk faster with "/npc speed"<br />
<br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Donate to jrbudda]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Builder&diff=5095Builder2016-08-28T04:43:50Z<p>Morphan1: /* Updates */</p>
<hr />
<div>{{Trait<br />
| PICTURE = Builder.png<br />
| AUTHOR = jrbudda<br />
| NAME = Builder<br />
| VERSION = 0.9.1 build 2<br />
| CITIZENSBUILD = [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.16] (Craftbukkit 1.8.7)<br />
| DEVSTATUS = Release<br />
| DEPENDS = None required.<br />
| DOWNLOADLINK = http://ci.citizensnpcs.co/job/Builder/lastSuccessfulBuild/<br />
| DESCRIPTION = Citizens NPCs that build schematics.<br />
}}<br />
<br />
===ATTENTION:===<br />
===The author of this plugin has gone inactive. Currently, this plugin is only being maintained to allow compatibility with new Minecraft updates. The stability and functionality of these builds cannot be promised.===<br />
<br />
'''Builder''' is a Citizens 2.0 [[Characters|character trait]] that gives NPCs the ability to:<br />
* Build MCEdit/Worldedit schematics, block by block.<br />
* Rebuild an area, fixing anything that has been changed.<br />
* Collect the required materials from players before building.<br />
<br />
__TOC__<br />
==Updates==<br />
{{scrollbox|<br />
<br />
'''Builder For CraftBukkit 1.10+''' [http://ci.citizensnpcs.co/job/Builder/14/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9.4''' [http://ci.citizensnpcs.co/job/Builder/13/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9''' [http://ci.citizensnpcs.co/job/Builder/12/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.9''' [http://ci.citizensnpcs.co/job/Builder/10/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.7''' [http://ci.citizensnpcs.co/job/Builder/9/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.3''' [http://ci.citizensnpcs.co/job/Builder/4/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8''' [http://ci.citizensnpcs.co/job/Builder/3/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''v. 0.9.1 build 2''' 6/3/2014 [http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar download]<br />
* Update for craftbukkit 1.7.10<br />
<br />
'''v. 0.9.1''' 6/3/2014 [http://www.sendspace.com/file/646mvv download]<br />
* Update for craftbukkit 1.7.9<br />
<br />
'''v. 0.9.0''' 12/11/2013 [http://www.sendspace.com/file/5q3v9h download]<br />
* Update for craftbukkit 1.7.2<br />
<br />
'''v. 0.8.2''' 9/20/2013 [http://www.sendspace.com/file/3qk2qa download]<br />
* Update for craftbukkit 1.6.4<br />
<br />
'''v. 0.8.1''' 8/8/2013 [http://www.sendspace.com/file/sb8tfc download]<br />
* added ''silent'' build option that suppresses the messages builder sends to the person who started a build.<br />
* Fixed excavate option so it works.<br />
<br />
'''v. 0.8''' 7/29/2013 [http://www.sendspace.com/file/4yhc12 download]<br />
*Builders have gone to engineering school and now support tile entities (chest contents, sign text, skull types, command blocks, etc...)<br />
*Added command /builder origin x,y,z<br />
*Maybe some improvements to memory usage on large schematics.<br />
*Added command block to default list of blocks not needed for supply mode.<br />
*Fix warning at startup.<br />
<br />
'''v. 0.7.2 ''' 7/9/2013 [http://www.sendspace.com/file/imftlv download]<br />
*Compatible with Bukkit 1.6.2<br />
<br />
'''v. 0.7.1 ''' 7/3/2013 [http://www.sendspace.com/file/xkjvbb download]<br />
*Compatible with Bukkit 1.6.1<br />
*Compatible with Denizen .9<br />
<br />
'''v. 0.7 ''' 6/27/2013 [http://www.sendspace.com/file/v7td6n download]<br />
*Supply mode is now customizable<br />
<br />
'''v. 0.6.9 ''' 5/4/2013 [http://www.sendspace.com/file/smy3z8 download]<br />
* Update for craftbukkit 1.5.2<br />
* Properly group new blocks from 1.4.7 and 1.5.x updates.<br />
* Add server-wide setting so that Supply mode requires exact blocks.<br />
<br />
'''v. 0.6.8.1 ''' 3/21/2013 [http://www.sendspace.com/file/nv50m2 download]<br />
* Update for craftbukkit 1.5.1<br />
<br />
'''v. 0.6.8 ''' 3/19/2013 [http://www.sendspace.com/file/x36t95 download]<br />
* Compatibility with cb 1.5, citizens 2.0.8, and Denizen .8<br />
<br />
'''v. 0.6.7 ''' 1/19/2013 [http://www.sendspace.com/file/dwm2gl download]<br />
* Compatibility with cb 1.4.7<br />
<br />
'''v. 0.6.6 final ''' 1/4/2013 [http://www.sendspace.com/file/49vrxe download]<br />
* Use with cb 1.4.6<br />
* Fix persistence bug with needed materials in supply mode and layers build option.<br />
<br />
'''v. 0.6.6b ''' 12/22/2012 [http://www.sendspace.com/file/634eev download]<br />
* Compatibility with CraftBukkit 1.4.6r0.1 and Citizens2 2.0.6.<br />
<br />
'''v. 0.6.5''' 12/20/2012 [http://www.sendspace.com/file/5xpctb download]<br />
* Compatibility with CraftBukkit 1.4.5r1.0 and Citizens2 2.0.5 Release.<br />
<br />
'''v. 0.6.4''' 12/9/2012<br />
* Compatibility with latest craftbukkit 1.4.5 r.03 and citizens2 build 606+.<br />
<br />
'''v. 0.6.3''' 11/30/2012<br />
* Compatible with craftbukkit 1.4.4 - 1.4.5 r0.2 and citizens2 build 597.<br />
* Fix crops/seeds error.<br />
* Accept either type of pressure plate for supply mode.<br />
<br />
'''v. 0.6.2''' 10/29/2012<br />
* Update for cb 1.4.2... with NOT work with 1.3 !<br />
<br />
'''v. 0.6.1''' 10/25/2012<br />
* Final fixes to supply mode. Release of .6<br />
<br />
'''v. 0.6 ALPHA3''' 10/19/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Fixed supply requirement for glass blocks and panes, melon, bookshelves, ender chests, snow, ice, double slabs.<br />
* Changed supply requirement for stairs: all wood stairs count as 'oak wood stairs'. All stone stairs (except nether brick) count as 'stone brick stairs'. This is to match the behavior with slabs.<br />
<br />
'''v. 0.6 ALPHA2''' 10/15/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Added builder.donate permission. This allows players to donate to a builder in supply mode.<br />
* Fix calling ''build'' from the console.<br />
<br />
'''v. 0.6 ALPHA''' 10/14/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* '''Supply Mode''' - Builders can now be set so that players must provide all the materials before the builder will start building. use ''/builder supply true'' to turn this on, then call ''/builder build'' as usual.<br />
** Once build is called the Builder will go into [[#Supply Mode|Supply mode]]. See section for details.<br />
** Only those blocks actually needed will be required (if some are already in place)<br />
** The collected materials will persist if the server is restarted.<br />
** Localized names are used for all items and blocks. (based on server language setting)<br />
** If the build is canceled the collected items are lost.<br />
** Unobtainable blocks are supplied by giving their normal drop type (example: Cobwebs require players to supply String). Please let me know if I missed any.<br />
* Fixed 'mark' and 'schematic origin' sometimes being off by 1 block.<br />
* Moved the 'nohold' build option to its own command: /builder hold true/false<br />
* Added onstart: build option, this will run a Denizen task when the builder starts building (after collecting required materials, if set)<br />
<br />
'''v. 0.5.1 Beta''' 10/4/2012<br />
* Added command /builder list<br />
* Added build option: yoffset<br />
<br />
'''v. 0.5 Beta''' 9/25/2012<br />
* It is highly recommenced you use this with build 382+ of citizens2. 382 has some pathfinding fixes that make high /npc speed settings less... undesirable.<br />
* Builders loaded with the same schematic will share it in memory. Reduces RAM overhead.<br />
* Schematics are now pre-processed right when you call build, this has the following consequences:<br />
** Less memory usage for the to-build list<br />
** /builder info now shows total block count, blocks remaining, and a % complete during the build.<br />
** new command: '''survey''' shows the material list required to build in the current location, taking into account what is already there.<br />
** You may experience a small server hiccup when you call build for VERY large schematics (millions of blocks) Hope to reduce this for the future.<br />
* New command: '''timeout''' sets the maximum time between blocks. Can be set as low as 0.1 seconds. (The fastest possible build speed is about 5 blocks per second.)<br />
<br />
'''v. 0.4.1 Beta''' 9/18/2012<br />
* '''Verical Build options''' you can now specify layers:X to build X number of layers at a time. Significantly speeds up building.<br />
* '''Grouping option''' you can specify groupall to build ALL of one group of materials at a time (instead of doing it at every set of layers)<br />
* added commands: origin me, origin current<br />
* excavate works from the top down, as you would expect.<br />
<br />
'''v. 0.4 Beta''' 9/16/2012<br />
* '''New build order''' Builder now places items in groupings based on item type: base blocks, furniture, redstone, liquids, and decorations. This is done ''per layer'' because I didn't like how it looked building all the layers of one type first. Maybe configurable later.<br />
* '''New build patterns!''' builders can use: spiral, linear, reversespiral or reverselinear (this is for the x-z plane, builders still build from the bottom layer up, 1 layer at a time... for now!) the default is spiral.<br />
*(Okay I'll admit this sort of lets you use up to 4 builders on 1 schematic if they have the same origin and different patterns... but shhh it's our secret :))<br />
* '''Excavate mode!''' builders can optionally dig out the area before building!<br />
* '''Configuration!''' Builder now makes a config.yml that can be used to change the default schematics directory. messages and allowable 'marking' materials.<br />
* Holding items! Player and Endermen-type builders will now hold the item they are about to place, or a pickaxe if breaking blocks.<br />
* Fix mob-type builders, they no longer crash clients because cows can't swing their arms!<br />
* the ignoreliquid and ignoreair commands have been {{color|red|white|removed}} specify these options when calling /builder build.<br />
* Hooked into dynmap to trigger an area render on completion/cancellation of build.<br />
<br />
'''v. 0.3.2 Beta''' 9/13/2012<br />
* Builder will remove previous marks before building or placing new ones.<br />
* Fix skipping first block in schematic.<br />
* Improved error messages an other minor fixes.<br />
* Target Java 6 instead of 7.<br />
<br />
'''v. 0.3.1 Alpha''' 9/12/2012<br />
* Pathing and other minor bugfixes.<br />
* fix /builder mark<br />
* /builder help actually provides help.<br />
<br />
'''v. 0.3 Alpha''' 9/11/2012<br />
* Added Denizen Task script execution option on build completion and cancellation.<br />
* Reduced memory usage of loaded schematics by 80%.<br />
* Last loaded schematic is now persistent.<br />
* Lots of updates to messages and info.<br />
<br />
'''v. 0.2.1 Alpha''' 9/9/2012<br />
* added commands origin clear, origin schematic, check, compare<br />
<br />
'''v. 0.2 Alpha''' 9/9/2012<br />
*Added commands ignoreair, ignoreliquid, origin, info<br />
<br />
'''v. 0.1.1 Alpha''' 9/9/2012<br />
*Added Mark command.<br />
*Better pathing.<br />
<br />
'''v. 0.1 Alpha''' 9/9/2012<br />
* First release<br />
}}<br />
<br />
<!-- THIS SECTION IS BROKEN<br />
{|<br />
{{#ev:youtube|UyAR7-_17XY|}} |{{#ev:youtube|ZiYhFZi5vB0|}} | {{#ev:youtube|HOxX9pb--NQ|}} | {{#ev:youtube|KS4v17Y8xcA|}} <br />
|}<br />
--><br />
<br />
==Installation==<br />
*Install Citizens 2<br />
*Place Builder.jar file in /plugins directory. <br />
*Place .schematic files in /plugins/Builder/schematics/<br />
*Start Server<br />
*Create NPC and give the Builder trait.<br />
/npc create Bob --trait builder<br />
or<br />
/npc create Bob<br />
/trait builder<br />
<br />
==Permissions==<br />
*''builder.*'' Give access to all Builder permissions.<br />
*''builder.[command]'' Give access to [command].<br />
*''builder.donate'' Allows players to donate to a builder in Supply Mode (useful for locking out creative mode players)<br />
<br />
==Configuration==<br />
See [[Builder/Configuration|Configuration]].<br />
<br />
Builder will create ''Builder/config.yml'' if it does not exist already. Be sure to check the configuration page if new options are added.<br />
<br />
==Commands==<br />
All commands can be run on a selected NPC as shown (<code>/builder [command]</code>), or on a target NPC with <code>/builder [npcid] [command]</code>.<br />
<br />
'''/builder list''' - Lists all available schematics in the configured schematics folder. Does not require a builder selected.<br />
<br />
'''/builder load [schematic]''' - Loads a .schematic file. simply use the name of the schematic.<br />
Example<br />
/builder load house<br />
<br />
'''/builder origin''' - Sets the origin of the builder's projects to the builder's current location. Allows you to re-build in the same spot. If this is not set the builder will always start from his current location.<br />
<br />
'''/builder origin clear''' - Clears the saved build origin.<br />
<br />
'''/builder origin schematic''' - Sets the origin of the builder's projects to the origin of the loaded schematic. Best used for schematics created from the builder's world with worldedit.<br />
<br />
'''/builder origin me''' - Sets the origin of the builder's projects to the player's position. Does not work from the console.<br />
<br />
'''/builder origin current''' - Sets the origin of the builder's projects to the origin of the project currently being built. Use this if you forgot to set the origin before starting to build, and need to cancel it to resume later.<br />
<br />
'''/builder origin x,y,z''' - Sets the origin of the builder's projects to the location x,y,z of the builder's current world.<br />
<br />
'''/builder mark (item)''' - Places a block at the 4 corners of the footprint, then returns to the origin, so you can see where it's going to build. You can specify the item to use, although that item must be allowed in the config.yml. The first item on the list in the config is the default if no item is specified. If the config is missing the builder will use GLASS.<br />
<br />
'''/builder timeout [value]''' - Sets the maximum time, in seconds, between blocks. Valid values are 0.1 - 2000000.0. Default is 2.0. Default can be changed in the config.yml.<br />
<br />
'''/builder build (option1) (option2) ... etc''' - Start building the schematic. This command takes several optional arguments. The order does not matter. you can add to this command the following:<br />
*linear - build north to south<br />
*reverselinear - build south to north<br />
*sprial - build inside to outside (this is the default and thus does not need to be specified.)<br />
*reversespiral - build outside to inside.<br />
*excavate - The builder will clear out the area of blocks before starting to place them.<br />
*layers:# - The builder will build # number of layers at a time, the default is 1.<br />
*yoffset:# - The builder will start building the specified number of blocks up or down from the set starting location.<br />
*groupall - the builder will build all of a group of materials at once, instead of doing it per layer.<br />
*ignoreair - the builder will not place air blocks. (Use to build into an existing structure, pointless if used with excavate)<br />
*ignoreliquid - the builder will not place lava or water blocks. (Use if the schematic has unconstrained liquids on the bottom.)<br />
*onstart:Task - the builder will run the [[Denizen]] task script on start of build (after material collection). See [[#Advanced Usage]]<br />
*oncomplete:Task - the builder will run the [[Denizen]] task script on completion of build. See [[#Advanced Usage]]<br />
*oncancel:Task - the builder will run the [[Denizen]] task script on cancellation of build. See [[#Advanced Usage]]<br />
*silent - the builder will not send completion/error messages to the command sender.<br />
<br />
Examples:<br />
/builder build<br />
/builder build excavate reverselinear yoffset:-3<br />
/builder build ignoreair ignoreliquid oncomplete:Celebrate<br />
/builder build groupall layers:3<br />
<br />
'''/builder cancel''' - Cancel a build job.<br />
<br />
'''/builder info''' - View a Builder's loaded schematic name and size, as well as the builder's options and status.<br />
<br />
'''/builder survey (excavate)''' - Display a list of all the block types/count it would require to build at the current location. Specify excavate to show the list of materials if excavation is used. Does not show water or lava.<br />
<br />
'''/builder supply true|false''' set whether the builder will need to be given the materials before he will start building. See [[#Supply Mode]]<br />
<br />
'''/builder hold true|false''' set whether the builder will hold the items he is placing (Turn off only for compatibility with other plugins like [[Sentry]])<br />
<br />
'''/builder reload ''' - reload options from the builder config.yml<br />
<br />
'''/builder help''' - Display the help.<br />
<br />
==Usage==<br />
*.schematic files should be placed in the ''/plugins/Builder/schematics/'' directory. This directory can be configured in the config.yml<br />
* Position the builder, or set the builder's '''origin''', to the ''center'' of the footpoint you want to build before calling '''build'''. The size of the schematic is shown upon load.<br />
* You can cancel a build and resume it later if you have an Origin set. You can use <code> /builder origin current </code> to set the origin after building has started if you forgot.<br />
* Do not try to resume a build with the excavate option!<br />
* The builder will ignore any empty space underneath the schematic object so that it will always rest on the ground where the builder starts. If you want to build above or below the origin, use the yoffset: build option.<br />
* The builder will not attempt to replace blocks that are already set properly, this means you can use a builder to quickly 'restore' any changed blocks in something he has previously built.<br />
**To set up a builder to maintain an existing building:<br />
***Select the building with worldedit and save it as a schematic.<br />
***Copy the schematic to the builder's schematics directory.<br />
***Load the schematic to a builder and call <code> /builder origin schematic</code>.<br />
***Call /builder build and the builder will place any missing blocks or destroy new ones.<br />
*Rail and dispensers my not be placed correctly. (Hey this is Construction, not Engimaneerin'.)<br />
*By default, NPCs despawn when their chunk unloads. This behavior can be changed in the Citizens2 config.yml, and is recommended if you would like builders to continue to work unattended.<br />
<br />
==Supply Mode==<br />
If the Builder is set to require materials for building (with ''/builder supply true''), he will go into Supply Mode when ''/builder build'' is called. When Supply Mode starts the Builder will survey the build site and generate a list of required materials to start building. Players must provide these materials for the builder to begin. <br />
<br />
While in Supply Mode:<br />
* Right-Click the Builder with an empty hand to view the list of materials still needed.<br />
* Right-Click the Builder with any block or item to see if he needs it. If he does, he will tell you how much he still needs.<br />
* After clicking with a needed material, Right-Click again within a few seconds to give it to the Builder. <br />
* After receiving a material the Builder will say how many more blocks he needs in total to begin, or he will begin building if he has everything.<br />
<br />
What materials are required:<br />
*By default all blocks require their normal drop type (i.e. Cobwebs require String)<br />
*This behavior can be overridden via the 'supply.txt' file found in the \Builder folder.<br />
**Each line contains the Item ID of the block in the schematic, and the ItemID of the block/Item that is required.<br />
**Optionally you can specify the number of blocks/items required for each source block.<br />
**Setting the required Item ID to 0 will not include that source block in the requirements.<br />
<br />
{| class="wikitable collapsible collapsed" <br />
! Default Supply Mode configuration<br />
|-<br />
|<pre><br />
Original Block Number:Require Item Number:Amount(Optional)<br />
Set to 0 to never require block. Blocks not specified will require their normal drop item.<br />
90:0<br />
97:0<br />
95:54<br />
78:0<br />
34:0<br />
119:0<br />
80:80<br />
92:354<br />
43:44:2<br />
125:126:2<br />
20:20<br />
102:102<br />
47:47<br />
103:362<br />
130:130<br />
134:53<br />
135:53<br />
136:53<br />
128:67<br />
109:67<br />
108:67<br />
79:332<br />
51:0<br />
59:295<br />
72:70<br />
71:330:0.5<br />
26:335:0.5<br />
</pre><br />
|}<br />
<br />
All blocks are currently matched on Item ID only. This means:<br />
* All Wool is Wool. Color is ignored building the list, and any color wool can be given to fulfill the requirement.<br />
* The same goes for saplings, slabs, logs, and wood planks.<br />
* Stairs are similar. All wood stairs count as 'oak'. All stone/brick stairs count as 'stone' with the exception of nether brick stairs which are separate.<br />
<br />
If the build is canceled at any point, the collected materials are lost.<br />
<br />
==Advanced Usage==<br />
* Builder can be set to run [[Denizen]] Task Scripts on start, completion, or cancellation of a build.<br />
**The NPC must have both the Builder and [[Denizen]] Trait.<br />
**Call <code>/builder build</code> with the optional modifiers <br />
***<code>onstart:TaskName</code><br />
***<code>oncomplete:TaskName</code> <br />
***<code>oncancel:TaskName</code>. <br />
Example:<br />
/builder build oncomplete:DespawnTask oncancel:AnnounceTask<br />
<br />
*Builder can also run [[Denizen Actions]] at the 3 indicated events. Add the following to the NPC's actions:<br />
**"Build Start"<br />
**"Build Complete"<br />
**"Build Cancel"<br />
Example:<br />
<br />
<code><br />
BuilderAssignment:<br />
type: assignment<br />
actions:<br />
on Build Start:<br />
- ANNOUNCE "Let's do this!"<br />
on Build Complete:<br />
- ANNOUNCE "I have finished!"<br />
</code><br />
<br />
For more complex examples with Denizen and Builder see [[Builder/Builder_and_Denizen|Builder and Denizen Examples]]<br />
<br />
==FAQ==<br />
Q: How can I use multiple builders on one project?<br />
<br />
A: You can use up to 4 builders on one project by giving them all the same schematic and origin, but different build patterns. You can also manually split your schematic into multiple parts with WorldEdit or MCEdit.<br />
<br />
Q: How can I make builders go faster?<br />
<br />
A: Use the /builder timeout command to set the max time between blocks. You can also make the builder walk faster with "/npc speed"<br />
<br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Donate to jrbudda]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Builder&diff=5062Builder2015-07-24T09:04:19Z<p>Morphan1: </p>
<hr />
<div>{{Trait<br />
| PICTURE = Builder.png<br />
| AUTHOR = jrbudda<br />
| NAME = Builder<br />
| VERSION = 0.9.1 build 2<br />
| CITIZENSBUILD = [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.16] (Craftbukkit 1.8.7)<br />
| DEVSTATUS = Release<br />
| DEPENDS = None required.<br />
| DOWNLOADLINK = http://ci.citizensnpcs.co/job/Builder/lastSuccessfulBuild/<br />
| DESCRIPTION = Citizens NPCs that build schematics.<br />
}}<br />
<br />
===ATTENTION:===<br />
===The author of this plugin has gone inactive. Currently, this plugin is only being maintained to allow compatibility with new Minecraft updates. The stability and functionality of these builds cannot be promised.===<br />
<br />
'''Builder''' is a Citizens 2.0 [[Characters|character trait]] that gives NPCs the ability to:<br />
* Build MCEdit/Worldedit schematics, block by block.<br />
* Rebuild an area, fixing anything that has been changed.<br />
* Collect the required materials from players before building.<br />
<br />
__TOC__<br />
==Updates==<br />
{{scrollbox|<br />
<br />
'''Builder For CraftBukkit 1.8.7''' [http://ci.citizensnpcs.co/job/Builder/9/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.3''' [http://ci.citizensnpcs.co/job/Builder/4/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8''' [http://ci.citizensnpcs.co/job/Builder/3/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''v. 0.9.1 build 2''' 6/3/2014 [http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar download]<br />
* Update for craftbukkit 1.7.10<br />
<br />
'''v. 0.9.1''' 6/3/2014 [http://www.sendspace.com/file/646mvv download]<br />
* Update for craftbukkit 1.7.9<br />
<br />
'''v. 0.9.0''' 12/11/2013 [http://www.sendspace.com/file/5q3v9h download]<br />
* Update for craftbukkit 1.7.2<br />
<br />
'''v. 0.8.2''' 9/20/2013 [http://www.sendspace.com/file/3qk2qa download]<br />
* Update for craftbukkit 1.6.4<br />
<br />
'''v. 0.8.1''' 8/8/2013 [http://www.sendspace.com/file/sb8tfc download]<br />
* added ''silent'' build option that suppresses the messages builder sends to the person who started a build.<br />
* Fixed excavate option so it works.<br />
<br />
'''v. 0.8''' 7/29/2013 [http://www.sendspace.com/file/4yhc12 download]<br />
*Builders have gone to engineering school and now support tile entities (chest contents, sign text, skull types, command blocks, etc...)<br />
*Added command /builder origin x,y,z<br />
*Maybe some improvements to memory usage on large schematics.<br />
*Added command block to default list of blocks not needed for supply mode.<br />
*Fix warning at startup.<br />
<br />
'''v. 0.7.2 ''' 7/9/2013 [http://www.sendspace.com/file/imftlv download]<br />
*Compatible with Bukkit 1.6.2<br />
<br />
'''v. 0.7.1 ''' 7/3/2013 [http://www.sendspace.com/file/xkjvbb download]<br />
*Compatible with Bukkit 1.6.1<br />
*Compatible with Denizen .9<br />
<br />
'''v. 0.7 ''' 6/27/2013 [http://www.sendspace.com/file/v7td6n download]<br />
*Supply mode is now customizable<br />
<br />
'''v. 0.6.9 ''' 5/4/2013 [http://www.sendspace.com/file/smy3z8 download]<br />
* Update for craftbukkit 1.5.2<br />
* Properly group new blocks from 1.4.7 and 1.5.x updates.<br />
* Add server-wide setting so that Supply mode requires exact blocks.<br />
<br />
'''v. 0.6.8.1 ''' 3/21/2013 [http://www.sendspace.com/file/nv50m2 download]<br />
* Update for craftbukkit 1.5.1<br />
<br />
'''v. 0.6.8 ''' 3/19/2013 [http://www.sendspace.com/file/x36t95 download]<br />
* Compatibility with cb 1.5, citizens 2.0.8, and Denizen .8<br />
<br />
'''v. 0.6.7 ''' 1/19/2013 [http://www.sendspace.com/file/dwm2gl download]<br />
* Compatibility with cb 1.4.7<br />
<br />
'''v. 0.6.6 final ''' 1/4/2013 [http://www.sendspace.com/file/49vrxe download]<br />
* Use with cb 1.4.6<br />
* Fix persistence bug with needed materials in supply mode and layers build option.<br />
<br />
'''v. 0.6.6b ''' 12/22/2012 [http://www.sendspace.com/file/634eev download]<br />
* Compatibility with CraftBukkit 1.4.6r0.1 and Citizens2 2.0.6.<br />
<br />
'''v. 0.6.5''' 12/20/2012 [http://www.sendspace.com/file/5xpctb download]<br />
* Compatibility with CraftBukkit 1.4.5r1.0 and Citizens2 2.0.5 Release.<br />
<br />
'''v. 0.6.4''' 12/9/2012<br />
* Compatibility with latest craftbukkit 1.4.5 r.03 and citizens2 build 606+.<br />
<br />
'''v. 0.6.3''' 11/30/2012<br />
* Compatible with craftbukkit 1.4.4 - 1.4.5 r0.2 and citizens2 build 597.<br />
* Fix crops/seeds error.<br />
* Accept either type of pressure plate for supply mode.<br />
<br />
'''v. 0.6.2''' 10/29/2012<br />
* Update for cb 1.4.2... with NOT work with 1.3 !<br />
<br />
'''v. 0.6.1''' 10/25/2012<br />
* Final fixes to supply mode. Release of .6<br />
<br />
'''v. 0.6 ALPHA3''' 10/19/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Fixed supply requirement for glass blocks and panes, melon, bookshelves, ender chests, snow, ice, double slabs.<br />
* Changed supply requirement for stairs: all wood stairs count as 'oak wood stairs'. All stone stairs (except nether brick) count as 'stone brick stairs'. This is to match the behavior with slabs.<br />
<br />
'''v. 0.6 ALPHA2''' 10/15/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Added builder.donate permission. This allows players to donate to a builder in supply mode.<br />
* Fix calling ''build'' from the console.<br />
<br />
'''v. 0.6 ALPHA''' 10/14/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* '''Supply Mode''' - Builders can now be set so that players must provide all the materials before the builder will start building. use ''/builder supply true'' to turn this on, then call ''/builder build'' as usual.<br />
** Once build is called the Builder will go into [[#Supply Mode|Supply mode]]. See section for details.<br />
** Only those blocks actually needed will be required (if some are already in place)<br />
** The collected materials will persist if the server is restarted.<br />
** Localized names are used for all items and blocks. (based on server language setting)<br />
** If the build is canceled the collected items are lost.<br />
** Unobtainable blocks are supplied by giving their normal drop type (example: Cobwebs require players to supply String). Please let me know if I missed any.<br />
* Fixed 'mark' and 'schematic origin' sometimes being off by 1 block.<br />
* Moved the 'nohold' build option to its own command: /builder hold true/false<br />
* Added onstart: build option, this will run a Denizen task when the builder starts building (after collecting required materials, if set)<br />
<br />
'''v. 0.5.1 Beta''' 10/4/2012<br />
* Added command /builder list<br />
* Added build option: yoffset<br />
<br />
'''v. 0.5 Beta''' 9/25/2012<br />
* It is highly recommenced you use this with build 382+ of citizens2. 382 has some pathfinding fixes that make high /npc speed settings less... undesirable.<br />
* Builders loaded with the same schematic will share it in memory. Reduces RAM overhead.<br />
* Schematics are now pre-processed right when you call build, this has the following consequences:<br />
** Less memory usage for the to-build list<br />
** /builder info now shows total block count, blocks remaining, and a % complete during the build.<br />
** new command: '''survey''' shows the material list required to build in the current location, taking into account what is already there.<br />
** You may experience a small server hiccup when you call build for VERY large schematics (millions of blocks) Hope to reduce this for the future.<br />
* New command: '''timeout''' sets the maximum time between blocks. Can be set as low as 0.1 seconds. (The fastest possible build speed is about 5 blocks per second.)<br />
<br />
'''v. 0.4.1 Beta''' 9/18/2012<br />
* '''Verical Build options''' you can now specify layers:X to build X number of layers at a time. Significantly speeds up building.<br />
* '''Grouping option''' you can specify groupall to build ALL of one group of materials at a time (instead of doing it at every set of layers)<br />
* added commands: origin me, origin current<br />
* excavate works from the top down, as you would expect.<br />
<br />
'''v. 0.4 Beta''' 9/16/2012<br />
* '''New build order''' Builder now places items in groupings based on item type: base blocks, furniture, redstone, liquids, and decorations. This is done ''per layer'' because I didn't like how it looked building all the layers of one type first. Maybe configurable later.<br />
* '''New build patterns!''' builders can use: spiral, linear, reversespiral or reverselinear (this is for the x-z plane, builders still build from the bottom layer up, 1 layer at a time... for now!) the default is spiral.<br />
*(Okay I'll admit this sort of lets you use up to 4 builders on 1 schematic if they have the same origin and different patterns... but shhh it's our secret :))<br />
* '''Excavate mode!''' builders can optionally dig out the area before building!<br />
* '''Configuration!''' Builder now makes a config.yml that can be used to change the default schematics directory. messages and allowable 'marking' materials.<br />
* Holding items! Player and Endermen-type builders will now hold the item they are about to place, or a pickaxe if breaking blocks.<br />
* Fix mob-type builders, they no longer crash clients because cows can't swing their arms!<br />
* the ignoreliquid and ignoreair commands have been {{color|red|white|removed}} specify these options when calling /builder build.<br />
* Hooked into dynmap to trigger an area render on completion/cancellation of build.<br />
<br />
'''v. 0.3.2 Beta''' 9/13/2012<br />
* Builder will remove previous marks before building or placing new ones.<br />
* Fix skipping first block in schematic.<br />
* Improved error messages an other minor fixes.<br />
* Target Java 6 instead of 7.<br />
<br />
'''v. 0.3.1 Alpha''' 9/12/2012<br />
* Pathing and other minor bugfixes.<br />
* fix /builder mark<br />
* /builder help actually provides help.<br />
<br />
'''v. 0.3 Alpha''' 9/11/2012<br />
* Added Denizen Task script execution option on build completion and cancellation.<br />
* Reduced memory usage of loaded schematics by 80%.<br />
* Last loaded schematic is now persistent.<br />
* Lots of updates to messages and info.<br />
<br />
'''v. 0.2.1 Alpha''' 9/9/2012<br />
* added commands origin clear, origin schematic, check, compare<br />
<br />
'''v. 0.2 Alpha''' 9/9/2012<br />
*Added commands ignoreair, ignoreliquid, origin, info<br />
<br />
'''v. 0.1.1 Alpha''' 9/9/2012<br />
*Added Mark command.<br />
*Better pathing.<br />
<br />
'''v. 0.1 Alpha''' 9/9/2012<br />
* First release<br />
}}<br />
<br />
<!-- THIS SECTION IS BROKEN<br />
{|<br />
{{#ev:youtube|UyAR7-_17XY|}} |{{#ev:youtube|ZiYhFZi5vB0|}} | {{#ev:youtube|HOxX9pb--NQ|}} | {{#ev:youtube|KS4v17Y8xcA|}} <br />
|}<br />
--><br />
<br />
==Installation==<br />
*Install Citizens 2<br />
*Place Builder.jar file in /plugins directory. <br />
*Place .schematic files in /plugins/Builder/schematics/<br />
*Start Server<br />
*Create NPC and give the Builder trait.<br />
/npc create Bob --trait builder<br />
or<br />
/npc create Bob<br />
/trait builder<br />
<br />
==Permissions==<br />
*''builder.*'' Give access to all Builder permissions.<br />
*''builder.[command]'' Give access to [command].<br />
*''builder.donate'' Allows players to donate to a builder in Supply Mode (useful for locking out creative mode players)<br />
<br />
==Configuration==<br />
See [[Builder/Configuration|Configuration]].<br />
<br />
Builder will create ''Builder/config.yml'' if it does not exist already. Be sure to check the configuration page if new options are added.<br />
<br />
==Commands==<br />
All commands can be run on a selected NPC as shown (<code>/builder [command]</code>), or on a target NPC with <code>/builder [npcid] [command]</code>.<br />
<br />
'''/builder list''' - Lists all available schematics in the configured schematics folder. Does not require a builder selected.<br />
<br />
'''/builder load [schematic]''' - Loads a .schematic file. simply use the name of the schematic.<br />
Example<br />
/builder load house<br />
<br />
'''/builder origin''' - Sets the origin of the builder's projects to the builder's current location. Allows you to re-build in the same spot. If this is not set the builder will always start from his current location.<br />
<br />
'''/builder origin clear''' - Clears the saved build origin.<br />
<br />
'''/builder origin schematic''' - Sets the origin of the builder's projects to the origin of the loaded schematic. Best used for schematics created from the builder's world with worldedit.<br />
<br />
'''/builder origin me''' - Sets the origin of the builder's projects to the player's position. Does not work from the console.<br />
<br />
'''/builder origin current''' - Sets the origin of the builder's projects to the origin of the project currently being built. Use this if you forgot to set the origin before starting to build, and need to cancel it to resume later.<br />
<br />
'''/builder origin x,y,z''' - Sets the origin of the builder's projects to the location x,y,z of the builder's current world.<br />
<br />
'''/builder mark (item)''' - Places a block at the 4 corners of the footprint, then returns to the origin, so you can see where it's going to build. You can specify the item to use, although that item must be allowed in the config.yml. The first item on the list in the config is the default if no item is specified. If the config is missing the builder will use GLASS.<br />
<br />
'''/builder timeout [value]''' - Sets the maximum time, in seconds, between blocks. Valid values are 0.1 - 2000000.0. Default is 2.0. Default can be changed in the config.yml.<br />
<br />
'''/builder build (option1) (option2) ... etc''' - Start building the schematic. This command takes several optional arguments. The order does not matter. you can add to this command the following:<br />
*linear - build north to south<br />
*reverselinear - build south to north<br />
*sprial - build inside to outside (this is the default and thus does not need to be specified.)<br />
*reversespiral - build outside to inside.<br />
*excavate - The builder will clear out the area of blocks before starting to place them.<br />
*layers:# - The builder will build # number of layers at a time, the default is 1.<br />
*yoffset:# - The builder will start building the specified number of blocks up or down from the set starting location.<br />
*groupall - the builder will build all of a group of materials at once, instead of doing it per layer.<br />
*ignoreair - the builder will not place air blocks. (Use to build into an existing structure, pointless if used with excavate)<br />
*ignoreliquid - the builder will not place lava or water blocks. (Use if the schematic has unconstrained liquids on the bottom.)<br />
*onstart:Task - the builder will run the [[Denizen]] task script on start of build (after material collection). See [[#Advanced Usage]]<br />
*oncomplete:Task - the builder will run the [[Denizen]] task script on completion of build. See [[#Advanced Usage]]<br />
*oncancel:Task - the builder will run the [[Denizen]] task script on cancellation of build. See [[#Advanced Usage]]<br />
*silent - the builder will not send completion/error messages to the command sender.<br />
<br />
Examples:<br />
/builder build<br />
/builder build excavate reverselinear yoffset:-3<br />
/builder build ignoreair ignoreliquid oncomplete:Celebrate<br />
/builder build groupall layers:3<br />
<br />
'''/builder cancel''' - Cancel a build job.<br />
<br />
'''/builder info''' - View a Builder's loaded schematic name and size, as well as the builder's options and status.<br />
<br />
'''/builder survey (excavate)''' - Display a list of all the block types/count it would require to build at the current location. Specify excavate to show the list of materials if excavation is used. Does not show water or lava.<br />
<br />
'''/builder supply true|false''' set whether the builder will need to be given the materials before he will start building. See [[#Supply Mode]]<br />
<br />
'''/builder hold true|false''' set whether the builder will hold the items he is placing (Turn off only for compatibility with other plugins like [[Sentry]])<br />
<br />
'''/builder reload ''' - reload options from the builder config.yml<br />
<br />
'''/builder help''' - Display the help.<br />
<br />
==Usage==<br />
*.schematic files should be placed in the ''/plugins/Builder/schematics/'' directory. This directory can be configured in the config.yml<br />
* Position the builder, or set the builder's '''origin''', to the ''center'' of the footpoint you want to build before calling '''build'''. The size of the schematic is shown upon load.<br />
* You can cancel a build and resume it later if you have an Origin set. You can use <code> /builder origin current </code> to set the origin after building has started if you forgot.<br />
* Do not try to resume a build with the excavate option!<br />
* The builder will ignore any empty space underneath the schematic object so that it will always rest on the ground where the builder starts. If you want to build above or below the origin, use the yoffset: build option.<br />
* The builder will not attempt to replace blocks that are already set properly, this means you can use a builder to quickly 'restore' any changed blocks in something he has previously built.<br />
**To set up a builder to maintain an existing building:<br />
***Select the building with worldedit and save it as a schematic.<br />
***Copy the schematic to the builder's schematics directory.<br />
***Load the schematic to a builder and call <code> /builder origin schematic</code>.<br />
***Call /builder build and the builder will place any missing blocks or destroy new ones.<br />
*Rail and dispensers my not be placed correctly. (Hey this is Construction, not Engimaneerin'.)<br />
*By default, NPCs despawn when their chunk unloads. This behavior can be changed in the Citizens2 config.yml, and is recommended if you would like builders to continue to work unattended.<br />
<br />
==Supply Mode==<br />
If the Builder is set to require materials for building (with ''/builder supply true''), he will go into Supply Mode when ''/builder build'' is called. When Supply Mode starts the Builder will survey the build site and generate a list of required materials to start building. Players must provide these materials for the builder to begin. <br />
<br />
While in Supply Mode:<br />
* Right-Click the Builder with an empty hand to view the list of materials still needed.<br />
* Right-Click the Builder with any block or item to see if he needs it. If he does, he will tell you how much he still needs.<br />
* After clicking with a needed material, Right-Click again within a few seconds to give it to the Builder. <br />
* After receiving a material the Builder will say how many more blocks he needs in total to begin, or he will begin building if he has everything.<br />
<br />
What materials are required:<br />
*By default all blocks require their normal drop type (i.e. Cobwebs require String)<br />
*This behavior can be overridden via the 'supply.txt' file found in the \Builder folder.<br />
**Each line contains the Item ID of the block in the schematic, and the ItemID of the block/Item that is required.<br />
**Optionally you can specify the number of blocks/items required for each source block.<br />
**Setting the required Item ID to 0 will not include that source block in the requirements.<br />
<br />
{| class="wikitable collapsible collapsed" <br />
! Default Supply Mode configuration<br />
|-<br />
|<pre><br />
Original Block Number:Require Item Number:Amount(Optional)<br />
Set to 0 to never require block. Blocks not specified will require their normal drop item.<br />
90:0<br />
97:0<br />
95:54<br />
78:0<br />
34:0<br />
119:0<br />
80:80<br />
92:354<br />
43:44:2<br />
125:126:2<br />
20:20<br />
102:102<br />
47:47<br />
103:362<br />
130:130<br />
134:53<br />
135:53<br />
136:53<br />
128:67<br />
109:67<br />
108:67<br />
79:332<br />
51:0<br />
59:295<br />
72:70<br />
71:330:0.5<br />
26:335:0.5<br />
</pre><br />
|}<br />
<br />
All blocks are currently matched on Item ID only. This means:<br />
* All Wool is Wool. Color is ignored building the list, and any color wool can be given to fulfill the requirement.<br />
* The same goes for saplings, slabs, logs, and wood planks.<br />
* Stairs are similar. All wood stairs count as 'oak'. All stone/brick stairs count as 'stone' with the exception of nether brick stairs which are separate.<br />
<br />
If the build is canceled at any point, the collected materials are lost.<br />
<br />
==Advanced Usage==<br />
* Builder can be set to run [[Denizen]] Task Scripts on start, completion, or cancellation of a build.<br />
**The NPC must have both the Builder and [[Denizen]] Trait.<br />
**Call <code>/builder build</code> with the optional modifiers <br />
***<code>onstart:TaskName</code><br />
***<code>oncomplete:TaskName</code> <br />
***<code>oncancel:TaskName</code>. <br />
Example:<br />
/builder build oncomplete:DespawnTask oncancel:AnnounceTask<br />
<br />
*Builder can also run [[Denizen Actions]] at the 3 indicated events. Add the following to the NPC's actions:<br />
**"Build Start"<br />
**"Build Complete"<br />
**"Build Cancel"<br />
Example:<br />
<br />
<code><br />
BuilderAssignment:<br />
type: assignment<br />
actions:<br />
on Build Start:<br />
- ANNOUNCE "Let's do this!"<br />
on Build Complete:<br />
- ANNOUNCE "I have finished!"<br />
</code><br />
<br />
For more complex examples with Denizen and Builder see [[Builder/Builder_and_Denizen|Builder and Denizen Examples]]<br />
<br />
==FAQ==<br />
Q: How can I use multiple builders on one project?<br />
<br />
A: You can use up to 4 builders on one project by giving them all the same schematic and origin, but different build patterns. You can also manually split your schematic into multiple parts with WorldEdit or MCEdit.<br />
<br />
Q: How can I make builders go faster?<br />
<br />
A: Use the /builder timeout command to set the max time between blocks. You can also make the builder walk faster with "/npc speed"<br />
<br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Donate to jrbudda]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Builder&diff=5061Builder2015-07-24T08:58:04Z<p>Morphan1: </p>
<hr />
<div>{{Trait<br />
| PICTURE = Builder.png<br />
| AUTHOR = jrbudda<br />
| NAME = Builder<br />
| VERSION = 0.9.1 build 2<br />
| CITIZENSBUILD = [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.13] (Craftbukkit 1.7.10)<br />
| DEVSTATUS = Release<br />
| DEPENDS = None required.<br />
| DOWNLOADLINK = http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar<br />
| DESCRIPTION = Citizens NPCs that build schematics.<br />
}}<br />
<br />
'''Builder''' is a Citizens 2.0 [[Characters|character trait]] that gives NPCs the ability to:<br />
* Build MCEdit/Worldedit schematics, block by block.<br />
* Rebuild an area, fixing anything that has been changed.<br />
* Collect the required materials from players before building.<br />
<br />
__TOC__<br />
==Updates==<br />
{{scrollbox|<br />
<br />
'''Builder For CraftBukkit 1.8.7''' [http://ci.citizensnpcs.co/job/Builder/9/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8.3''' [http://ci.citizensnpcs.co/job/Builder/4/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''Builder For CraftBukkit 1.8''' [http://ci.citizensnpcs.co/job/Builder/3/artifact/target/Builder.jar download]<br />
* NMS update by Morphan1<br />
<br />
'''v. 0.9.1 build 2''' 6/3/2014 [http://ci.citizensnpcs.co/job/Builder/2/artifact/target/Builder.jar download]<br />
* Update for craftbukkit 1.7.10<br />
<br />
'''v. 0.9.1''' 6/3/2014 [http://www.sendspace.com/file/646mvv download]<br />
* Update for craftbukkit 1.7.9<br />
<br />
'''v. 0.9.0''' 12/11/2013 [http://www.sendspace.com/file/5q3v9h download]<br />
* Update for craftbukkit 1.7.2<br />
<br />
'''v. 0.8.2''' 9/20/2013 [http://www.sendspace.com/file/3qk2qa download]<br />
* Update for craftbukkit 1.6.4<br />
<br />
'''v. 0.8.1''' 8/8/2013 [http://www.sendspace.com/file/sb8tfc download]<br />
* added ''silent'' build option that suppresses the messages builder sends to the person who started a build.<br />
* Fixed excavate option so it works.<br />
<br />
'''v. 0.8''' 7/29/2013 [http://www.sendspace.com/file/4yhc12 download]<br />
*Builders have gone to engineering school and now support tile entities (chest contents, sign text, skull types, command blocks, etc...)<br />
*Added command /builder origin x,y,z<br />
*Maybe some improvements to memory usage on large schematics.<br />
*Added command block to default list of blocks not needed for supply mode.<br />
*Fix warning at startup.<br />
<br />
'''v. 0.7.2 ''' 7/9/2013 [http://www.sendspace.com/file/imftlv download]<br />
*Compatible with Bukkit 1.6.2<br />
<br />
'''v. 0.7.1 ''' 7/3/2013 [http://www.sendspace.com/file/xkjvbb download]<br />
*Compatible with Bukkit 1.6.1<br />
*Compatible with Denizen .9<br />
<br />
'''v. 0.7 ''' 6/27/2013 [http://www.sendspace.com/file/v7td6n download]<br />
*Supply mode is now customizable<br />
<br />
'''v. 0.6.9 ''' 5/4/2013 [http://www.sendspace.com/file/smy3z8 download]<br />
* Update for craftbukkit 1.5.2<br />
* Properly group new blocks from 1.4.7 and 1.5.x updates.<br />
* Add server-wide setting so that Supply mode requires exact blocks.<br />
<br />
'''v. 0.6.8.1 ''' 3/21/2013 [http://www.sendspace.com/file/nv50m2 download]<br />
* Update for craftbukkit 1.5.1<br />
<br />
'''v. 0.6.8 ''' 3/19/2013 [http://www.sendspace.com/file/x36t95 download]<br />
* Compatibility with cb 1.5, citizens 2.0.8, and Denizen .8<br />
<br />
'''v. 0.6.7 ''' 1/19/2013 [http://www.sendspace.com/file/dwm2gl download]<br />
* Compatibility with cb 1.4.7<br />
<br />
'''v. 0.6.6 final ''' 1/4/2013 [http://www.sendspace.com/file/49vrxe download]<br />
* Use with cb 1.4.6<br />
* Fix persistence bug with needed materials in supply mode and layers build option.<br />
<br />
'''v. 0.6.6b ''' 12/22/2012 [http://www.sendspace.com/file/634eev download]<br />
* Compatibility with CraftBukkit 1.4.6r0.1 and Citizens2 2.0.6.<br />
<br />
'''v. 0.6.5''' 12/20/2012 [http://www.sendspace.com/file/5xpctb download]<br />
* Compatibility with CraftBukkit 1.4.5r1.0 and Citizens2 2.0.5 Release.<br />
<br />
'''v. 0.6.4''' 12/9/2012<br />
* Compatibility with latest craftbukkit 1.4.5 r.03 and citizens2 build 606+.<br />
<br />
'''v. 0.6.3''' 11/30/2012<br />
* Compatible with craftbukkit 1.4.4 - 1.4.5 r0.2 and citizens2 build 597.<br />
* Fix crops/seeds error.<br />
* Accept either type of pressure plate for supply mode.<br />
<br />
'''v. 0.6.2''' 10/29/2012<br />
* Update for cb 1.4.2... with NOT work with 1.3 !<br />
<br />
'''v. 0.6.1''' 10/25/2012<br />
* Final fixes to supply mode. Release of .6<br />
<br />
'''v. 0.6 ALPHA3''' 10/19/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Fixed supply requirement for glass blocks and panes, melon, bookshelves, ender chests, snow, ice, double slabs.<br />
* Changed supply requirement for stairs: all wood stairs count as 'oak wood stairs'. All stone stairs (except nether brick) count as 'stone brick stairs'. This is to match the behavior with slabs.<br />
<br />
'''v. 0.6 ALPHA2''' 10/15/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* Added builder.donate permission. This allows players to donate to a builder in supply mode.<br />
* Fix calling ''build'' from the console.<br />
<br />
'''v. 0.6 ALPHA''' 10/14/2012 {{color|green|white| This is a test release to ferret out any oddities in Supply Mode, please let me know if it doesn't work like it should}}<br />
* '''Supply Mode''' - Builders can now be set so that players must provide all the materials before the builder will start building. use ''/builder supply true'' to turn this on, then call ''/builder build'' as usual.<br />
** Once build is called the Builder will go into [[#Supply Mode|Supply mode]]. See section for details.<br />
** Only those blocks actually needed will be required (if some are already in place)<br />
** The collected materials will persist if the server is restarted.<br />
** Localized names are used for all items and blocks. (based on server language setting)<br />
** If the build is canceled the collected items are lost.<br />
** Unobtainable blocks are supplied by giving their normal drop type (example: Cobwebs require players to supply String). Please let me know if I missed any.<br />
* Fixed 'mark' and 'schematic origin' sometimes being off by 1 block.<br />
* Moved the 'nohold' build option to its own command: /builder hold true/false<br />
* Added onstart: build option, this will run a Denizen task when the builder starts building (after collecting required materials, if set)<br />
<br />
'''v. 0.5.1 Beta''' 10/4/2012<br />
* Added command /builder list<br />
* Added build option: yoffset<br />
<br />
'''v. 0.5 Beta''' 9/25/2012<br />
* It is highly recommenced you use this with build 382+ of citizens2. 382 has some pathfinding fixes that make high /npc speed settings less... undesirable.<br />
* Builders loaded with the same schematic will share it in memory. Reduces RAM overhead.<br />
* Schematics are now pre-processed right when you call build, this has the following consequences:<br />
** Less memory usage for the to-build list<br />
** /builder info now shows total block count, blocks remaining, and a % complete during the build.<br />
** new command: '''survey''' shows the material list required to build in the current location, taking into account what is already there.<br />
** You may experience a small server hiccup when you call build for VERY large schematics (millions of blocks) Hope to reduce this for the future.<br />
* New command: '''timeout''' sets the maximum time between blocks. Can be set as low as 0.1 seconds. (The fastest possible build speed is about 5 blocks per second.)<br />
<br />
'''v. 0.4.1 Beta''' 9/18/2012<br />
* '''Verical Build options''' you can now specify layers:X to build X number of layers at a time. Significantly speeds up building.<br />
* '''Grouping option''' you can specify groupall to build ALL of one group of materials at a time (instead of doing it at every set of layers)<br />
* added commands: origin me, origin current<br />
* excavate works from the top down, as you would expect.<br />
<br />
'''v. 0.4 Beta''' 9/16/2012<br />
* '''New build order''' Builder now places items in groupings based on item type: base blocks, furniture, redstone, liquids, and decorations. This is done ''per layer'' because I didn't like how it looked building all the layers of one type first. Maybe configurable later.<br />
* '''New build patterns!''' builders can use: spiral, linear, reversespiral or reverselinear (this is for the x-z plane, builders still build from the bottom layer up, 1 layer at a time... for now!) the default is spiral.<br />
*(Okay I'll admit this sort of lets you use up to 4 builders on 1 schematic if they have the same origin and different patterns... but shhh it's our secret :))<br />
* '''Excavate mode!''' builders can optionally dig out the area before building!<br />
* '''Configuration!''' Builder now makes a config.yml that can be used to change the default schematics directory. messages and allowable 'marking' materials.<br />
* Holding items! Player and Endermen-type builders will now hold the item they are about to place, or a pickaxe if breaking blocks.<br />
* Fix mob-type builders, they no longer crash clients because cows can't swing their arms!<br />
* the ignoreliquid and ignoreair commands have been {{color|red|white|removed}} specify these options when calling /builder build.<br />
* Hooked into dynmap to trigger an area render on completion/cancellation of build.<br />
<br />
'''v. 0.3.2 Beta''' 9/13/2012<br />
* Builder will remove previous marks before building or placing new ones.<br />
* Fix skipping first block in schematic.<br />
* Improved error messages an other minor fixes.<br />
* Target Java 6 instead of 7.<br />
<br />
'''v. 0.3.1 Alpha''' 9/12/2012<br />
* Pathing and other minor bugfixes.<br />
* fix /builder mark<br />
* /builder help actually provides help.<br />
<br />
'''v. 0.3 Alpha''' 9/11/2012<br />
* Added Denizen Task script execution option on build completion and cancellation.<br />
* Reduced memory usage of loaded schematics by 80%.<br />
* Last loaded schematic is now persistent.<br />
* Lots of updates to messages and info.<br />
<br />
'''v. 0.2.1 Alpha''' 9/9/2012<br />
* added commands origin clear, origin schematic, check, compare<br />
<br />
'''v. 0.2 Alpha''' 9/9/2012<br />
*Added commands ignoreair, ignoreliquid, origin, info<br />
<br />
'''v. 0.1.1 Alpha''' 9/9/2012<br />
*Added Mark command.<br />
*Better pathing.<br />
<br />
'''v. 0.1 Alpha''' 9/9/2012<br />
* First release<br />
}}<br />
<br />
<!-- THIS SECTION IS BROKEN<br />
{|<br />
{{#ev:youtube|UyAR7-_17XY|}} |{{#ev:youtube|ZiYhFZi5vB0|}} | {{#ev:youtube|HOxX9pb--NQ|}} | {{#ev:youtube|KS4v17Y8xcA|}} <br />
|}<br />
--><br />
<br />
==Installation==<br />
*Install Citizens 2<br />
*Place Builder.jar file in /plugins directory. <br />
*Place .schematic files in /plugins/Builder/schematics/<br />
*Start Server<br />
*Create NPC and give the Builder trait.<br />
/npc create Bob --trait builder<br />
or<br />
/npc create Bob<br />
/trait builder<br />
<br />
==Permissions==<br />
*''builder.*'' Give access to all Builder permissions.<br />
*''builder.[command]'' Give access to [command].<br />
*''builder.donate'' Allows players to donate to a builder in Supply Mode (useful for locking out creative mode players)<br />
<br />
==Configuration==<br />
See [[Builder/Configuration|Configuration]].<br />
<br />
Builder will create ''Builder/config.yml'' if it does not exist already. Be sure to check the configuration page if new options are added.<br />
<br />
==Commands==<br />
All commands can be run on a selected NPC as shown (<code>/builder [command]</code>), or on a target NPC with <code>/builder [npcid] [command]</code>.<br />
<br />
'''/builder list''' - Lists all available schematics in the configured schematics folder. Does not require a builder selected.<br />
<br />
'''/builder load [schematic]''' - Loads a .schematic file. simply use the name of the schematic.<br />
Example<br />
/builder load house<br />
<br />
'''/builder origin''' - Sets the origin of the builder's projects to the builder's current location. Allows you to re-build in the same spot. If this is not set the builder will always start from his current location.<br />
<br />
'''/builder origin clear''' - Clears the saved build origin.<br />
<br />
'''/builder origin schematic''' - Sets the origin of the builder's projects to the origin of the loaded schematic. Best used for schematics created from the builder's world with worldedit.<br />
<br />
'''/builder origin me''' - Sets the origin of the builder's projects to the player's position. Does not work from the console.<br />
<br />
'''/builder origin current''' - Sets the origin of the builder's projects to the origin of the project currently being built. Use this if you forgot to set the origin before starting to build, and need to cancel it to resume later.<br />
<br />
'''/builder origin x,y,z''' - Sets the origin of the builder's projects to the location x,y,z of the builder's current world.<br />
<br />
'''/builder mark (item)''' - Places a block at the 4 corners of the footprint, then returns to the origin, so you can see where it's going to build. You can specify the item to use, although that item must be allowed in the config.yml. The first item on the list in the config is the default if no item is specified. If the config is missing the builder will use GLASS.<br />
<br />
'''/builder timeout [value]''' - Sets the maximum time, in seconds, between blocks. Valid values are 0.1 - 2000000.0. Default is 2.0. Default can be changed in the config.yml.<br />
<br />
'''/builder build (option1) (option2) ... etc''' - Start building the schematic. This command takes several optional arguments. The order does not matter. you can add to this command the following:<br />
*linear - build north to south<br />
*reverselinear - build south to north<br />
*sprial - build inside to outside (this is the default and thus does not need to be specified.)<br />
*reversespiral - build outside to inside.<br />
*excavate - The builder will clear out the area of blocks before starting to place them.<br />
*layers:# - The builder will build # number of layers at a time, the default is 1.<br />
*yoffset:# - The builder will start building the specified number of blocks up or down from the set starting location.<br />
*groupall - the builder will build all of a group of materials at once, instead of doing it per layer.<br />
*ignoreair - the builder will not place air blocks. (Use to build into an existing structure, pointless if used with excavate)<br />
*ignoreliquid - the builder will not place lava or water blocks. (Use if the schematic has unconstrained liquids on the bottom.)<br />
*onstart:Task - the builder will run the [[Denizen]] task script on start of build (after material collection). See [[#Advanced Usage]]<br />
*oncomplete:Task - the builder will run the [[Denizen]] task script on completion of build. See [[#Advanced Usage]]<br />
*oncancel:Task - the builder will run the [[Denizen]] task script on cancellation of build. See [[#Advanced Usage]]<br />
*silent - the builder will not send completion/error messages to the command sender.<br />
<br />
Examples:<br />
/builder build<br />
/builder build excavate reverselinear yoffset:-3<br />
/builder build ignoreair ignoreliquid oncomplete:Celebrate<br />
/builder build groupall layers:3<br />
<br />
'''/builder cancel''' - Cancel a build job.<br />
<br />
'''/builder info''' - View a Builder's loaded schematic name and size, as well as the builder's options and status.<br />
<br />
'''/builder survey (excavate)''' - Display a list of all the block types/count it would require to build at the current location. Specify excavate to show the list of materials if excavation is used. Does not show water or lava.<br />
<br />
'''/builder supply true|false''' set whether the builder will need to be given the materials before he will start building. See [[#Supply Mode]]<br />
<br />
'''/builder hold true|false''' set whether the builder will hold the items he is placing (Turn off only for compatibility with other plugins like [[Sentry]])<br />
<br />
'''/builder reload ''' - reload options from the builder config.yml<br />
<br />
'''/builder help''' - Display the help.<br />
<br />
==Usage==<br />
*.schematic files should be placed in the ''/plugins/Builder/schematics/'' directory. This directory can be configured in the config.yml<br />
* Position the builder, or set the builder's '''origin''', to the ''center'' of the footpoint you want to build before calling '''build'''. The size of the schematic is shown upon load.<br />
* You can cancel a build and resume it later if you have an Origin set. You can use <code> /builder origin current </code> to set the origin after building has started if you forgot.<br />
* Do not try to resume a build with the excavate option!<br />
* The builder will ignore any empty space underneath the schematic object so that it will always rest on the ground where the builder starts. If you want to build above or below the origin, use the yoffset: build option.<br />
* The builder will not attempt to replace blocks that are already set properly, this means you can use a builder to quickly 'restore' any changed blocks in something he has previously built.<br />
**To set up a builder to maintain an existing building:<br />
***Select the building with worldedit and save it as a schematic.<br />
***Copy the schematic to the builder's schematics directory.<br />
***Load the schematic to a builder and call <code> /builder origin schematic</code>.<br />
***Call /builder build and the builder will place any missing blocks or destroy new ones.<br />
*Rail and dispensers my not be placed correctly. (Hey this is Construction, not Engimaneerin'.)<br />
*By default, NPCs despawn when their chunk unloads. This behavior can be changed in the Citizens2 config.yml, and is recommended if you would like builders to continue to work unattended.<br />
<br />
==Supply Mode==<br />
If the Builder is set to require materials for building (with ''/builder supply true''), he will go into Supply Mode when ''/builder build'' is called. When Supply Mode starts the Builder will survey the build site and generate a list of required materials to start building. Players must provide these materials for the builder to begin. <br />
<br />
While in Supply Mode:<br />
* Right-Click the Builder with an empty hand to view the list of materials still needed.<br />
* Right-Click the Builder with any block or item to see if he needs it. If he does, he will tell you how much he still needs.<br />
* After clicking with a needed material, Right-Click again within a few seconds to give it to the Builder. <br />
* After receiving a material the Builder will say how many more blocks he needs in total to begin, or he will begin building if he has everything.<br />
<br />
What materials are required:<br />
*By default all blocks require their normal drop type (i.e. Cobwebs require String)<br />
*This behavior can be overridden via the 'supply.txt' file found in the \Builder folder.<br />
**Each line contains the Item ID of the block in the schematic, and the ItemID of the block/Item that is required.<br />
**Optionally you can specify the number of blocks/items required for each source block.<br />
**Setting the required Item ID to 0 will not include that source block in the requirements.<br />
<br />
{| class="wikitable collapsible collapsed" <br />
! Default Supply Mode configuration<br />
|-<br />
|<pre><br />
Original Block Number:Require Item Number:Amount(Optional)<br />
Set to 0 to never require block. Blocks not specified will require their normal drop item.<br />
90:0<br />
97:0<br />
95:54<br />
78:0<br />
34:0<br />
119:0<br />
80:80<br />
92:354<br />
43:44:2<br />
125:126:2<br />
20:20<br />
102:102<br />
47:47<br />
103:362<br />
130:130<br />
134:53<br />
135:53<br />
136:53<br />
128:67<br />
109:67<br />
108:67<br />
79:332<br />
51:0<br />
59:295<br />
72:70<br />
71:330:0.5<br />
26:335:0.5<br />
</pre><br />
|}<br />
<br />
All blocks are currently matched on Item ID only. This means:<br />
* All Wool is Wool. Color is ignored building the list, and any color wool can be given to fulfill the requirement.<br />
* The same goes for saplings, slabs, logs, and wood planks.<br />
* Stairs are similar. All wood stairs count as 'oak'. All stone/brick stairs count as 'stone' with the exception of nether brick stairs which are separate.<br />
<br />
If the build is canceled at any point, the collected materials are lost.<br />
<br />
==Advanced Usage==<br />
* Builder can be set to run [[Denizen]] Task Scripts on start, completion, or cancellation of a build.<br />
**The NPC must have both the Builder and [[Denizen]] Trait.<br />
**Call <code>/builder build</code> with the optional modifiers <br />
***<code>onstart:TaskName</code><br />
***<code>oncomplete:TaskName</code> <br />
***<code>oncancel:TaskName</code>. <br />
Example:<br />
/builder build oncomplete:DespawnTask oncancel:AnnounceTask<br />
<br />
*Builder can also run [[Denizen Actions]] at the 3 indicated events. Add the following to the NPC's actions:<br />
**"Build Start"<br />
**"Build Complete"<br />
**"Build Cancel"<br />
Example:<br />
<br />
<code><br />
BuilderAssignment:<br />
type: assignment<br />
actions:<br />
on Build Start:<br />
- ANNOUNCE "Let's do this!"<br />
on Build Complete:<br />
- ANNOUNCE "I have finished!"<br />
</code><br />
<br />
For more complex examples with Denizen and Builder see [[Builder/Builder_and_Denizen|Builder and Denizen Examples]]<br />
<br />
==FAQ==<br />
Q: How can I use multiple builders on one project?<br />
<br />
A: You can use up to 4 builders on one project by giving them all the same schematic and origin, but different build patterns. You can also manually split your schematic into multiple parts with WorldEdit or MCEdit.<br />
<br />
Q: How can I make builders go faster?<br />
<br />
A: Use the /builder timeout command to set the max time between blocks. You can also make the builder walk faster with "/npc speed"<br />
<br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=JVBJLN5HJJS52&lc=US&item_name=jrbudda&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted Donate to jrbudda]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Versions&diff=5028Versions2014-12-14T02:26:16Z<p>Morphan1: </p>
<hr />
<div>The following is a full list of Citizens, Denizen, and Sentry latest versions for given CraftBukkit server versions, starting at 1.7.2<br />
<br />
==Citizens Versions==<br />
<br />
Latest Citizens builds [1.8] are always available here[http://ci.citizensnpcs.co/job/Citizens2/]<br />
<br />
- 1186 1.8 Protocol Hack[http://ci.citizensnpcs.co/job/Citizens2/1186/]<br />
<br />
- 1166 1.7.10[http://ci.citizensnpcs.co/job/Citizens2/1166/]<br />
<br />
- 1142 1.7.9[http://ci.citizensnpcs.co/job/Citizens2/1142]<br />
<br />
- 1114 1.7.5[http://ci.citizensnpcs.co/job/Citizens2/1114]<br />
<br />
- 1098 1.7.2[http://ci.citizensnpcs.co/job/Citizens2/1098]<br />
<br />
==Denizen Versions==<br />
<br />
Latest Denizen builds [1.8] are always available here[http://ci.citizensnpcs.co/job/Denizen/]<br />
<br />
1544 1.7.10[http://ci.citizensnpcs.co/job/Denizen/1544/]<br />
<br />
1483 1.7.9[http://ci.citizensnpcs.co/job/Denizen/1483]<br />
<br />
1467 1.7.5[http://ci.citizensnpcs.co/job/Denizen/1467]<br />
<br />
1460 1.7.2[http://ci.citizensnpcs.co/job/Denizen/1460]<br />
<br />
- If all else fails, [https://dl.dropboxusercontent.com/u/54130586/denizen-0.9.6-VERSIONLESS.jar] <- 'versionless' jar. Not officially supported.<br />
<br />
==Depenizen Versions==<br />
<br />
Latest Depenizen builds [1.8] are always available here[http://ci.citizensnpcs.co/job/Depenizen/]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/227/ Build #227 for MC 1.7.10]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/191/ Build #191 for MC 1.7.9]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/189/ Build #189 for MC 1.7.5]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/187/ Build #187 for MC 1.7.2]<br />
<br />
==Sentry Versions==<br />
<br />
Latest Sentry builds are always available here[http://ci.citizensnpcs.co/job/Sentry/]<br />
<br />
Previous version list [[Sentry#Updates|Available here]]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Versions&diff=5027Versions2014-12-14T02:25:14Z<p>Morphan1: </p>
<hr />
<div>The following is a full list of Citizens, Denizen, and Sentry latest versions for given CraftBukkit server versions, starting at 1.7.2<br />
<br />
==Citizens Versions==<br />
<br />
Latest Citizens builds [1.8] are always available here[http://ci.citizensnpcs.co/job/Citizens2/]<br />
<br />
- 1186 1.8 Protocol Hack[http://ci.citizensnpcs.co/job/Citizens2/1186/]<br />
<br />
- 1166 1.7.10[http://ci.citizensnpcs.co/job/Citizens2/1166/]<br />
<br />
- 1142 1.7.9[http://ci.citizensnpcs.co/job/Citizens2/1142]<br />
<br />
- 1114 1.7.5[http://ci.citizensnpcs.co/job/Citizens2/1114]<br />
<br />
- 1098 1.7.2[http://ci.citizensnpcs.co/job/Citizens2/1098]<br />
<br />
==Denizen Versions==<br />
<br />
Latest Denizen builds [1.8] are always available here[http://ci.citizensnpcs.co/job/Denizen/]<br />
<br />
1544 1.7.10[http://ci.citizensnpcs.co/job/Denizen/1544/]<br />
<br />
1483 1.7.9[http://ci.citizensnpcs.co/job/Denizen/1483]<br />
<br />
1467 1.7.5[http://ci.citizensnpcs.co/job/Denizen/1467]<br />
<br />
1460 1.7.2[http://ci.citizensnpcs.co/job/Denizen/1460]<br />
<br />
- If all else fails, [https://dl.dropboxusercontent.com/u/54130586/denizen-0.9.6-VERSIONLESS.jar] <- 'versionless' jar. Not officially supported.<br />
<br />
==Depenizen Versions==<br />
<br />
Latest Depenizen builds [1.8] are always available here[http://ci.citizensnpcs.co/job/Depenizen/]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/226/ Build #227 for MC 1.7.10]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/191/ Build #191 for MC 1.7.9]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/189/ Build #189 for MC 1.7.5]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/187/ Build #187 for MC 1.7.2]<br />
<br />
==Sentry Versions==<br />
<br />
Latest Sentry builds are always available here[http://ci.citizensnpcs.co/job/Sentry/]<br />
<br />
Previous version list [[Sentry#Updates|Available here]]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Versions&diff=5001Versions2014-09-07T16:54:44Z<p>Morphan1: </p>
<hr />
<div>The following is a full list of Citizens, Denizen, and Sentry latest versions for given CraftBukkit server versions, starting at 1.7.2<br />
<br />
==Citizens Versions==<br />
<br />
Latest Citizens builds are always available here[http://ci.citizensnpcs.co/job/Citizens2/]<br />
<br />
- 1166 1.7.10[http://ci.citizensnpcs.co/job/Citizens2/1166/]<br />
<br />
- 1142 1.7.9[http://ci.citizensnpcs.co/job/Citizens2/1142]<br />
<br />
- 1114 1.7.5[http://ci.citizensnpcs.co/job/Citizens2/1114]<br />
<br />
- 1098 1.7.2[http://ci.citizensnpcs.co/job/Citizens2/1098]<br />
<br />
==Denizen Versions==<br />
<br />
Latest Denizen builds are always available here[http://ci.citizensnpcs.co/job/Denizen/]<br />
<br />
1483 1.7.9[http://ci.citizensnpcs.co/job/Denizen/1483]<br />
<br />
1467 1.7.5[http://ci.citizensnpcs.co/job/Denizen/1467]<br />
<br />
1460 1.7.2[http://ci.citizensnpcs.co/job/Denizen/1460]<br />
<br />
==Depenizen Versions==<br />
<br />
Latest Depenizen builds are always available here[http://ci.citizensnpcs.co/job/Depenizen/]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/191/ Build #191 for MC 1.7.9]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/189/ Build #189 for MC 1.7.5]<br />
<br />
[http://ci.citizensnpcs.co/job/Depenizen/187/ Build #187 for MC 1.7.2]<br />
<br />
==Sentry Versions==<br />
<br />
Latest Sentry builds are always available here[http://ci.citizensnpcs.co/job/Sentry/]<br />
<br />
Previous version list [[Sentry#Updates|Available here]]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen&diff=4989Denizen2014-08-06T10:22:25Z<p>Morphan1: </p>
<hr />
<div><div class="infobox" style="width: 295; font-size: 12px; background: #FFFFFF; float: right; border: 1px solid #CCCCCC; margin-left:2.5em; padding: 9px;"><br />
{{Box|<br />
BORDER = #ccc|<br />
BACKGROUND = #aaa|<br />
WIDTH = 275|<br />
ALIGN = RIGHT|<br />
ICON = |<br />
HEADING = ''' ''' |<br />
CONTENT = [[image:denizen.png|center]]<br />
<div class="padded" style="padding: 19px; font-family:camingodos-web; font-size:110%;"><br />
<br />
'''Denizen''' is an extension for Citizens that allows scripting of NPCs to handle tasks, quests, player interaction and more! <br />
<br />
'''Current version:''' 0.9.4 Pre-Release Beta<br />
<br />
'''Creator and head of development:''' aufdemrand<br />
<br />
'''Active developer(s) / maintainer(s):''' mcmonkey<br />
<br />
'''Other current developer(s):''' Morphan1<br />
<br />
'''Previous developers:''' David Cernat, Jeebiss<br />
<br />
'''Source:''' [https://github.com/aufdemrand/Denizen Github]<br />
<br />
'''Latest developmental build:''' [http://ci.citizensnpcs.co/view/All/job/Denizen/ 0.9.4 Builds]<br />
<br />
'''Citizens build:''' [http://ci.citizensnpcs.co/job/Citizens2/ 2.0.12]<br />
<br />
'''Support tickets:''' [http://github.com/aufdemrand/Denizen/issues/ Tickets on Github]<br />
<br />
'''IRC:''' [http://webchat.esper.net/?nick=r_denizen_...&channels=denizen-dev&prompt=1 #denizen-dev on esper.net]<br />
<br />
'''Donate:''' A lot of man hours have been put into Denizen. Your donations add a lot to the project and are always welcome!<br />
<br />
To aufdemrand: Your donations will probably help remodel my house and feed my kids. :) - [https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=jeremy%2eschroeder%40gmail%2ecom&lc=US&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted Donate to aufdemrand]<br />
<br />
To mcmonkey: I literally have no income outside donations - [http://mcmonkey.org/donate Donate to mcmonkey]<br />
<br />
Don't forget to donate to the Citizens2 project as well, as none of this would be possible without that!<br />
<br />
'''Thank you:''' A lot of people have stepped forward to help out with Denizen, and that's awesome! Special thanks to everyone who has beta tested, and a huge to these people: fullwall, AgentKid, aPunch, NeonMaster, Instinx, tenowg, groggluebutt, Wreyth, jrbudda, spidi, the list could go on!<br />
<br><br />
}} <br />
</div><br />
</div><br />
<br />
<div style="padding:10px; font-family:camingodos-web; font-size:110%;"><br />
[[image:Denizen-Logo-Large.png|center]]<br />
<br />
This Wiki should be regarded as a quick, easy reference guide for Denizen. For more indepth documentation, consult the [http://goo.gl/4CSK8 official Denizen handbook] or the [http://bit.ly/1bHkByR Beginner's Guide]. For more up-to-date information and full details on specific features (individual commands or tags, for example), check the [http://mcmonkey.org/cmds/ Meta Documentation].<br />
<br />
If you want a full tutorial to help get you set up, check out the [http://www.youtube.com/playlist?list=PLSiy0fFeYjtWVBr_NgJ5I-yWdsYLIVu6h Tutorial Videos] on youtube.<br />
<br />
If you need quick help, visit our [http://webchat.esper.net/?nick=r_denizen_...&channels=denizen-dev&prompt=1 IRC channel].<br />
<br><br><br><br />
<span style="font-family:natalya-alternate-one; font-size:750%; margin-right:-7px; margin-left:-10px;">D</span>enizen is a great way to add complex interactive role-playing NPCs to your server. Denizen NPCs use scripts with steps and events to interact with the player and world. Imagine interactive gate-keepers, magical wizards, experience trainers, bankers, talking townspeople and more! They can be used in thousands of different ways, from tutorials, to questing, to administrating.. your imagination is just about the limit! Though Denizen uses Scripting, it is not to be confused with [[Scripting|Citizens2 Core Scripting]] which utilizes JavaScript and other major scripting languages to implement Goals. Instead, Denizen uses its own YML scripting language which is designed to be easily read and edited by hand.<br />
<br />
<br />
<br />
===Table of Contents===<br />
<br />
# [[Denizen/Introduction|Introduction]]<br />
# [[Denizen/Types of Scripts|Types of Scripts]]<br />
# [[Denizen/Requirements|Requirements]]<br />
# [[Denizen/Triggers|Triggers]]<br />
# [[Denizen/Commands|Commands]]<br />
# [[Denizen/Replaceable Tags|Replaceable Tags]]<br />
# [[Denizen/Additional_Traits|Additional Traits]]<br />
# [[Denizen/Script_Samples|Script Samples]]<br />
# [[Denizen/Other|Other Pages]]<br />
<br />
<br />
<br />
<div style="padding:10px; font-family:camingodos-web; font-size:110%;"><br />
<br />
===How it works=== <br />
Denizen is an extension of Citizens2 that adds an incredible amount of interactivity and automation to NPCs and Players with some of these major features:<br />
<br />
* '''The Script Engine''' carries out and sends all the commands to be executed in an orderly and predictable fashion; this is the backbone of Denizen. There's not much to see on the outside, this is the interworkings of Denizen, but rest assured that this is high performance machine behind the scenes!<br />
* '''Assignment and Interact Scripts''' are the meat of Denizen, allowing Players and NPCs to interact with each other and the world. These are highly customizable with 20+ requirement types, 90+ script commands, and thousands of different ways to use them together. This with the Denizen Script Engine also allows commands to help control the rest of Denizen with script flow commands and such.<br />
* '''Task Scripts''' are simple scripts that can be carried out in a variety of different ways. These can be used along side both Activity and Interact Scripts, but perhaps the most powerful way to use them is by allowing your plugin to utilize them, if you're a developer, or using other plugins that harness the ability to run a Denizen Task Script as well.<br />
* '''World Scripts''' are scripts that call Denizen commands when random things happen throughout the world - anything, even down to a player mining a block, and a separate script for them picking up the item it dropped! With the power of world scripts, a skilled user could make entire server plugins using nothing but Denizen scripts!<br />
* '''Listeners''' are currently in an 'experimental phase', but are already allowing control over minecraft and bukkit events like nothing other. This already allows scripts to keep track of and assign 'quest-like' objectives, such as a 'kill quest', if you're familiar with the C1 Quester. But whereas many quest plugins are limited to this feature alone, Denizen, of course, allows you to use this in addition and along side the rest of the plugin, making room for extremely dynamic and intricate 'quest scripts'.<br />
* '''Flag System''' is the key to Denizen being dynamic. An intricate, yet easy to learn 'Flag/Variable' system has been implemented into Denizen to help keep track of events, items, numbers, players, and more. The new Flag System is still getting more powerful each and every day.. it's the key to a spectacular script is sure to have a flag or two.<br />
* '''Extensible Commands/Requirements/Activities and more''' make it easy to add-on to Denizen with very little Java knowledge. This also makes it extremely easy to let users utilize your plugin with script commands. Denizen also has API Events to use.<br />
* '''Denizen Debugger''' is an extremely friendly and informative way to test out scripts and interactions. Commands, events, and interactions are all logged in an easy to read format to show the exact progression of a script and its surroundings. No more guessing! Less headaches!<br />
* '''A note on YML''' Most of the time when a server owner uses YML, they edit an existing configuration. In Denizen, it is required to frequently *add* additional content. Be careful of your spacing, and never use tabs. You can use ChatBots in [http://webchat.esper.net/?nick=r_denizen_...&channels=denizen-dev&prompt=1 our IRC channel] to check your YML files or you can use [http://yaml-online-parser.appspot.com/ this online YAML parser.] (The ChatBots do much more, as well! Just go into [http://webchat.esper.net/?nick=r_denizen_...&channels=denizen-dev&prompt=1 our IRC channel] and type '''!help''')<br />
<br />
<br />
<br />
<br />
Seem overwhelming? Stop! Start small! Denizen is easy, Denizen is simple. But. Denizen is hard, Denizen is complex. Simply put: Denizen is what you make it! Our advice? Start small, and build upon what you have. Read the wiki articles, watch the youtube videos, test our your scripts, and test out some of the sample scripts! Before you know it, you'll be a Denizen poweruser, drunken with power, just like us!<br />
</div><br />
<br />
(Legacy 0.7 wiki found [http://wiki.citizensnpcs.co/Denizen/0.7 here])<br />
<br />
[[Category:Denizen]]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen/BattleNight&diff=4987Depenizen/BattleNight2014-07-15T03:34:17Z<p>Morphan1: </p>
<hr />
<div><h1>Denizen Commands</h1><br />
The BattleNight commands are pretty straight-forward. You should remember that any Denizen command can have a "player:<player>" argument to change the specified player.<br />
For example, if you wanted to add a player to a battle that isn't the currently attached player, you can use "- bn add player:PlayerName"<br />
<br />
<h2>- bn add</h2><br />
<br />
Adds a player to the current battle.<br />
<br />
<h2>- bn kick</h2><br />
<br />
Kicks a player from the current battle.<br />
<br />
<h2>- bn start</h2><br />
<br />
Starts a battle.<br />
<br />
<h2>- bn end</h2><br />
<br />
Ends a battle.<br />
<br />
<h1>Tags</h1></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen/Supported-Plugins&diff=4986Depenizen/Supported-Plugins2014-07-14T10:42:57Z<p>Morphan1: </p>
<hr />
<div><h1>Currently Supported Plugins</h1><br />
<br />
* [[Depenizen/BattleNight|BattleNight]]<br />
* Factions<br />
* mcMMO<br />
* Towny<br />
* Votifier<br />
* Jobs<br />
<br />
If you would like another plugin to be supported, please [https://github.com/Morphan1/Depenizen/issues create a request] detailing the plugin name, where to find it, and what features are desired.</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen/BattleNight&diff=4985Depenizen/BattleNight2014-07-14T10:41:27Z<p>Morphan1: </p>
<hr />
<div><h1>Commands</h1><br />
<h2>- bn add</h2><br />
<br />
Use this to add a player to the current battle. For example, <pre>- bn add</pre> would add the current player attached to the script. Of course, you can also change the player using Denizen's built-into-every-command argument "player:<player>"<br />
<pre>- bn add player:Morphan1</pre><br />
<br /><br />
<h2>- bn kick</h2><br />
<pre><br />
- bn kick<br />
- bn start<br />
- bn end<br />
</pre><br />
<br />
<h1>Tags</h1></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen/BattleNight&diff=4984Depenizen/BattleNight2014-07-14T10:33:20Z<p>Morphan1: Created page with "<h1>Commands</h1> <pre> - bn add - bn kick - bn start - bn end </pre> <h1>Tags</h1>"</p>
<hr />
<div><h1>Commands</h1><br />
<pre><br />
- bn add<br />
- bn kick<br />
- bn start<br />
- bn end<br />
</pre><br />
<br />
<h1>Tags</h1></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4938Denizen/Commands2013-12-22T08:39:14Z<p>Morphan1: Fix Chat syntax</p>
<hr />
<div>== This List Is Outdated ==<br />
<br />
This list is only a tiny fraction of all the Denizen commands... and the information is outdated.<br />
<br />
We are working on a new system of ensuring up-to-date documentation to prevent this in the future... If you wish to see out progress, look here:<br />
<br />
http://mcmonkey4eva.dyndns.org/cmds<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continuously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|n@<npc.id>|p@<player.name>|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:p@<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["<text>"] (no_target/targets:<entity>|...)</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:n@7<br />
- chat "Bob, do you know <player.name>?" target:p@Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:p@Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|sit|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|trigger|[name:chat/click/damage/proximity] (state:true/false) (cooldown:<#.#>) (radius:<#>)<br />
|Enables or disables an interact trigger.<br />
<br />
Use this command to enable or disable an interact trigger, usually in the [http://wiki.citizensnpcs.com/Denizen/Types_of_Scripts#Assignment_Script assignment script].<br />
<br />
'''Examples'''<br />
<pre><br />
- trigger name:chat state:true<br />
- trigger name:proximity statue:true radius:10<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|queue|(queue:<id>) [clear/pause/resume/delay:<#>]<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- queue queue:magicalattacks clear<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|if|<nowiki>[<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>] (else <commands>)</nowiki><br />
|Compares one value to another and if the outcome is true, the commands inside the 'if' statement will be run and no more comparables will be checked. If it is false, the next 'else if', if there is one, will be compared, and if that is true, the commands in that 'else if' will be run and no more comparables will be checked. This will continue happening until the script either runs out of comparables or reaches an 'else', in which case the commands inside the 'else' will be run and the script will continue.<br />
<br />
For more info, [[Denizen/Commands/If|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- if "<player.inventory.contains[1]> announce "Hahaha! <player.name> has no stone!"<br />
- if <player.name> == "davidcernat" execute as_server "ban <player.name>"<br />
- if <context.message.contains[Bob]> announce "<player.name> said Bob! Smite them!"<br />
else if <player.name.contains[Bob]> announce "<player.name>'s name contains Bob! Smite them!"<br />
else {<br />
- announce "No mention of Bob can be found. Proceeding with life..."<br />
- run Life delay:0s<br />
}<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|log|<nowiki>[<text>] (type:severe/info/warning/fine/finer/finest) [file:<name>]</nowiki><br />
|Logs whatever text you want into a file inside the main server folder. If the file doesn't exist, it will create it.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- log "Something happened!" "file:Denizen.log"<br />
- log "Bob punched Joe!" "file:logs/DenizenLog.txt"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Replaceable_Tags&diff=4871Denizen/Replaceable Tags2013-10-25T05:57:22Z<p>Morphan1: /* Special Characters */</p>
<hr />
<div>==Important==<br />
====This is out of date!====<br />
For an up to date tag list, check: http://mcmonkey4eva.dyndns.org/tags<br />
<br />
<br />
__TOC__<br />
<br />
==Flags==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <flag.g:flag_name><br />
| Returns the value of a flag attached to the server. NOTE: In 0.9, it's more preferred to use <server.flag[flag_name]><br />
|-<br />
| <flag.n:flag_name><br />
| Returns the value of a flag attached to the current NPC. NOTE: In 0.9, it's more preferred to use <npc.flag[flag_name]><br />
|-<br />
| <flag.p:flag_name><br />
| Returns the value of a flag attached to the current player. NOTE: In 0.9, it's more preferred to use <player.flag[flag_name]><br />
|-<br />
|<player[player_name].flag[flag_name]><br />
|Returns the value of a flag for another player.<br />
|-<br />
|<player.flag[flag_name]>.isexpired><br />
|Returns true or false if the duration of a flag has expired.<br />
|}<br />
<br />
==Location==<br />
All location tags require coordinates. You can have tags in the brackets [] or you can specify exact locations by yourself. For example, you could use <pre><location[<npc.location>].biome.temperature></pre> to get the temperature at the NPC's location.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <location[x,y,z,world].biome.formatted><br />
| The formatted name of the biome at coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.humidity><br />
| The current humidity at the coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.temperature><br />
| The current temperature at the coordinates.<br />
|-<br />
| <location[x,y,z,world].distance[x,y,z,world]><br />
| The distance between 2 coordinates.<br />
|-<br />
| <location[x,y,z,world].formatted><br />
| The coordinates in an easier-to-read format.<br />
|-<br />
| <location[x,y,z,world].is_liquid><br />
| Whether or not the block at the coordinates are a liquid. Can be true or false.<br />
|-<br />
| <location[x,y,z,world].light><br />
| The light level at the coordinates.<br />
|}<br />
<br />
==NPC==<br />
NOTE: You can reference an NPC other than the one in the current script by using <npc[npc_id]>... So for example, <npc[2].id> (which would be completely useless) would return '2'.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <npc.flag[flag_name]><br />
| Returns the value of a flag attached to an NPC.<br />
|-<br />
| <npc.id><br />
| The ID number of the NPC.<br />
|-<br />
| <npc.location><br />
| The coordinates of the NPC. [x,y,z,world]<br />
|-<br />
| <npc.location.previous_location><br />
| The last location the NPC was at.<br />
|-<br />
| <npc.location.standing_on><br />
| The Bukkit block name that the NPC is standing on.<br />
|-<br />
| <npc.location.standing_on_display><br />
| The formatted block name that the NPC is standing on.<br />
|-<br />
| <npc.location.world><br />
| The name of the world the NPC is in.<br />
|-<br />
| <npc.location.world_spawn><br />
| The coordinates of the spawn of the world that the NPC is currently in.<br />
|-<br />
| <npc.location.x><br />
| The x coordinate the NPC is at.<br />
|-<br />
| <npc.location.y><br />
| The y coordinate the NPC is at.<br />
|-<br />
| <npc.location.z><br />
| The z coordinate the NPC is at.<br />
|-<br />
| <npc.name><br />
| The NPC's name.<br />
|-<br />
| <npc.name.nickname><br />
| The NPC's nickname.<br />
|-<br />
| <npc.owner><br />
| The owner of the NPC.<br />
|}<br />
<br />
==Player==<br />
NOTE: You can reference a player other than the one in the current script by using <player[player_name]>... So for example, <player[Morphan1].name> (which would be completely useless) would return 'Morphan1'.<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <player.chat_history><br />
| Last message the player sent.<br />
|-<br />
| <player.chat_history[X]><br />
| Message the player sent X times ago.<br />
|-<br />
| <player.equipment.boots><br />
| The Bukkit name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.equipment.boots.formatted><br />
| The formatted name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.flag[flag_name]><br />
| Returns the value of a flag attached to a player.<br />
|-<br />
| <player.health><br />
| The player's health, 1-20. Each number is half of a heart.<br />
|-<br />
| <player.health.formatted><br />
| The player's formatted health. Can be healthy, scraped, injured, seriously wounded, and dying.<br />
|-<br />
| <player.health.percentage><br />
| The player's health as a percentage.<br />
|-<br />
| <player.inventory.contains.display[display_name]><br />
| Checks if the player's inventory contains an item with a name chosen on an anvil. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.inventory.contains[item_id]><br />
| Checks if the player's inventory contains an item. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.food_level><br />
| The player's food level, 1-20. Each number is half of a thing-on-the-hunger-bar.<br />
|-<br />
| <player.food_level.formatted><br />
| The player's formatted food level. Can be healthy, parched, hungry, and famished.<br />
|-<br />
| <player.food_level.percentage><br />
| The player's food level as a percentage.<br />
|-<br />
| <player.group[group_name]><br />
| Checks if the player is in a group via Vault. Can be true or false.<br />
|-<br />
| <player.group[group_name].global>><br />
| Checks if the player is in a global group via Vault. Can be true or false.<br />
|-<br />
| <player.item_in_hand.enchantments><br />
| List of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level><br />
| List of enchantments and their levels on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level_only><br />
| List of levels of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand><br />
| Contains all details of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.data><br />
| The material data of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.display><br />
| The name chosen on an anvil for the item the player is holding.<br />
|-<br />
| <player.item_in_hand.durability><br />
| The durability of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.id><br />
| The ID of the block or item the player is holding. All block and item IDs are found [http://www.minecraftwiki.net/wiki/Data_values here].<br />
|-<br />
| <player.item_in_hand.lore><br />
| List of lore on item in the player's hand.<br />
|-<br />
| <player.item_in_hand.max_stack><br />
| The maximum amount you can have in one inventory slot of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.material><br />
| Bukkit material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.material.formatted><br />
| Formatted material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.qty><br />
| The current amount of the inventory slot of the item the player is holding.<br />
|-<br />
| <player.is_banned><br />
| Whether the player is banned. Can be true or false.<br />
|-<br />
| <player.is_online><br />
| Whether the player is online. Can be true or false.<br />
|-<br />
| <player.is_op><br />
| Whether the player is an operator. Can be true or false.<br />
|-<br />
| <player.location><br />
| The coordinates of the player. [x,y,z,world]<br />
|-<br />
| <player.location.bed_spawn><br />
| The coordinates of the last bed the player slept in, if any.<br />
|-<br />
| <player.location.cursor_on[X]><br />
| The location of the block the player's cursor is on, within X range.<br />
|-<br />
| <player.location.standing_on><br />
| The Bukkit block name that the player is standing on.<br />
|-<br />
| <player.location.standing_on.formatted><br />
| The formatted block name that the player is standing on.<br />
|-<br />
| <player.location.world><br />
| The name of the world the player is in.<br />
|-<br />
| <player.location.world_spawn><br />
| The coordinates of the spawn of the world that the player is currently in.<br />
|-<br />
| <player.location.x><br />
| The x coordinate the player is at.<br />
|-<br />
| <player.location.y><br />
| The y coordinate the player is at.<br />
|-<br />
| <player.location.z><br />
| The z coordinate the player is at.<br />
|-<br />
| <player.money><br />
| The amount of money in this player's account. Requires Vault and an economy plugin.<br />
|-<br />
| <player.name><br />
| The player's name.<br />
|-<br />
| <player.name.display><br />
| The player's display name. (The one that shows in chat.)<br />
|-<br />
| <player.mcmmo.level[skill_name]><br />
| The player's current level for an McMMO skill.<br />
|-<br />
| <player.money><br />
| How much money the player has, as a number. (0.0, 1.5, 2.25, etc.)<br />
|-<br />
| <player.money.asint><br />
| How much money the player has, as an integer. (0, 1, 2, etc.)<br />
|-<br />
| <player.money.currency><br />
| The currency set in this server's economy plugin.<br />
|-<br />
| <player.money.currency.plural><br />
| The currency set in this server's economy plugin, in its plural form.<br />
<br />
Examples: Dollars, pounds, coins<br />
|-<br />
| <player.money.currency.singular><br />
| The currency set in this server's economy plugin, in its singular form.<br />
<br />
Examples: Dollar, pound, coin<br />
|-<br />
| <player.script[script_name].failed><br />
| Checks if the player has failed a script. Can be true or false.<br />
|-<br />
| <player.script[script_name].finished><br />
| Checks if the player has finished a script. Can be true or false.<br />
|-<br />
| <player.time><br />
| The player's time in ticks, from 0 to 23999. For a quick view of what different tick values mean in real life hours, look [http://media-mcw.cursecdn.com/b/bc/Day_Night_Clock_24h.png here].<br />
|-<br />
| <player.time.period><br />
| The time period for this player. Can be "day" or "night".<br />
|-<br />
| <player.xp><br />
| The total experience of a player.<br />
|-<br />
| <player.xp.level><br />
| The current experience level of a player.<br />
|-<br />
| <player.weather><br />
| The current weather in this player's world. Is "storming" if there's a storm, "sunny" if the weather is clear and it's daytime, and "clear" if the weather is clear and it's nighttime.<br />
|}<br />
<br />
==Util==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <util.random.int[1].to[50]><br />
| Returns a random number between the lower bound (first number) and upper bound (second number).<br />
|-<br />
| width="30%" | <util.random.uuid><br />
| Returns a random "uuid" useful for starting new queues.<br />
|-<br />
| width="30%" | <util.substr[string]><br />
| Returns a substring of a string.<br />
|-<br />
|}<br />
<br />
==Math Tags==<br />
Math tags are a useful part of Denizen that, as the name implies, allows you to perform mathematical operations internally.<br />
<br />
Here's the general syntax, with spaces for readability. (You shouldn't include spaces in your actual script. If you must, put it in "quotes")<br />
<pre><br />
<m: firstThing + secondThing> <br />
//Now, all together,<br />
<m:firstThing+secondThing><br />
</pre><br />
Of course, + isn't the only mathematical operator that can be used. You can also use:<br />
<br />
Minus and Modulus: (- and %)<br />
<br />
Divide and Multiply: (/ and *)<br />
<br />
==Text==<br />
<br />
===Colors===<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="25%" border="1"<br />
|-<br />
| width="60%" | <aqua><br />
| style="background-color:#55FFFF" |<br />
|-<br />
| <black><br />
| style="background-color:black" |<br />
|-<br />
| <blue><br />
| style="background-color:#5555FF" |<br />
|-<br />
| <dark_aqua><br />
| style="background-color:#00AAAA" |<br />
|-<br />
| <dark_blue><br />
| style="background-color:#0000AA" |<br />
|-<br />
| <dark_gray><br />
| style="background-color:#555555" |<br />
|-<br />
| <dark_green><br />
| style="background-color:#00AA00" |<br />
|-<br />
| <dark_purple><br />
| style="background-color:#AA00AA" |<br />
|-<br />
| <dark_red><br />
| style="background-color:#AA0000" |<br />
|-<br />
| <gold><br />
| style="background-color:#FFAA00" |<br />
|-<br />
| <gray><br />
| style="background-color:#AAAAAA" |<br />
|-<br />
| <green><br />
| style="background-color:#55FF55" |<br />
|-<br />
| <light_purple><br />
| style="background-color:#FF55FF" |<br />
|-<br />
| <red><br />
| style="background-color:#FF5555" |<br />
|-<br />
| <white><br />
| style="background-color:white" |<br />
|-<br />
| <yellow><br />
| style="background-color:#FFFF55" |<br />
|}<br />
<br />
===Special Characters===<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="25%" border="1"<br />
|-<br />
| width="60%" | <&nl><br />
| NewLine <br />
|-<br />
| <&cm> <br />
| , <br />
|-<br />
| <&ss> <br />
| § <br />
|-<br />
| <&sq> <br />
| ' <br />
|-<br />
| <&dq> <br />
| " <br />
|-<br />
| <&co> <br />
| : <br />
|-<br />
| <&rb> <br />
| ] <br />
|-<br />
| <&lb> <br />
| [<br />
|-<br />
| <&rc> <br />
| } <br />
|-<br />
| <&lc> <br />
| {<br />
|-<br />
| <&ns> <br />
| #<br />
|-<br />
|}<br />
<br />
==Pssst...==<br />
http://pastebin.com/KBADLinZ<br><br />
Here is a summary of them :)<br><br />
-Jeebs</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands/Flag&diff=4870Denizen/Commands/Flag2013-10-25T05:33:52Z<p>Morphan1: </p>
<hr />
<div>== Introduction ==<br />
Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement.<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
Once you set a flag, you can call it back at any time with one of the [[Denizen/Replaceable_Tags#Flags|replaceable tags]].<br />
<br />
= The flag command =<br />
To begin, you need to actually set a flag. You can do this by using <br />
{| class="wikitable" border="1"<br />
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)<br />
|}<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
...Too much for you? Let's slow it down.<br />
=== The Basics ===<br />
<br />
To start using flags, you must first understand the basics. This means learning the 4 types of flags you can use: booleans, strings, integers/doubles, and lists.<br />
<br />
==== Boolean ====<br />
<br />
The first, most used, most basic flag you need (besides a default flag) is a boolean flag. A boolean is a variable that represents either true or false.<br />
You can set a boolean flag to true by using <pre>- flag "RandomFlag"</pre> ...That's it. That automatically sets the flag named RandomFlag attached to the player interacting with the script as 'true'.<br />
You can set it to false by simply doing <pre>- flag "RandomFlag:false"</pre><br />
This type of flag is helpful for 'if' statements. More information on that can be found [[Denizen/Commands/If#Flags|here]].<br />
<br />
==== String ====<br />
<br />
Let's move forward. Probably the second most important flag you'll need on your journey is the string flag. Strings are variables that represent words or phrases that you can change at any time.<br />
<br />
For example, <pre>- flag "RandomFlag:Blah something whatever"</pre> would set the flag 'RandomFlag' on the player who's interacting with the script as 'Blah something whatever'.<br />
Remember, you can also attach the flag to the NPC that the script is being run by, or the server itself by specifying 'npc' or 'global'. That will be covered in the advanced section.<br />
<br />
==== Integer/Doubles ====<br />
<br />
Onto the next step... Integers and doubles! If you know a little about math, you probably already know that integers are just a fancy way of saying 'whole numbers'. In that sense, doubles are simply just numbers with decimals. (Non-whole numbers.)<br />
<br />
Flags can hold numbers such as these by using something along the lines of...<br />
<pre>- flag "IntegerFlag:3"<br />
- flag "DoubleFlag:5.2"</pre><br />
<br />
==== Lists ====<br />
<br />
If you want to store a lot of objects in one place, a flag list is the way to go.<br />
<br />
To do this, you can use the Flag command's add and remove functions, like so:<br />
<pre>### To add to a Flag list...<br />
- flag "FlagList:->:<player>"<br />
### To remove from a Flag list...<br />
- flag "FlagList:<-:<player>"</pre><br />
<br />
= Usage inside scripts =<br />
<br />
== Checking if a flag exists ==<br />
With the new 0.9 Development release you can now check if a flag exists.<br />
<br />
=== With the If command ===<br />
To do this with an If command, just check a flag against null like in the following example:<br />
<br />
<pre>- if <player.flag[flag_to_check]> == null narrate 'flag is null!'<br />
else narrate "<player.flag[flag_to_check]>"</pre><br />
<br />
=== With Requirements ===<br />
'''Note: Requirements have been deprecated in favor of the If command.'''<br />
<br />
To do this with Requirements, you can use any of the following:<br />
<pre>### To check if the flag EXISTS (Whether or not it has no value doesn't matter.)<br />
- flagged FlagName<br />
### To check if the flag DOES NOT EXIST (The flag must not have had a value at any point in time.)<br />
- -flagged FlagName<br />
### To check if the flag is NULL (If the flag has no value or doesn't exist.)<br />
- flagged FlagName:null</pre><br />
<br />
== Mathematical calculations ==<br />
Number flags (Integer, Double, ...) can be used in calculations. You can either use the <m: > tag or add the operation directly behind the flag (examples in the different kinds of operations).<br />
<br />
=== Addition ===<br />
To add a flag and a number together, just use <code>add[]</code>.<br />
Example:<br />
<pre><player.flag[money].add[2]></pre><br />
<br />
=== Subtraction ===<br />
To subtract the flag's value, just use <code>sub[]</code>.<br />
Example:<br />
<pre><player.flag[money].sub[10]></pre><br />
<br />
=== Multiplication ===<br />
To multiply the value of a flag, just use <code>mul[]</code>.<br />
Example:<br />
<pre><player.flag[money].mul[1.25]></pre><br />
<br />
=== Multiplication ===<br />
To divide a flag by something use <code>div[]</code>.<br />
Example:<br />
<pre><player.flag[money].div[1.25]></pre><br />
<br />
=== Mod ===<br />
Denizen allows you to mod two numbers as well! Just use <code>mod[]</code>.<br />
Example:<br />
<pre><player.flag[money].mod[3]></pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands/Flag&diff=4869Denizen/Commands/Flag2013-10-25T05:32:26Z<p>Morphan1: </p>
<hr />
<div>== Introduction ==<br />
Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement.<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
Once you set a flag, you can call it back at any time with one of the [[Denizen/Replaceable_Tags#Flags|replaceable tags]].<br />
<br />
= The flag command =<br />
To begin, you need to actually set a flag. You can do this by using <br />
{| class="wikitable" border="1"<br />
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)<br />
|}<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
...Too much for you? Let's slow it down.<br />
=== The Basics ===<br />
<br />
To start using flags, you must first understand the basics. This means learning the 4 types of flags you can use: booleans, strings, integers/doubles, and lists.<br />
<br />
==== Boolean ====<br />
<br />
The first, most used, most basic flag you need (besides a default flag) is a boolean flag. A boolean is a variable that represents either true or false.<br />
You can set a boolean flag to true by using <pre>- flag "RandomFlag"</pre> ...That's it. That automatically sets the flag named RandomFlag attached to the player interacting with the script as 'true'.<br />
You can set it to false by simply doing <pre>- flag "RandomFlag:false"</pre><br />
This type of flag is helpful for 'if' statements. More information on that can be found [[Denizen/Commands/If#Flags|here]].<br />
<br />
==== String ====<br />
<br />
Let's move forward. Probably the second most important flag you'll need on your journey is the string flag. Strings are variables that represent words or phrases that you can change at any time.<br />
<br />
For example, <pre>- flag "RandomFlag:Blah something whatever"</pre> would set the flag 'RandomFlag' on the player who's interacting with the script as 'Blah something whatever'.<br />
Remember, you can also attach the flag to the NPC that the script is being run by, or the server itself by specifying 'npc' or 'global'. That will be covered in the advanced section.<br />
<br />
==== Integer/Doubles ====<br />
<br />
Onto the next step... Integers and doubles! If you know a little about math, you probably already know that integers are just a fancy way of saying 'whole numbers'. In that sense, doubles are simply just numbers with decimals. (Non-whole numbers.)<br />
<br />
Flags can hold numbers such as these by using something along the lines of...<br />
<pre>- flag "IntegerFlag:3"<br />
- flag "DoubleFlag:5.2"</pre><br />
<br />
==== Lists ====<br />
<br />
If you want to store a lot of objects in one place, a flag list is the way to go.<br />
<br />
To do this, you can use the Flag command's add and remove functions, like so:<br />
<pre>### To add to a Flag list...<br />
- flag "FlagList:->:<player>"<br />
### To remove from a Flag list...<br />
- flag "FlagList:<-:<player>"</pre><br />
<br />
= Usage inside scripts =<br />
<br />
== Checking if a flag exists ==<br />
With the new 0.9 Development release you can now check if a flag exists.<br />
<br />
=== With the If command ===<br />
To do this with an If command, just check a flag against null like in the following example:<br />
<br />
<pre>- if <player.flag[flag_to_check]> == null narrate 'flag is null!'<br />
else narrate "<player.flag[flag_to_check]>"</pre><br />
<br />
=== With Requirements ===<br />
To do this with Requirements, you can use any of the following:<br />
<pre>### To check if the flag EXISTS (Whether or not it has no value doesn't matter.)<br />
- flagged FlagName<br />
### To check if the flag DOES NOT EXIST (The flag must not have had a value at any point in time.)<br />
- -flagged FlagName<br />
### To check if the flag is NULL (If the flag has no value or doesn't exist.)<br />
- flagged FlagName:null</pre><br />
<br />
== Mathematical calculations ==<br />
Number flags (Integer, Double, ...) can be used in calculations. You can either use the <m: > tag or add the operation directly behind the flag (examples in the different kinds of operations).<br />
<br />
=== Addition ===<br />
To add a flag and a number together, just use <code>add[]</code>.<br />
Example:<br />
<pre><player.flag[money].add[2]></pre><br />
<br />
=== Subtraction ===<br />
To subtract the flag's value, just use <code>sub[]</code>.<br />
Example:<br />
<pre><player.flag[money].sub[10]></pre><br />
<br />
=== Multiplication ===<br />
To multiply the value of a flag, just use <code>mul[]</code>.<br />
Example:<br />
<pre><player.flag[money].mul[1.25]></pre><br />
<br />
=== Multiplication ===<br />
To divide a flag by something use <code>div[]</code>.<br />
Example:<br />
<pre><player.flag[money].div[1.25]></pre><br />
<br />
=== Mod ===<br />
Denizen allows you to mod two numbers as well! Just use <code>mod[]</code>.<br />
Example:<br />
<pre><player.flag[money].mod[3]></pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands/Flag&diff=4868Denizen/Commands/Flag2013-10-25T05:07:14Z<p>Morphan1: /* Integer/Doubles */</p>
<hr />
<div>== Introduction ==<br />
Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement.<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
Once you set a flag, you can call it back at any time with one of the [[Denizen/Replaceable_Tags#Flags|replaceable tags]].<br />
<br />
= The flag command =<br />
== Usage ==<br />
To begin, you need to actually set a flag. You can do this by using <br />
{| class="wikitable" border="1"<br />
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)<br />
|}<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
...Too much for you? Let's slow it down.<br />
=== The Basics ===<br />
<br />
To start using flags, you must first understand the basics. This means learning the 4 types of flags you can use: booleans, strings, integers/doubles, and lists.<br />
<br />
==== Boolean ====<br />
<br />
The first, most used, most basic flag you need (besides a default flag) is a boolean flag. A boolean is a variable that represents either true or false.<br />
You can set a boolean flag to true by using <pre>- flag "RandomFlag"</pre> ...That's it. That automatically sets the flag named RandomFlag attached to the player interacting with the script as 'true'.<br />
You can set it to false by simply doing <pre>- flag "RandomFlag:false"</pre><br />
This type of flag is helpful for 'if' statements. More information on that can be found [[Denizen/Commands/If#Flags|here]].<br />
<br />
==== String ====<br />
<br />
Let's move forward. Probably the second most important flag you'll need on your journey is the string flag. Strings are variables that represent words or phrases that you can change at any time.<br />
<br />
For example, <pre>- flag "RandomFlag:Blah something whatever"</pre> would set the flag 'RandomFlag' on the player who's interacting with the script as 'Blah something whatever'.<br />
Remember, you can also attach the flag to the NPC that the script is being run by, or the server itself by specifying 'npc' or 'global'. That will be covered in the advanced section.<br />
<br />
==== Integer/Doubles ====<br />
<br />
Onto the next step... Integers and doubles! If you know a little about math, you probably already know that integers are just a fancy way of saying 'whole numbers'. In that sense, doubles are simply just numbers with decimals. (Non-whole numbers.)<br />
<br />
Flags can hold numbers such as these by using something along the lines of...<br />
<pre>- flag "IntegerFlag:3"<br />
- flag "DoubleFlag:5.2"</pre><br />
<br />
= Usage inside scripts =<br />
<br />
== Mathematical calculations ==<br />
Number flags (Integer, Double, ...) can be used in calculations. You can either use the <m: > tag or add the operation directly behind the flag (examples in the different kinds of operations).<br />
<br />
=== Addition ===<br />
To add a flag and a number together, just use <code>add[]</code>.<br />
Example:<br />
<pre><player.flag[money].add[2]></pre><br />
<br />
=== Subtraction ===<br />
To subtract the flag's value, just use <code>sub[]</code>.<br />
Example:<br />
<pre><player.flag[money].sub[10]></pre><br />
<br />
=== Multiplication ===<br />
To multiply the value of a flag, just use <code>mul[]</code>.<br />
Example:<br />
<pre><player.flag[money].mul[1.25]></pre><br />
<br />
=== Multiplication ===<br />
To divide a flag by something use <code>div[]</code>.<br />
Example:<br />
<pre><player.flag[money].div[1.25]></pre><br />
<br />
=== Mod ===<br />
Denizen allows you to mod two numbers as well! Just use <code>mod[]</code>.<br />
Example:<br />
<pre><player.flag[money].mod[3]></pre><br />
<br />
== Advanced usage ==<br />
=== Checking if a flag exists ===<br />
With the new 0.9 Development release you can now check if a flag exists. Just check a flag against null like in the following example:<br />
<br />
<pre>- if <player.flag[flag_to_check]> == null narrate 'flag is null!'<br />
else narrate "<player.flag[flag_to_check]>"</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen&diff=4815Depenizen2013-09-06T04:14:49Z<p>Morphan1: Created page with "<center><h1><nowiki>~~~~~~~~Depending on Denizen since 2013~~~~~~~~</nowiki></h1></center> Welcome to the Depenizen Project! What is Depenizen all about? Head on over to our ..."</p>
<hr />
<div><center><h1><nowiki>~~~~~~~~Depending on Denizen since 2013~~~~~~~~</nowiki></h1></center><br />
<br />
Welcome to the Depenizen Project! What is Depenizen all about? Head on over to our [[Depenizen/Frequently Asked Questions|FAQ page]] to find out!<br />
<h2>Depenizen V0.2</h2><br />
If you used 0.1, you might notice that some tags were broken when updating to the latest builds. This was intentional, and mostly unavoidable in terms of the new Denizen 0.9 system, which is geared toward more object oriented systems. For example, previously in Denizen, using <player> would return the player's name. Now, it will return a dPlayer, represented by "p@", followed by the player's name. That being said, a tag such as <player.faction> will no longer return the faction name. To do that, you must now use <player.faction.name>.<br />
<br />
Other tags, such as <player.town.ismayor>, which would return whether or not the player is the mayor of his/her town, make no sense in this system. Instead, you should use "- if <player.town.mayor> == <player>"...</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen/Frequently_Asked_Questions&diff=4814Depenizen/Frequently Asked Questions2013-09-06T03:28:05Z<p>Morphan1: </p>
<hr />
<div><!-- Forced to use Wiki link formatting... Other than that, try to use HTML --><br />
<h2>What is Depenizen?</h2><br />
Depenizen is a simple plugin that does exactly what its name implies: depends on Denizen. It adds commands, tags, events, etc for use with other plugins (such as mcMMO, Factions, and Towny) into Denizen, so you can control everything that goes on and maximize the RPG feel you want for your server.<br />
<h2>How do I install Depenizen?</h2><br />
<ol><br />
<li>[[Installation|Install Citizens 2]]<br />
<li>Download the latest development version of [http://bit.ly/1aaGB3T Denizen], if you haven't already.<br />
<li>Download the latest development version of [http://bit.ly/1aaGEfY Depenizen].<br />
<li>Place the plugins in your plugins folder and restart your server.<br />
</ol><br />
<h2>What plugins does Depenizen currently support?</h2><br />
You can find a list of all supported plugins [[Supported Plugins|here]].<br />
<h2>I can has new supported plugin.</h2><br />
Sure, just ask us on the GitHub issues page [http://bit.ly/1aT7UCI here]. Be sure to include the plugin name, a link to the BukkitDev page, and details about what commands, tags, or events you want implemented into Depenizen. We'll get back to you as soon as possible.</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Depenizen/Frequently_Asked_Questions&diff=4813Depenizen/Frequently Asked Questions2013-09-06T03:15:06Z<p>Morphan1: Created page with "<h2>What is Depenizen?</h2> Depenizen is a simple plugin that does exactly what its name implies: depends on Denizen. It adds commands, tags, events, etc for use with other pl..."</p>
<hr />
<div><h2>What is Depenizen?</h2><br />
Depenizen is a simple plugin that does exactly what its name implies: depends on Denizen. It adds commands, tags, events, etc for use with other plugins (such as mcMMO, Factions, and Towny) into Denizen, so you can control everything that goes on and maximize the RPG feel you want for your server.<br />
<h2>How do I install Depenizen?</h2><br />
<ol><br />
<li>[[Installation|Install Citizens 2]]<br />
<li>Download the latest development version of [http://bit.ly/1aaGB3T Denizen], if you haven't already.<br />
<li>Download the latest development version of [http://bit.ly/1aaGEfY Depenizen].<br />
<li>Place the plugins in your plugins folder and restart your server.<br />
</ol></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Replaceable_Tags&diff=4708Denizen/Replaceable Tags2013-07-19T05:51:47Z<p>Morphan1: /* Util */</p>
<hr />
<div>__TOC__<br />
<br />
==Flags==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <flag.g:flag_name><br />
| Returns the value of a flag attached to the server. NOTE: In 0.9, it's more preferred to use <server.flag[flag_name]><br />
|-<br />
| <flag.n:flag_name><br />
| Returns the value of a flag attached to the current NPC. NOTE: In 0.9, it's more preferred to use <npc.flag[flag_name]><br />
|-<br />
| <flag.p:flag_name><br />
| Returns the value of a flag attached to the current player. NOTE: In 0.9, it's more preferred to use <player.flag[flag_name]><br />
|-<br />
|<player[player_name].flag[flag_name]><br />
|Returns the value of a flag for another player.<br />
|-<br />
|<player.flag[flag_name]>.isexpired><br />
|Returns true or false if the duration of a flag has expired.<br />
|}<br />
<br />
==Location==<br />
All location tags require coordinates. You can have tags in the brackets [] or you can specify exact locations by yourself. For example, you could use <pre><location[<npc.location>].biome.temperature></pre> to get the temperature at the NPC's location.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <location[x,y,z,world].biome.formatted><br />
| The formatted name of the biome at coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.humidity><br />
| The current humidity at the coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.temperature><br />
| The current temperature at the coordinates.<br />
|-<br />
| <location[x,y,z,world].distance[x,y,z,world]><br />
| The distance between 2 coordinates.<br />
|-<br />
| <location[x,y,z,world].formatted><br />
| The coordinates in an easier-to-read format.<br />
|-<br />
| <location[x,y,z,world].is_liquid><br />
| Whether or not the block at the coordinates are a liquid. Can be true or false.<br />
|-<br />
| <location[x,y,z,world].light><br />
| The light level at the coordinates.<br />
|}<br />
<br />
==NPC==<br />
NOTE: You can reference an NPC other than the one in the current script by using <npc[npc_id]>... So for example, <npc[2].id> (which would be completely useless) would return '2'.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <npc.flag[flag_name]><br />
| Returns the value of a flag attached to an NPC.<br />
|-<br />
| <npc.id><br />
| The ID number of the NPC.<br />
|-<br />
| <npc.location><br />
| The coordinates of the NPC. [x,y,z,world]<br />
|-<br />
| <npc.location.previous_location><br />
| The last location the NPC was at.<br />
|-<br />
| <npc.location.standing_on><br />
| The Bukkit block name that the NPC is standing on.<br />
|-<br />
| <npc.location.standing_on_display><br />
| The formatted block name that the NPC is standing on.<br />
|-<br />
| <npc.location.world><br />
| The name of the world the NPC is in.<br />
|-<br />
| <npc.location.world_spawn><br />
| The coordinates of the spawn of the world that the NPC is currently in.<br />
|-<br />
| <npc.location.x><br />
| The x coordinate the NPC is at.<br />
|-<br />
| <npc.location.y><br />
| The y coordinate the NPC is at.<br />
|-<br />
| <npc.location.z><br />
| The z coordinate the NPC is at.<br />
|-<br />
| <npc.name><br />
| The NPC's name.<br />
|-<br />
| <npc.name.nickname><br />
| The NPC's nickname.<br />
|-<br />
| <npc.owner><br />
| The owner of the NPC.<br />
|}<br />
<br />
==Player==<br />
NOTE: You can reference a player other than the one in the current script by using <player[player_name]>... So for example, <player[Morphan1].name> (which would be completely useless) would return 'Morphan1'.<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <player.chat_history><br />
| Last message the player sent.<br />
|-<br />
| <player.chat_history[X]><br />
| Message the player sent X times ago.<br />
|-<br />
| <player.equipment.boots><br />
| The Bukkit name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.equipment.boots.formatted><br />
| The formatted name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.flag[flag_name]><br />
| Returns the value of a flag attached to a player.<br />
|-<br />
| <player.health><br />
| The player's health, 1-20. Each number is half of a heart.<br />
|-<br />
| <player.health.formatted><br />
| The player's formatted health. Can be healthy, scraped, injured, seriously wounded, and dying.<br />
|-<br />
| <player.health.percentage><br />
| The player's health as a percentage.<br />
|-<br />
| <player.inventory.contains.display[display_name]><br />
| Checks if the player's inventory contains an item with a name chosen on an anvil. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.inventory.contains[item_id]><br />
| Checks if the player's inventory contains an item. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.food_level><br />
| The player's food level, 1-20. Each number is half of a thing-on-the-hunger-bar.<br />
|-<br />
| <player.food_level.formatted><br />
| The player's formatted food level. Can be healthy, parched, hungry, and famished.<br />
|-<br />
| <player.food_level.percentage><br />
| The player's food level as a percentage.<br />
|-<br />
| <player.group[group_name]><br />
| Checks if the player is in a group via Vault. Can be true or false.<br />
|-<br />
| <player.group[group_name].global>><br />
| Checks if the player is in a global group via Vault. Can be true or false.<br />
|-<br />
| <player.item_in_hand.enchantments><br />
| List of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level><br />
| List of enchantments and their levels on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level_only><br />
| List of levels of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand><br />
| Contains all details of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.data><br />
| The material data of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.display><br />
| The name chosen on an anvil for the item the player is holding.<br />
|-<br />
| <player.item_in_hand.durability><br />
| The durability of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.id><br />
| The ID of the block or item the player is holding. All block and item IDs are found [http://www.minecraftwiki.net/wiki/Data_values here].<br />
|-<br />
| <player.item_in_hand.lore><br />
| List of lore on item in the player's hand.<br />
|-<br />
| <player.item_in_hand.max_stack><br />
| The maximum amount you can have in one inventory slot of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.material><br />
| Bukkit material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.material.formatted><br />
| Formatted material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.qty><br />
| The current amount of the inventory slot of the item the player is holding.<br />
|-<br />
| <player.is_banned><br />
| Whether the player is banned. Can be true or false.<br />
|-<br />
| <player.is_online><br />
| Whether the player is online. Can be true or false.<br />
|-<br />
| <player.is_op><br />
| Whether the player is an operator. Can be true or false.<br />
|-<br />
| <player.location><br />
| The coordinates of the player. [x,y,z,world]<br />
|-<br />
| <player.location.bed_spawn><br />
| The coordinates of the last bed the player slept in, if any.<br />
|-<br />
| <player.location.cursor_on[X]><br />
| The location of the block the player's cursor is on, within X range.<br />
|-<br />
| <player.location.standing_on><br />
| The Bukkit block name that the player is standing on.<br />
|-<br />
| <player.location.standing_on.formatted><br />
| The formatted block name that the player is standing on.<br />
|-<br />
| <player.location.world><br />
| The name of the world the player is in.<br />
|-<br />
| <player.location.world_spawn><br />
| The coordinates of the spawn of the world that the player is currently in.<br />
|-<br />
| <player.location.x><br />
| The x coordinate the player is at.<br />
|-<br />
| <player.location.y><br />
| The y coordinate the player is at.<br />
|-<br />
| <player.location.z><br />
| The z coordinate the player is at.<br />
|-<br />
| <player.money><br />
| The amount of money in this player's account. Requires Vault and an economy plugin.<br />
|-<br />
| <player.name><br />
| The player's name.<br />
|-<br />
| <player.name.display><br />
| The player's display name. (The one that shows in chat.)<br />
|-<br />
| <player.mcmmo.level[skill_name]><br />
| The player's current level for an McMMO skill.<br />
|-<br />
| <player.money><br />
| How much money the player has, as a number. (0.0, 1.5, 2.25, etc.)<br />
|-<br />
| <player.money.asint><br />
| How much money the player has, as an integer. (0, 1, 2, etc.)<br />
|-<br />
| <player.money.currency><br />
| The currency set in this server's economy plugin.<br />
|-<br />
| <player.money.currency.plural><br />
| The currency set in this server's economy plugin, in its plural form.<br />
<br />
Examples: Dollars, pounds, coins<br />
|-<br />
| <player.money.currency.singular><br />
| The currency set in this server's economy plugin, in its singular form.<br />
<br />
Examples: Dollar, pound, coin<br />
|-<br />
| <player.script[script_name].failed><br />
| Checks if the player has failed a script. Can be true or false.<br />
|-<br />
| <player.script[script_name].finished><br />
| Checks if the player has finished a script. Can be true or false.<br />
|-<br />
| <player.time><br />
| The player's time in ticks, from 0 to 23999. For a quick view of what different tick values mean in real life hours, look [http://media-mcw.cursecdn.com/b/bc/Day_Night_Clock_24h.png here].<br />
|-<br />
| <player.time.period><br />
| The time period for this player. Can be "day" or "night".<br />
|-<br />
| <player.xp><br />
| The total experience of a player.<br />
|-<br />
| <player.xp.level><br />
| The current experience level of a player.<br />
|-<br />
| <player.weather><br />
| The current weather in this player's world. Is "storming" if there's a storm, "sunny" if the weather is clear and it's daytime, and "clear" if the weather is clear and it's nighttime.<br />
|}<br />
<br />
==Util==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <util.random.int[1].to[50]><br />
| Returns a random number between the lower bound (first number) and upper bound (second number).<br />
|-<br />
| width="30%" | <util.random.uuid><br />
| Returns a random "uuid" useful for starting new queues.<br />
|-<br />
| width="30%" | <util.substr[string]><br />
| Returns a substring of a string.<br />
|-<br />
|}<br />
<br />
==Math Tags==<br />
Math tags are a useful part of Denizen that, as the name implies, allows you to perform mathematical operations internally.<br />
<br />
Here's the general syntax, with spaces for readability.<br />
<p><br />
<code> <br />
<m: firstThing + secondThing> <br />
//Now, all together,<br />
<m:firstThing+secondThing><br />
</code><br />
<p><br />
Of course, + isn't the only mathematical operator that can be used. You can also use:<br />
Minus and Modulus: (- and %)<br />
Divide and Multiply: (/ and *)<br />
<br />
==Text==<br />
<br />
===Colors===<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="25%" border="1"<br />
|-<br />
| width="60%" | <aqua><br />
| style="background-color:#55FFFF" |<br />
|-<br />
| <black><br />
| style="background-color:black" |<br />
|-<br />
| <blue><br />
| style="background-color:#5555FF" |<br />
|-<br />
| <dark_aqua><br />
| style="background-color:#00AAAA" |<br />
|-<br />
| <dark_blue><br />
| style="background-color:#0000AA" |<br />
|-<br />
| <dark_gray><br />
| style="background-color:#555555" |<br />
|-<br />
| <dark_green><br />
| style="background-color:#00AA00" |<br />
|-<br />
| <dark_purple><br />
| style="background-color:#AA00AA" |<br />
|-<br />
| <dark_red><br />
| style="background-color:#AA0000" |<br />
|-<br />
| <gold><br />
| style="background-color:#FFAA00" |<br />
|-<br />
| <gray><br />
| style="background-color:#AAAAAA" |<br />
|-<br />
| <green><br />
| style="background-color:#55FF55" |<br />
|-<br />
| <light_purple><br />
| style="background-color:#FF55FF" |<br />
|-<br />
| <red><br />
| style="background-color:#FF5555" |<br />
|-<br />
| <white><br />
| style="background-color:white" |<br />
|-<br />
| <yellow><br />
| style="background-color:#FFFF55" |<br />
|}<br />
<br />
==Pssst...==<br />
http://pastebin.com/KBADLinZ<br><br />
Here is a summary of them :)<br><br />
-Jeebs</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4703Denizen/Commands2013-07-16T19:51:27Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|if|<nowiki>[<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>] (else <commands>)</nowiki><br />
|Compares one value to another and if the outcome is true, the commands inside the 'if' statement will be run and no more comparables will be checked. If it is false, the next 'else if', if there is one, will be compared, and if that is true, the commands in that 'else if' will be run and no more comparables will be checked. This will continue happening until the script either runs out of comparables or reaches an 'else', in which case the commands inside the 'else' will be run and the script will continue.<br />
<br />
For more info, [[Denizen/Commands/If|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- if "<player.inventory.contains[1]> announce "Hahaha! <player.name> has no stone!"<br />
- if <player.name> == "davidcernat" execute as_server "ban <player.name>"<br />
- if <context.message.contains[Bob]> announce "<player.name> said Bob! Smite them!"<br />
else if <player.name.contains[Bob]> announce "<player.name>'s name contains Bob! Smite them!"<br />
else {<br />
- announce "No mention of Bob can be found. Proceeding with life..."<br />
- run Life delay:0s<br />
}<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|log|<nowiki>[<text>] (type:severe/info/warning/fine/finer/finest) [file:<name>]</nowiki><br />
|Logs whatever text you want into a file inside the main server folder. If the file doesn't exist, it will create it.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- log "Something happened!" "file:Denizen.log"<br />
- log "Bob punched Joe!" "file:logs/DenizenLog.txt"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|new|<nowiki>[itemstack/entity/npc] [id:<name>] (<item> qty:<#>)</nowiki><br />
|Creates a new object for use in scripts.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- new itemstack id:StackOfBricks1 brick qty:64 l@123,69,321,world<br />
- new entity l@123,69,321,world<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4702Denizen/Commands2013-07-16T19:05:03Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|if|<nowiki>[<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>] (else <commands>)</nowiki><br />
|Compares one value to another and if the outcome is true, the commands inside the 'if' statement will be run and no more comparables will be checked. If it is false, the next 'else if', if there is one, will be compared, and if that is true, the commands in that 'else if' will be run and no more comparables will be checked. This will continue happening until the script either runs out of comparables or reaches an 'else', in which case the commands inside the 'else' will be run and the script will continue.<br />
<br />
For more info, [[Denizen/Commands/If|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- if "<player.inventory.contains[1]> announce "Hahaha! <player.name> has no stone!"<br />
- if <player.name> == "davidcernat" execute as_server "ban <player.name>"<br />
- if <context.message.contains[Bob]> announce "<player.name> said Bob! Smite them!"<br />
else if <player.name.contains[Bob]> announce "<player.name>'s name contains Bob! Smite them!"<br />
else {<br />
- announce "No mention of Bob can be found. Proceeding with life..."<br />
- run Life delay:0s<br />
}<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|log|<nowiki>[<text>] (type:severe/info/warning/fine/finer/finest) [file:<name>]</nowiki><br />
|Logs whatever text you want into a file inside the main server folder. If the file doesn't exist, it will create it.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- log "Something happened!" "file:Denizen.log"<br />
- log "Bob punched Joe!" "file:logs/DenizenLog.txt"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4701Denizen/Commands2013-07-16T18:38:53Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|if|<nowiki>[<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>] (else <commands>)</nowiki><br />
|Compares one value to another and if the outcome is true, the commands inside the 'if' statement will be run and no more comparables will be checked. If it is false, the next 'else if', if there is one, will be compared, and if that is true, the commands in that 'else if' will be run and no more comparables will be checked. This will continue happening until the script either runs out of comparables or reaches an 'else', in which case the commands inside the 'else' will be run and the script will continue.<br />
<br />
For more info, [[Denizen/Commands/If|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- if "<player.inventory.contains[1]> announce "Hahaha! <player.name> has no stone!"<br />
- if <player.name> == "davidcernat" execute as_server "ban <player.name>"<br />
- if <context.message.contains[Bob]> announce "<player.name> said Bob! Smite them!"<br />
else if <player.name.contains[Bob]> announce "<player.name>'s name contains Bob! Smite them!"<br />
else {<br />
- announce "No mention of Bob can be found. Proceeding with life..."<br />
- run Life delay:0s<br />
}<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4700Denizen/Commands2013-07-16T18:36:14Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|if|<nowiki>[<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>] (else <commands>)</nowiki><br />
|Compares one value to another and if the outcome is true, the commands inside the 'if' statement will be run and no more comparables will be checked. If it is false, the next 'else if', if there is one, will be compared, and if that is true, the commands in that 'else if' will be run and no more comparables will be checked. This will continue happening until the script either runs out of comparables or reaches an 'else', in which case that 'else' will be compared and if the outcome is true, the commands inside the 'else' will be run and the script will continue. If it is not true, it will simply be ignored and the script will continue.<br />
<br />
For more info, [[Denizen/Commands/If|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- if "<player.inventory.contains[1]> announce "Hahaha! <player.name> has no stone!"<br />
- if <player.name> == "davidcernat" execute as_server "ban <player.name>"<br />
- if <context.message.contains[Bob]> announce "<player.name> said Bob! Smite them!"<br />
else if <player.name.contains[Bob]> announce "<player.name>'s name contains Bob! Smite them!"<br />
else {<br />
- announce "No mention of Bob can be found. Proceeding with life..."<br />
- run Life delay:0s<br />
}<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4699Denizen/Commands2013-07-16T18:35:00Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|if|<nowiki>[<value>] (!)(<operator> <value>) (&&/|| ...) [<commands>] (else <commands>)<br />
|Compares one value to another and if the outcome is true, the commands inside the 'if' statement will be run and no more comparables will be checked. If it is false, the next 'else if', if there is one, will be compared, and if that is true, the commands in that 'else if' will be run and no more comparables will be checked. This will continue happening until the script either runs out of comparables or reaches an 'else', in which case that 'else' will be compared and if the outcome is true, the commands inside the 'else' will be run and the script will continue. If it is not true, it will simply be ignored and the script will continue.<br />
<br />
For more info, [[Denizen/Commands/If|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- if "<player.inventory.contains[1]> announce "Hahaha! <player.name> has no stone!"<br />
- if <player.name> == "davidcernat" execute as_server "ban <player.name>"<br />
- if <context.message.contains[Bob]> announce "<player.name> said Bob! Smite them!"<br />
else if <player.name.contains[Bob]> announce "<player.name>'s name contains Bob! Smite them!"<br />
else {<br />
- announce "No mention of Bob can be found. Proceeding with life..."<br />
- run Life delay:0s<br />
}<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4698Denizen/Commands2013-07-16T17:59:10Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|define|[<id>] [<value>]<br />
|Similar to a flag, this command sets a global variable to any value that can later be called back anywhere by using %id%.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- define "lastplayer" "<player.name>"<br />
- define "player_<player.name>'s_home" "<player.location>"<br />
- announce "%lastplayer% set their home at %player_<player.name>'s_home%! Go raid it!"<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4697Denizen/Commands2013-07-16T17:50:30Z<p>Morphan1: </p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===Entity===<br />
<br />
===Item===<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4696Denizen/Commands2013-07-16T17:49:54Z<p>Morphan1: </p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4695Denizen/Commands2013-07-16T17:47:15Z<p>Morphan1: /* World interaction */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4694Denizen/Commands2013-07-16T17:47:04Z<p>Morphan1: /* Player interaction */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World interaction===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4693Denizen/Commands2013-07-16T17:46:51Z<p>Morphan1: /* Messages */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Server===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player interaction===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World interaction===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4692Denizen/Commands2013-07-16T17:45:23Z<p>Morphan1: /* Denizen interaction */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Messages===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===NPC===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player interaction===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World interaction===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4691Denizen/Commands2013-07-16T17:45:05Z<p>Morphan1: /* Denizen interaction */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Messages===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===Denizen interaction===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
===Player interaction===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World interaction===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4690Denizen/Commands2013-07-16T17:44:15Z<p>Morphan1: /* Script flow */</p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Messages===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===Denizen interaction===<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
<br />
<br />
===Player interaction===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World interaction===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}<br />
<br />
= Creating your own Denizen command =<br />
Aufdemrand made a tutorial for the 0.9 version of Denizen on how to create a new command for denizen.<br />
Check it out here: [https://www.youtube.com/watch?v=Sd7zoWT24Xw Denizen 0.9 Command Tutorial].</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Introduction&diff=4689Denizen/Introduction2013-07-16T17:42:17Z<p>Morphan1: </p>
<hr />
<div>Denizen, powered by Citizens2 and Bukkit, is an extensive add-on pack that allows for a scriptable Minecraft experience, including enhanced NPCs, custom commands, items, world events and many other features. Inspired by MUDs, features and NPCs powered by Denizen have a unique RPG feel unmatched by any other Bukkit-only solution. Imagine interactive gate-keepers, magic spells, magical wizards, experience trainers, experience and player-stat systems, bankers that have bankers’ hours, talking townspeople, magical quests, and more! Denizen can be used in thousands of different ways, from tutorials, to gameplay, to administering --- your imagination is the limit!<br />
<br />
By sharing your scripts, you can enable the most exciting feature. Since dScript, the language that powers Denizen, is made to be easily read, users can share and tweak scripts to fit their needs with ease. Many can already be found online in the [http://scripts.citizensnpcs.com Citizens Script Repository]. <br />
<br />
While we are currently still in pre-release beta, the YAML-based dScript is becoming a fully featured core-set of features that can control your server in hundreds of ways. If that’s not enough, there’s also many ways to extend the functionality since Denizen is being programmed with a fully featured Java API in mind. With some simple Java, it’s easy to make your own dScript commands, requirements, script containers, tags, triggers, and many more. Many plugin developers are already extending their plugins with custom Denizen content for easy use with scripts, and by the time one point ‘o’ hits, we hope your plugins will take notice as well!<br />
<br />
= Getting Started =<br />
It’s hard to find a good ‘start point’ when using Denizen, since there are many different scopes, but let’s first take a look at the basic functionality and control of Denizen provided by the use of craftbukkit commands. Since Denizen uses the C2 command system, you may already be familiar with the system.<br />
<br />
== How to use server commands ==<br />
All commands have a ‘base_command’, a ‘command_name’ and either string values, integer values, value flags (--flag value) or non-value flags (-t). Some commands may use multiple flags at a time. Consider the examples below. <br />
<br />
<pre>/base_command command_name string value --flag value -t<br />
/npc trigger damage --cooldown 5 -t</pre><br />
<br />
<pre>Note: Value flags which contain more than one word must be enclosed in quotes. <br />
<br />
/base_command command_name --flag “multi word value” --another_flag another_value -t -f<br />
/npc constant --name ‘Default Greeting Text’ --value ‘Hello, player!’</pre><br />
<br />
<pre>Commands that provide multiple pages of feedback can include an integer number to specify page with some commands. If no number is specified, page 1 is assumed.<br />
<br />
/base_command command_name 3<br />
/denizen scripts 3</pre><br />
<br />
== Denizen console commands ==<br />
Denizen commands provide a way to view and configure key components of Denizen, such as version checking and script listings.<br />
<br />
<pre>/denizen version<br />
<br />
Displays the version and build information about the copy of denizen currently loaded. Will also show currently loaded ‘extensibles’.<br />
Usage: <br />
/denizen version</pre><br />
<br />
<pre>/denizen save<br />
<br />
Saves the contents of the ‘dScript saves’ in memory to disk as saves.yml. Useful for editing the contents while the server is running, using /denizen reload. <br />
When using Denizen on a production server, there are key events that auto-save the saves.yml, so it’s encouraged that saves.yml be edited only while the server is off. When using on a development server, server action should be brought to a minimum while editing saves.yml.<br />
Usage:<br />
/denizen save</pre><br />
<br />
<pre>/denizen reload<br />
<br />
Reloads key disk files into memory, overwriting the copy currently in memory. Must specify which file to reload, or -a for all. Valid values are: scripts, saves, config or the -a flag.<br />
<br />
Note: When reloading the config, some values require a server-reboot to take effect.<br />
Usage: <br />
/denizen reload scripts|saves|config|-a<br />
<br />
Example Usages:<br />
/denizen reload -a<br />
/denizen reload scripts</pre><br />
<br />
<pre>/denizen debug<br />
<br />
Enables or disables the dBugger which can be very useful when writing and troublshooting script flow and any problems that may occur. <br />
Using the -s flag will toggle stacktraces, allowing some nitty-gritty error messages to slip through for when something seriously goes on. If getting help, it’s likely that we’ll ask you to enable this and provide us with the feedback. Using the -c flag will toggle color.<br />
Usage: <br />
/denizen debug (-c) (-s)<br />
<br />
Example Usages:<br />
/denizen debug<br />
/denizen debug -c</pre><br />
<br />
<pre>/denizen scripts<br />
<br />
Shows a list of scripts currently loaded into Denizen. Used alone, it lists all scripts, identified by type and name. Use an integer to specify which page to view. <br />
<br />
Using the type flag will cut down the search results to a specific type.<br />
Using the filter flag will limit results to a specific search string.<br />
Usage: <br />
/denizen scripts (--filter key_word) (--type script_container_type) (#)<br />
<br />
Example Usages:<br />
/denizen scripts --filter ‘bob quest’ 2<br />
/denizen scripts --type task</pre><br />
<br />
<pre>/denizen listener<br />
<br />
Shows a list of active listeners for a player. Use the player flag to specify a different player. Use an integer to specify a page.<br />
<br />
Using the finish flag will force-finish the listener, running the script the was specified in the original listen script command.<br />
Using the cancel flag will cancel the listener, effectively removing it.<br />
Using the report flag will output the status of the listener.<br />
Usage: <br />
/denizen listener (--player player_name) (--finish|report|cancel listener_id)<br />
<br />
Example Usages:<br />
/denizen listener --report apple_quest_1<br />
/denizen listener --player aufdemrand 2</pre><br />
<br />
== NPC console commands ==<br />
To provide add-on features seamlessly to Citizens, Denizen extends the /npc bukkit command to provide an interface with the additional traits added. Some commands listed here are core Citizens commands, provided here since they are commonly used with Denizen features. (DENIZEN! indicates new NPC commands that are available only with Denizen.)<br />
<br />
<pre>/npc create<br />
<br />
The command to create a new NPC. Must provide a string name. Can also specify a type flag which will change the EntityType of the NPC.<br />
<br />
Examples:<br />
/npc create Jack<br />
/npc create Henry the Great --type enderman<br />
/npc create Susan --type cow</pre><br />
<br />
<pre>/npc select<br />
<br />
Selects a NPC to work with. Used alone, it will select the nearest NPC in range. A npcid may also be specified to select a specific NPC.<br />
<br />
Examples:<br />
/npc select<br />
/npc select 10</pre><br />
<br />
<pre>/npc vulnerable<br />
<br />
Allows a NPC to be damaged, and killed. Also required (in most cases) when using the ‘health trait’ that is provided with Denizen. Use the -t flag to indicate the vulnerability to be temporary. When temporary, vulnerability will not persist through a restart.<br />
<br />
Examples:<br />
/npc vulnerable<br />
/npc vulnerable -t</pre><br />
<br />
<pre>DENIZEN! /npc assignment<br />
<br />
Used to specify and view the current assignment of an NPC. Also adds the trigger and constants trait to the NPC. To set an assignment, use the set flag with the name of the script as a value. Remember: Only assignment-type scripts can be assigned. To view information on the current assignment, use /npc assignment. Using the -r flag will remove the current assignment.<br />
<br />
Examples:<br />
/npc assignment<br />
/npc assignment --set ‘town sheriff’</pre><br />
<br />
<pre>DENIZEN! /npc trigger<br />
<br />
Controls the various settings of interact-script triggers. To specify a trigger, use a string of the name. Use in combination of the -t flag to toggle the trigger on or off. Using the cooldown flag allows the default cooldown for a trigger to be overridden on a NPC level. Changing the cooldown in this manner only affects the selected NPC. Triggers with range settings can also be modified using the radius flag. Using /npc trigger alone displays an overview of all available triggers for the selected NPC.<br />
<br />
Examples:<br />
/npc trigger<br />
/npc trigger chat -t<br />
/npc trigger proximity --radius 15<br />
/npc trigger damage --cooldown 0.5</pre><br />
<br />
<pre>DENIZEN! /npc constant<br />
<br />
Constants are saved strings, or ‘pre-set variables’ that can be set in either an assignment script, or specified at the NPC-level. Constants set to a NPC will override any values also found set in an assignment. With the use of the /npc constant server command, dScripts can be ‘configurable’ in-game.<br />
To set a constant, use the set flag with a value of the constant name, along with a value flag along with the new value of the constant. Constants can also be removed using the remove flag. Using /npc constant will show any constants currently known to the specified NPC.<br />
<br />
Examples:<br />
/npc constant --remove allowed_items<br />
/npc constant --set ‘welcome message’ --value ‘Welcome to my village!’<br />
<br />
Note: Constants are available for use within dScripts with use of a constant replaceable tag. </pre><br />
<br />
<pre>DENIZEN! /npc health<br />
<br />
Modifies the current and maximum health of a NPC. While being vulnerable is not required, NPCs cannot lose any health without being vulnerable. By default, NPCs are invulnerable, unable to be damaged. Using the set flag will specify a new max-health. Using the -r flag will reset the NPCs current health to max. Using /npc health with no additional arguments will provide current status.<br />
<br />
Examples:<br />
/npc health<br />
/npc health --set 100<br />
/npc health -r</pre><br />
<br />
<pre><br />
/npc playerlist<br />
<br />
In order for vulnerable NPCs to be attacked by Minecraft Monsters, the NPC must be added back into the Bukkit Playerlist. This treats a NPC like a Player, and should be noted that it could conflict with some external plugins. When using this feature, there may also be slightly increased overhead, so it should only be used when necessary.<br />
<br />
Examples:<br />
/npc playerlist<br />
<br />
Note: /npc playerlist only works on Player-Type NPCs.</pre><br />
<br />
<pre>DENIZEN! /npc nickname<br />
<br />
Nicknames are NPC names on steroids. They are similar to Player display names, but also allow for a level of dynamic content to be used, since they allow the use of replaceable tags. Use the set flag to change a NPCs nickname. When used without any flags, the current nickname is shown. To remove a nickname, use the -r flag.<br />
<br />
Examples:<br />
/npc nickname<br />
/npc nickname -r<br />
/npc nickname --set ‘<magic><npc.name><gold>, <br />
the friendly Wizard’<br />
/npc nickname --set ‘<npc.name>, of Clan<br />
<flag.n:clan_name>’<br />
<br />
Note: Nicknames, at this time, do not affect the ‘nameplate’ above player-type NPCs. This feature request may become possible in the future. To reference a NPCs nickname use the <npc.name.nickname> tag.</pre><br />
<br />
<pre>DENIZEN! /npc pushable<br />
<br />
Moves NPCs out of the way when colliding with a Player. Default Citizens behavior is to allow clipping on NPC objects, allowing Players and NPCs to occupy the same space. Can also specify that the NPC be returnable using the -r flag. After being pushed, a returnable NPC will return to its previous location after a delay, which can be specified with the delay flag. Once the pushable trait is enabled, the actual push behavior can be toggled with the -t flag.<br />
<br />
Examples:<br />
/npc pushable<br />
/npc pushable -r --delay 6<br />
/npc pushable -t</pre><br />
<br />
<pre>DENIZEN! /npc FISH/STOPFISHING<br />
<br />
Makes the NPC cast a fishing line to a position specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor by using the anchor flag with the name of the anchor as the value. If you wish to make the NPC cast to the location of your cursor, use the -c flag. Using the /npc stopfishing command, the NPC will reel in its line.<br />
<br />
Examples:<br />
/npc fish --location 128,64,64,world<br />
/npc fish -c<br />
/npc fish --anchor chair_location<br />
/npc stopfishing</pre><br />
<br />
<pre>DENIZEN! /npc SIT/STAND<br />
<br />
Puts the NPC in the sitting position. If a specific location is desired, it can be specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor can be specified by using the anchor flag with the name of the anchor as the value. If you wish to make the NPC sit on the location of your cursor, use the -c flag. Using the /npc stand command, or initiating navigation on a NPC will make the NPC assume a standing postion.<br />
<br />
Examples:<br />
/npc sit --location 128,64,64,world<br />
/npc sit<br />
/npc sit --anchor chair_location<br />
/npc sit -c<br />
/npc stand</pre><br />
<br />
<pre>DENIZEN! /npc SLEEP/WAKEUP<br />
<br />
Makes the NPC sleep on a position specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor by using the anchor flag with the name of the anchor as the value. When using the /npc wakeup command, the NPC will stop sleeping.<br />
<br />
Examples:<br />
/npc sleep --location 128,64,64,world<br />
/npc sleep --anchor chair_location<br />
/npc wakeup</pre><br />
<br />
<pre>DENIZEN! /npc NAMEPLATE<br />
<br />
Changes the color of a NPCs nameplate. <br />
<br />
Examples:<br />
/npc nameplate red</pre><br />
<br />
== Experimental commands ==<br />
These are some commands that are currently in Denizen that are considered ‘experimental’. Expect the syntax and usage of these commands to be changed before the final release.<br />
<br />
<pre>/dtime #<br />
<br />
To be used with the World Script ‘On Time’ event. Minecraft time 0 = 6:00 in dTime. dTime is based on a 24 hour clock.<br />
<br />
Examples:<br />
/dtime 6<br />
/dtime 23</pre><br />
<br />
<pre>/notable add<br />
<br />
Adds a ‘notable location’ which is used throughout Denizen asa ‘location bookmark’ of sorts. Used in the World Script event ‘on walk over...’. Use the name flag to name the location.<br />
<br />
Examples:<br />
/notable add ‘secret spot 1’<br />
/notable add treasure</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Introduction&diff=4688Denizen/Introduction2013-07-16T17:34:30Z<p>Morphan1: </p>
<hr />
<div>Denizen, powered by Citizens2 and Bukkit, is an extensive add-on pack that allows for a scriptable Minecraft experience, including enhanced NPCs, custom commands, items, world events and many other features. Inspired by MUDs, features and NPCs powered by Denizen have a unique RPG feel unmatched by any other Bukkit-only solution. Imagine interactive gate-keepers, magic spells, magical wizards, experience trainers, experience and player-stat systems, bankers that have bankers’ hours, talking townspeople, magical quests, and more! Denizen can be used in thousands of different ways, from tutorials, to gameplay, to administering --- your imagination is the limit!<br />
<br />
By sharing your scripts, you can enable the most exciting feature. Since dScript, the language that powers Denizen, is made to be easily read, users can share and tweak scripts to fit their needs with ease. Many can already be found online in the [http://scripts.citizensnpcs.com Citizens Script Repository]. <br />
<br />
While we are currently still in pre-release beta, the YAML-based dScript is becoming a fully featured core-set of features that can control your server in hundreds of ways. If that’s not enough, there’s also many ways to extend the functionality since Denizen is being programmed with a fully featured Java API in mind. With some simple Java, it’s easy to make your own dScript commands, requirements, script containers, tags, triggers, and many more. Many plugin developers are already extending their plugins with custom Denizen content for easy use with scripts, and by the time one point ‘o’ hits, we hope your plugins will take notice as well!<br />
<br />
= Getting Started =<br />
It’s hard to find a good ‘start point’ when using Denizen, since there are many different scopes, but let’s first take a look at the basic functionality and control of Denizen provided by the use of craftbukkit commands. Since Denizen uses the C2 command system, you may already be familiar with the system.<br />
<br />
== How to use server commands ==<br />
All commands have a ‘base_command’, a ‘command_name’ and either string values, integer values, value flags (--flag value) or non-value flags (-t). Some commands may use multiple flags at a time. Consider the examples below. <br />
<br />
<pre>/base_command command_name string value --flag value -t<br />
/npc trigger damage --cooldown 5 -t</pre><br />
<br />
<pre>Note: Value flags which contain more than one word must be enclosed in quotes. <br />
<br />
/base_command command_name --flag “multi word value” --another_flag another_value -t -f<br />
/npc constant --name ‘Default Greeting Text’ --value ‘Hello, player!’</pre><br />
<br />
<pre>Commands that provide multiple pages of feedback can include an integer number to specify page with some commands. If no number is specified, page 1 is assumed.<br />
<br />
/base_command command_name 3<br />
/denizen scripts 3</pre><br />
<br />
== Denizen console commands ==<br />
Denizen commands provide a way to view and configure key components of Denizen, such as version checking and script listings.<br />
<br />
<pre>/denizen version<br />
<br />
Displays the version and build information about the copy of denizen currently loaded. Will also show currently loaded ‘extensibles’.<br />
Usage: <br />
/denizen version/</pre><br />
<br />
<pre>/denizen save<br />
<br />
Saves the contents of the ‘dScript saves’ in memory to disk as saves.yml. Useful for editing the contents while the server is running, using /denizen reload. <br />
When using Denizen on a production server, there are key events that auto-save the saves.yml, so it’s encouraged that saves.yml be edited only while the server is off. When using on a development server, server action should be brought to a minimum while editing saves.yml.<br />
Usage:<br />
/denizen save</pre><br />
<br />
<pre>/denizen reload<br />
<br />
Reloads key disk files into memory, overwriting the copy currently in memory. Must specify which file to reload, or -a for all. Valid values are: scripts, saves, config or the -a flag.<br />
<br />
Note: When reloading the config, some values require a server-reboot to take effect.<br />
Usage: <br />
/denizen reload scripts|saves|config|-a<br />
<br />
Example Usages:<br />
/denizen reload -a<br />
/denizen reload scripts</pre><br />
<br />
<pre>/denizen debug<br />
<br />
Enables or disables the dBugger which can be very useful when writing and troublshooting script flow and any problems that may occur. <br />
Using the -s flag will toggle stacktraces, allowing some nitty-gritty error messages to slip through for when something seriously goes on. If getting help, it’s likely that we’ll ask you to enable this and provide us with the feedback. Using the -c flag will toggle color.<br />
Usage: <br />
/denizen debug (-c) (-s)<br />
<br />
Example Usages:<br />
/denizen debug<br />
/denizen debug -c</pre><br />
<br />
<pre>/denizen scripts<br />
<br />
Shows a list of scripts currently loaded into Denizen. Used alone, it lists all scripts, identified by type and name. Use an integer to specify which page to view. <br />
<br />
Using the type flag will cut down the search results to a specific type.<br />
Using the filter flag will limit results to a specific search string.<br />
Usage: <br />
/denizen scripts (--filter key_word) (--type script_container_type) (#)<br />
<br />
Example Usages:<br />
/denizen scripts --filter ‘bob quest’ 2<br />
/denizen scripts --type task</pre><br />
<br />
<pre>/denizen listener<br />
<br />
Shows a list of active listeners for a player. Use the player flag to specify a different player. Use an integer to specify a page.<br />
<br />
Using the finish flag will force-finish the listener, running the script the was specified in the original listen script command.<br />
Using the cancel flag will cancel the listener, effectively removing it.<br />
Using the report flag will output the status of the listener.<br />
Usage: <br />
/denizen listener (--player player_name) (--finish|report|cancel listener_id)<br />
<br />
Example Usages:<br />
/denizen listener --report apple_quest_1<br />
/denizen listener --player aufdemrand 2</pre><br />
<br />
== NPC console commands ==<br />
To provide add-on features seamlessly to Citizens, Denizen extends the /npc bukkit command to provide an interface with the additional traits added. Some commands listed here are core Citizens commands, provided here since they are commonly used with Denizen features. (DENIZEN! indicates new NPC commands that are available only with Denizen.)<br />
<br />
<pre>/npc create<br />
<br />
The command to create a new NPC. Must provide a string name. Can also specify a type flag which will change the EntityType of the NPC.<br />
<br />
Examples:<br />
/npc create Jack<br />
/npc create Henry the Great --type enderman<br />
/npc create Susan --type cow</pre><br />
<br />
<pre>/npc select<br />
<br />
Selects a NPC to work with. Used alone, it will select the nearest NPC in range. A npcid may also be specified to select a specific NPC.<br />
<br />
Examples:<br />
/npc select<br />
/npc select 10</pre><br />
<br />
<pre>/npc vulnerable<br />
<br />
Allows a NPC to be damaged, and killed. Also required (in most cases) when using the ‘health trait’ that is provided with Denizen. Use the -t flag to indicate the vulnerability to be temporary. When temporary, vulnerability will not persist through a restart.<br />
<br />
Examples:<br />
/npc vulnerable<br />
/npc vulnerable -t</pre><br />
<br />
<pre>DENIZEN! /npc assignment<br />
<br />
Used to specify and view the current assignment of an NPC. Also adds the trigger and constants trait to the NPC. To set an assignment, use the set flag with the name of the script as a value. Remember: Only assignment-type scripts can be assigned. To view information on the current assignment, use /npc assignment. Using the -r flag will remove the current assignment.<br />
<br />
Examples:<br />
/npc assignment<br />
/npc assignment --set ‘town sheriff’</pre><br />
<br />
<pre>DENIZEN! /npc trigger<br />
<br />
Controls the various settings of interact-script triggers. To specify a trigger, use a string of the name. Use in combination of the -t flag to toggle the trigger on or off. Using the cooldown flag allows the default cooldown for a trigger to be overridden on a NPC level. Changing the cooldown in this manner only affects the selected NPC. Triggers with range settings can also be modified using the radius flag. Using /npc trigger alone displays an overview of all available triggers for the selected NPC.<br />
<br />
Examples:<br />
/npc trigger<br />
/npc trigger chat -t<br />
/npc trigger proximity --radius 15<br />
/npc trigger damage --cooldown 0.5</pre><br />
<br />
<pre>DENIZEN! /npc constant<br />
<br />
Constants are saved strings, or ‘pre-set variables’ that can be set in either an assignment script, or specified at the NPC-level. Constants set to a NPC will override any values also found set in an assignment. With the use of the /npc constant server command, dScripts can be ‘configurable’ in-game.<br />
To set a constant, use the set flag with a value of the constant name, along with a value flag along with the new value of the constant. Constants can also be removed using the remove flag. Using /npc constant will show any constants currently known to the specified NPC.<br />
<br />
Examples:<br />
/npc constant --remove allowed_items<br />
/npc constant --set ‘welcome message’ --value ‘Welcome to my village!’<br />
<br />
Note: Constants are available for use within dScripts with use of a constant replaceable tag. </pre><br />
<br />
<pre>DENIZEN! /npc health<br />
<br />
Modifies the current and maximum health of a NPC. While being vulnerable is not required, NPCs cannot lose any health without being vulnerable. By default, NPCs are invulnerable, unable to be damaged. Using the set flag will specify a new max-health. Using the -r flag will reset the NPCs current health to max. Using /npc health with no additional arguments will provide current status.<br />
<br />
Examples:<br />
/npc health<br />
/npc health --set 100<br />
/npc health -r</pre><br />
<br />
<pre><br />
/npc playerlist<br />
<br />
In order for vulnerable NPCs to be attacked by Minecraft Monsters, the NPC must be added back into the Bukkit Playerlist. This treats a NPC like a Player, and should be noted that it could conflict with some external plugins. When using this feature, there may also be slightly increased overhead, so it should only be used when necessary.<br />
<br />
Examples:<br />
/npc playerlist<br />
<br />
Note: /npc playerlist only works on Player-Type NPCs.</pre><br />
<br />
<pre>DENIZEN! /npc nickname<br />
<br />
Nicknames are NPC names on steroids. They are similar to Player display names, but also allow for a level of dynamic content to be used, since they allow the use of replaceable tags. Use the set flag to change a NPCs nickname. When used without any flags, the current nickname is shown. To remove a nickname, use the -r flag.<br />
<br />
Examples:<br />
/npc nickname<br />
/npc nickname -r<br />
/npc nickname --set ‘<magic><npc.name><gold>, <br />
the friendly Wizard’<br />
/npc nickname --set ‘<npc.name>, of Clan<br />
<flag.n:clan_name>’<br />
<br />
Note: Nicknames, at this time, do not affect the ‘nameplate’ above player-type NPCs. This feature request may become possible in the future. To reference a NPCs nickname use the <npc.name.nickname> tag.</pre><br />
<br />
<pre>DENIZEN! /npc pushable<br />
<br />
Moves NPCs out of the way when colliding with a Player. Default Citizens behavior is to allow clipping on NPC objects, allowing Players and NPCs to occupy the same space. Can also specify that the NPC be returnable using the -r flag. After being pushed, a returnable NPC will return to its previous location after a delay, which can be specified with the delay flag. Once the pushable trait is enabled, the actual push behavior can be toggled with the -t flag.<br />
<br />
Examples:<br />
/npc pushable<br />
/npc pushable -r --delay 6<br />
/npc pushable -t</pre><br />
<br />
<pre>DENIZEN! /npc FISH/STOPFISHING<br />
<br />
Makes the NPC cast a fishing line to a position specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor by using the anchor flag with the name of the anchor as the value. If you wish to make the NPC cast to the location of your cursor, use the -c flag. Using the /npc stopfishing command, the NPC will reel in its line.<br />
<br />
Examples:<br />
/npc fish --location 128,64,64,world<br />
/npc fish -c<br />
/npc fish --anchor chair_location<br />
/npc stopfishing</pre><br />
<br />
<pre>DENIZEN! /npc SIT/STAND<br />
<br />
Puts the NPC in the sitting position. If a specific location is desired, it can be specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor can be specified by using the anchor flag with the name of the anchor as the value. If you wish to make the NPC sit on the location of your cursor, use the -c flag. Using the /npc stand command, or initiating navigation on a NPC will make the NPC assume a standing postion.<br />
<br />
Examples:<br />
/npc sit --location 128,64,64,world<br />
/npc sit<br />
/npc sit --anchor chair_location<br />
/npc sit -c<br />
/npc stand</pre><br />
<br />
<pre>DENIZEN! /npc SLEEP/WAKEUP<br />
<br />
Makes the NPC sleep on a position specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor by using the anchor flag with the name of the anchor as the value. When using the /npc wakeup command, the NPC will stop sleeping.<br />
<br />
Examples:<br />
/npc sleep --location 128,64,64,world<br />
/npc sleep --anchor chair_location<br />
/npc wakeup</pre><br />
<br />
<pre>DENIZEN! /npc NAMEPLATE<br />
<br />
Changes the color of a NPCs nameplate. <br />
<br />
Examples:<br />
/npc nameplate red</pre><br />
<br />
== Experimental commands ==<br />
These are some commands that are currently in Denizen that are considered ‘experimental’. Expect the syntax and usage of these commands to be changed before the final release.<br />
<br />
<pre>/dtime #<br />
<br />
To be used with the World Script ‘On Time’ event. Minecraft time 0 = 6:00 in dTime. dTime is based on a 24 hour clock.<br />
<br />
Examples:<br />
/dtime 6<br />
/dtime 23</pre><br />
<br />
<pre>/notable add<br />
<br />
Adds a ‘notable location’ which is used throughout Denizen asa ‘location bookmark’ of sorts. Used in the World Script event ‘on walk over...’. Use the name flag to name the location.<br />
<br />
Examples:<br />
/notable add ‘secret spot 1’<br />
/notable add treasure</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Introduction&diff=4683Denizen/Introduction2013-07-14T02:56:19Z<p>Morphan1: </p>
<hr />
<div>Denizen, powered by Citizens2 and Bukkit, is an extensive add-on pack that allows for a scriptable Minecraft experience, including enhanced NPCs, custom commands, items, world events and many other features. Inspired by MUDs, features and NPCs powered by Denizen have a unique RPG feel unmatched by any other Bukkit-only solution. Imagine interactive gate-keepers, magic spells, magical wizards, experience trainers, experience and player-stat systems, bankers that have bankers’ hours, talking townspeople, magical quests, and more! Denizen can be used in thousands of different ways, from tutorials, to gameplay, to administering --- your imagination is the limit!<br />
<br />
By sharing your scripts, you can enable the most exciting feature. Since dScript, the language that powers Denizen, is made to be easily read, users can share and tweak scripts to fit their needs with ease. Many can already be found online in the Citizens Script Repository[http://scripts.citizensnpcs.com]. <br />
<br />
While we are currently still in pre-release beta, the YAML-based dScript is becoming a fully featured core-set of features that can control your server in hundreds of ways. If that’s not enough, there’s also many ways to extend the functionality since Denizen is being programmed with a fully featured Java API in mind. With some simple Java, it’s easy to make your own dScript commands, requirements, script containers, tags, triggers, and many more. Many plugin developers are already extending their plugins with custom Denizen content for easy use with scripts, and by the time one point ‘o’ hits, we hope your plugins will take notice as well!<br />
<br />
= Getting Started =<br />
It’s hard to find a good ‘start point’ when using Denizen, since there are many different scopes, but let’s first take a look at the basic functionality and control of Denizen provided by the use of craftbukkit commands. Since Denizen uses the C2 command system, you may already be familiar with the system.<br />
<br />
== How to use server commands ==<br />
All commands have a ‘base_command’, a ‘command_name’ and either string values, integer values, value flags (--flag value) or non-value flags (-t). Some commands may use multiple flags at a time. Consider the examples below. <br />
<br />
<pre>/base_command command_name string value --flag value -t<br />
/npc trigger damage --cooldown 5 -t</pre><br />
<br />
<pre>Note: Value flags which contain more than one word must be enclosed in quotes. <br />
<br />
/base_command command_name --flag “multi word value” --another_flag another_value -t -f<br />
/npc constant --name ‘Default Greeting Text’ --value ‘Hello, player!’</pre><br />
<br />
<pre>Commands that provide multiple pages of feedback can include an integer number to specify page with some commands. If no number is specified, page 1 is assumed.<br />
<br />
/base_command command_name 3<br />
/denizen scripts 3</pre><br />
<br />
== Denizen console commands ==<br />
Denizen commands provide a way to view and configure key components of Denizen, such as version checking and script listings.<br />
<br />
<pre>/denizen version<br />
<br />
Displays the version and build information about the copy of denizen currently loaded. Will also show currently loaded ‘extensibles’.<br />
Usage: <br />
/denizen version/</pre><br />
<br />
<pre>/denizen save<br />
<br />
Saves the contents of the ‘dScript saves’ in memory to disk as saves.yml. Useful for editing the contents while the server is running, using /denizen reload. <br />
When using Denizen on a production server, there are key events that auto-save the saves.yml, so it’s encouraged that saves.yml be edited only while the server is off. When using on a development server, server action should be brought to a minimum while editing saves.yml.<br />
Usage:<br />
/denizen save</pre><br />
<br />
<pre>/denizen reload<br />
<br />
Reloads key disk files into memory, overwriting the copy currently in memory. Must specify which file to reload, or -a for all. Valid values are: scripts, saves, config or the -a flag.<br />
<br />
Note: When reloading the config, some values require a server-reboot to take effect.<br />
Usage: <br />
/denizen reload scripts|saves|config|-a<br />
<br />
Example Usages:<br />
/denizen reload -a<br />
/denizen reload scripts</pre><br />
<br />
<pre>/denizen debug<br />
<br />
Enables or disables the dBugger which can be very useful when writing and troublshooting script flow and any problems that may occur. <br />
Using the -s flag will toggle stacktraces, allowing some nitty-gritty error messages to slip through for when something seriously goes on. If getting help, it’s likely that we’ll ask you to enable this and provide us with the feedback. Using the -c flag will toggle color.<br />
Usage: <br />
/denizen debug (-c) (-s)<br />
<br />
Example Usages:<br />
/denizen debug<br />
/denizen debug -c</pre><br />
<br />
<pre>/denizen scripts<br />
<br />
Shows a list of scripts currently loaded into Denizen. Used alone, it lists all scripts, identified by type and name. Use an integer to specify which page to view. <br />
<br />
Using the type flag will cut down the search results to a specific type.<br />
Using the filter flag will limit results to a specific search string.<br />
Usage: <br />
/denizen scripts (--filter key_word) (--type script_container_type) (#)<br />
<br />
Example Usages:<br />
/denizen scripts --filter ‘bob quest’ 2<br />
/denizen scripts --type task</pre><br />
<br />
<pre>/denizen listener<br />
<br />
Shows a list of active listeners for a player. Use the player flag to specify a different player. Use an integer to specify a page.<br />
<br />
Using the finish flag will force-finish the listener, running the script the was specified in the original listen script command.<br />
Using the cancel flag will cancel the listener, effectively removing it.<br />
Using the report flag will output the status of the listener.<br />
Usage: <br />
/denizen listener (--player player_name) (--finish|report|cancel listener_id)<br />
<br />
Example Usages:<br />
/denizen listener --report apple_quest_1<br />
/denizen listener --player aufdemrand 2</pre><br />
<br />
== NPC console commands ==<br />
To provide add-on features seamlessly to Citizens, Denizen extends the /npc bukkit command to provide an interface with the additional traits added. Some commands listed here are core Citizens commands, provided here since they are commonly used with Denizen features. (DENIZEN! indicates new NPC commands that are available only with Denizen.)<br />
<br />
<pre>/npc create<br />
<br />
The command to create a new NPC. Must provide a string name. Can also specify a type flag which will change the EntityType of the NPC.<br />
<br />
Examples:<br />
/npc create Jack<br />
/npc create Henry the Great --type enderman<br />
/npc create Susan --type cow</pre><br />
<br />
<pre>/npc select<br />
<br />
Selects a NPC to work with. Used alone, it will select the nearest NPC in range. A npcid may also be specified to select a specific NPC.<br />
<br />
Examples:<br />
/npc select<br />
/npc select 10</pre><br />
<br />
<pre>/npc vulnerable<br />
<br />
Allows a NPC to be damaged, and killed. Also required (in most cases) when using the ‘health trait’ that is provided with Denizen. Use the -t flag to indicate the vulnerability to be temporary. When temporary, vulnerability will not persist through a restart.<br />
<br />
Examples:<br />
/npc vulnerable<br />
/npc vulnerable -t</pre><br />
<br />
<pre>DENIZEN! /npc assignment<br />
<br />
Used to specify and view the current assignment of an NPC. Also adds the trigger and constants trait to the NPC. To set an assignment, use the set flag with the name of the script as a value. Remember: Only assignment-type scripts can be assigned. To view information on the current assignment, use /npc assignment. Using the -r flag will remove the current assignment.<br />
<br />
Examples:<br />
/npc assignment<br />
/npc assignment --set ‘town sheriff’</pre><br />
<br />
<pre>DENIZEN! /npc trigger<br />
<br />
Controls the various settings of interact-script triggers. To specify a trigger, use a string of the name. Use in combination of the -t flag to toggle the trigger on or off. Using the cooldown flag allows the default cooldown for a trigger to be overridden on a NPC level. Changing the cooldown in this manner only affects the selected NPC. Triggers with range settings can also be modified using the radius flag. Using /npc trigger alone displays an overview of all available triggers for the selected NPC.<br />
<br />
Examples:<br />
/npc trigger<br />
/npc trigger chat -t<br />
/npc trigger proximity --radius 15<br />
/npc trigger damage --cooldown 0.5</pre><br />
<br />
<pre>DENIZEN! /npc constant<br />
<br />
Constants are saved strings, or ‘pre-set variables’ that can be set in either an assignment script, or specified at the NPC-level. Constants set to a NPC will override any values also found set in an assignment. With the use of the /npc constant server command, dScripts can be ‘configurable’ in-game.<br />
To set a constant, use the set flag with a value of the constant name, along with a value flag along with the new value of the constant. Constants can also be removed using the remove flag. Using /npc constant will show any constants currently known to the specified NPC.<br />
<br />
Examples:<br />
/npc constant --remove allowed_items<br />
/npc constant --set ‘welcome message’ --value ‘Welcome to my village!’<br />
<br />
Note: Constants are available for use within dScripts with use of a constant replaceable tag. </pre><br />
<br />
<pre>DENIZEN! /npc health<br />
<br />
Modifies the current and maximum health of a NPC. While being vulnerable is not required, NPCs cannot lose any health without being vulnerable. By default, NPCs are invulnerable, unable to be damaged. Using the set flag will specify a new max-health. Using the -r flag will reset the NPCs current health to max. Using /npc health with no additional arguments will provide current status.<br />
<br />
Examples:<br />
/npc health<br />
/npc health --set 100<br />
/npc health -r</pre><br />
<br />
<pre><br />
/npc playerlist<br />
<br />
In order for vulnerable NPCs to be attacked by Minecraft Monsters, the NPC must be added back into the Bukkit Playerlist. This treats a NPC like a Player, and should be noted that it could conflict with some external plugins. When using this feature, there may also be slightly increased overhead, so it should only be used when necessary.<br />
<br />
Examples:<br />
/npc playerlist<br />
<br />
Note: /npc playerlist only works on Player-Type NPCs.</pre><br />
<br />
<pre>DENIZEN! /npc nickname<br />
<br />
Nicknames are NPC names on steroids. They are similar to Player display names, but also allow for a level of dynamic content to be used, since they allow the use of replaceable tags. Use the set flag to change a NPCs nickname. When used without any flags, the current nickname is shown. To remove a nickname, use the -r flag.<br />
<br />
Examples:<br />
/npc nickname<br />
/npc nickname -r<br />
/npc nickname --set ‘<magic><npc.name><gold>, <br />
the friendly Wizard’<br />
/npc nickname --set ‘<npc.name>, of Clan<br />
<flag.n:clan_name>’<br />
<br />
Note: Nicknames, at this time, do not affect the ‘nameplate’ above player-type NPCs. This feature request may become possible in the future. To reference a NPCs nickname use the <npc.name.nickname> tag.</pre><br />
<br />
<pre>DENIZEN! /npc pushable<br />
<br />
Moves NPCs out of the way when colliding with a Player. Default Citizens behavior is to allow clipping on NPC objects, allowing Players and NPCs to occupy the same space. Can also specify that the NPC be returnable using the -r flag. After being pushed, a returnable NPC will return to its previous location after a delay, which can be specified with the delay flag. Once the pushable trait is enabled, the actual push behavior can be toggled with the -t flag.<br />
<br />
Examples:<br />
/npc pushable<br />
/npc pushable -r --delay 6<br />
/npc pushable -t</pre><br />
<br />
<pre>DENIZEN! /npc FISH/STOPFISHING<br />
<br />
Makes the NPC cast a fishing line to a position specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor by using the anchor flag with the name of the anchor as the value. If you wish to make the NPC cast to the location of your cursor, use the -c flag. Using the /npc stopfishing command, the NPC will reel in its line.<br />
<br />
Examples:<br />
/npc fish --location 128,64,64,world<br />
/npc fish -c<br />
/npc fish --anchor chair_location<br />
/npc stopfishing</pre><br />
<br />
<pre>DENIZEN! /npc SIT/STAND<br />
<br />
Puts the NPC in the sitting position. If a specific location is desired, it can be specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor can be specified by using the anchor flag with the name of the anchor as the value. If you wish to make the NPC sit on the location of your cursor, use the -c flag. Using the /npc stand command, or initiating navigation on a NPC will make the NPC assume a standing postion.<br />
<br />
Examples:<br />
/npc sit --location 128,64,64,world<br />
/npc sit<br />
/npc sit --anchor chair_location<br />
/npc sit -c<br />
/npc stand</pre><br />
<br />
<pre>DENIZEN! /npc SLEEP/WAKEUP<br />
<br />
Makes the NPC sleep on a position specified with the location flag, using the location format x,y,z,world_name, or alternatively, an anchor by using the anchor flag with the name of the anchor as the value. When using the /npc wakeup command, the NPC will stop sleeping.<br />
<br />
Examples:<br />
/npc sleep --location 128,64,64,world<br />
/npc sleep --anchor chair_location<br />
/npc wakeup</pre><br />
<br />
<pre>DENIZEN! /npc NAMEPLATE<br />
<br />
Changes the color of a NPCs nameplate. <br />
<br />
Examples:<br />
/npc nameplate red</pre><br />
<br />
== Experimental commands ==<br />
These are some commands that are currently in Denizen that are considered ‘experimental’. Expect the syntax and usage of these commands to be changed before the final release.<br />
<br />
<pre>/dtime #<br />
<br />
To be used with the World Script ‘On Time’ event. Minecraft time 0 = 6:00 in dTime. dTime is based on a 24 hour clock.<br />
<br />
Examples:<br />
/dtime 6<br />
/dtime 23</pre><br />
<br />
<pre>/notable add<br />
<br />
Adds a ‘notable location’ which is used throughout Denizen asa ‘location bookmark’ of sorts. Used in the World Script event ‘on walk over...’. Use the name flag to name the location.<br />
<br />
Examples:<br />
/notable add ‘secret spot 1’<br />
/notable add treasure</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Introduction&diff=4682Denizen/Introduction2013-07-14T02:38:44Z<p>Morphan1: </p>
<hr />
<div>Denizen, powered by Citizens2 and Bukkit, is an extensive add-on pack that allows for a scriptable Minecraft experience, including enhanced NPCs, custom commands, items, world events and many other features. Inspired by MUDs, features and NPCs powered by Denizen have a unique RPG feel unmatched by any other Bukkit-only solution. Imagine interactive gate-keepers, magic spells, magical wizards, experience trainers, experience and player-stat systems, bankers that have bankers’ hours, talking townspeople, magical quests, and more! Denizen can be used in thousands of different ways, from tutorials, to gameplay, to administering --- your imagination is the limit!<br />
<br />
By sharing your scripts, you can enable the most exciting feature. Since dScript, the language that powers Denizen, is made to be easily read, users can share and tweak scripts to fit their needs with ease. Many can already be found online in the Citizens Script Repository[http://scripts.citizensnpcs.com]. <br />
<br />
While we are currently still in pre-release beta, the YAML-based dScript is becoming a fully featured core-set of features that can control your server in hundreds of ways. If that’s not enough, there’s also many ways to extend the functionality since Denizen is being programmed with a fully featured Java API in mind. With some simple Java, it’s easy to make your own dScript commands, requirements, script containers, tags, triggers, and many more. Many plugin developers are already extending their plugins with custom Denizen content for easy use with scripts, and by the time one point ‘o’ hits, we hope your plugins will take notice as well!<br />
<br />
= Getting Started =<br />
It’s hard to find a good ‘start point’ when using Denizen, since there are many different scopes, but let’s first take a look at the basic functionality and control of Denizen provided by the use of craftbukkit commands. Since Denizen uses the C2 command system, you may already be familiar with the system.<br />
<br />
== How to use server commands ==<br />
All commands have a ‘base_command’, a ‘command_name’ and either string values, integer values, value flags (--flag value) or non-value flags (-t). Some commands may use multiple flags at a time. Consider the examples below. <br />
<br />
<pre>/base_command command_name string value --flag value -t<br />
/npc trigger damage --cooldown 5 -t</pre><br />
<br />
<pre>Note: Value flags which contain more than one word must be enclosed in quotes. <br />
<br />
/base_command command_name --flag “multi word value” --another_flag another_value -t -f<br />
/npc constant --name ‘Default Greeting Text’ --value ‘Hello, player!’</pre><br />
<br />
<pre>Commands that provide multiple pages of feedback can include an integer number to specify page with some commands. If no number is specified, page 1 is assumed.<br />
<br />
/base_command command_name 3<br />
/denizen scripts 3</pre><br />
<br />
== Denizen console commands ==<br />
Denizen commands provide a way to view and configure key components of Denizen, such as version checking and script listings.<br />
<br />
<pre>/denizen version<br />
<br />
Displays the version and build information about the copy of denizen currently loaded. Will also show currently loaded ‘extensibles’.<br />
Usage: <br />
/denizen version/</pre><br />
<br />
<pre>/denizen save<br />
<br />
Saves the contents of the ‘dScript saves’ in memory to disk as saves.yml. Useful for editing the contents while the server is running, using /denizen reload. <br />
When using Denizen on a production server, there are key events that auto-save the saves.yml, so it’s encouraged that saves.yml be edited only while the server is off. When using on a development server, server action should be brought to a minimum while editing saves.yml.<br />
Usage:<br />
/denizen save</pre><br />
<br />
<pre>/denizen reload<br />
<br />
Reloads key disk files into memory, overwriting the copy currently in memory. Must specify which file to reload, or -a for all. Valid values are: scripts, saves, config or the -a flag.<br />
<br />
Note: When reloading the config, some values require a server-reboot to take effect.<br />
Usage: <br />
/denizen reload scripts|saves|config|-a<br />
<br />
Example Usages:<br />
/denizen reload -a<br />
/denizen reload scripts</pre><br />
<br />
<pre>/denizen debug<br />
<br />
Enables or disables the dBugger which can be very useful when writing and troublshooting script flow and any problems that may occur. <br />
Using the -s flag will toggle stacktraces, allowing some nitty-gritty error messages to slip through for when something seriously goes on. If getting help, it’s likely that we’ll ask you to enable this and provide us with the feedback. Using the -c flag will toggle color.<br />
Usage: <br />
/denizen debug (-c) (-s)<br />
<br />
Example Usages:<br />
/denizen debug<br />
/denizen debug -c</pre><br />
<br />
<pre>/denizen scripts<br />
<br />
Shows a list of scripts currently loaded into Denizen. Used alone, it lists all scripts, identified by type and name. Use an integer to specify which page to view. <br />
<br />
Using the type flag will cut down the search results to a specific type.<br />
Using the filter flag will limit results to a specific search string.<br />
Usage: <br />
/denizen scripts (--filter key_word) (--type script_container_type) (#)<br />
<br />
Example Usages:<br />
/denizen scripts --filter ‘bob quest’ 2<br />
/denizen scripts --type task</pre><br />
<br />
<pre>/denizen listener<br />
<br />
Shows a list of active listeners for a player. Use the player flag to specify a different player. Use an integer to specify a page.<br />
<br />
Using the finish flag will force-finish the listener, running the script the was specified in the original listen script command.<br />
Using the cancel flag will cancel the listener, effectively removing it.<br />
Using the report flag will output the status of the listener.<br />
Usage: <br />
/denizen listener (--player player_name) (--finish|report|cancel listener_id)<br />
<br />
Example Usages:<br />
/denizen listener --report apple_quest_1<br />
/denizen listener --player aufdemrand 2</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen&diff=4681Denizen2013-07-14T02:20:23Z<p>Morphan1: </p>
<hr />
<div><div class="infobox" style="width: 295; font-size: 12px; background: #FFFFFF; float: right; border: 1px solid #CCCCCC; margin-left:2.5em; padding: 9px;"><br />
{{Box|<br />
BORDER = #ccc|<br />
BACKGROUND = #aaa|<br />
WIDTH = 275|<br />
ALIGN = RIGHT|<br />
ICON = |<br />
HEADING = ''' ''' |<br />
CONTENT = [[image:denizen.png|center]]<br />
<div class="padded" style="padding: 19px; font-family:camingodos-web; font-size:110%;"><br />
<br />
'''Denizen''' is an extension for Citizens that allows scripting of NPCs to handle tasks, quests, player interaction and more! <br />
<br />
'''Current version:''' 0.9.2 Pre-Release Beta<br />
<br />
'''Creator and lead developer:''' aufdemrand<br />
<br />
'''Assistant developers:''' Jeebiss and David Cernat<br />
<br />
'''Source:''' [https://github.com/aufdemrand/Denizen Github]<br />
<br />
'''Latest developmental build:''' [http://ci.citizensnpcs.com/view/All/job/Denizen%20Developmental/lastSuccessfulBuild/ 0.9 Development Builds]<br />
<br />
'''Citizens build:''' [http://ci.citizensnpcs.com/job/Citizens2/ 2.0.7 ]<br />
<br />
'''Support tickets:''' [http://github.com/aufdemrand/Denizen/issues/ Tickets on Github]<br />
<br />
'''IRC:''' [http://webchat.esper.net/?nick=random_denizen_...&channels=denizen-dev&prompt=1 #denizen-dev on esper.net]<br />
<br />
'''Donate:''' A lot of man hours has been put into Denizen. Your donations add a lot to the project and are always welcome! Your donations will probably help remodel my house and feed my kids. :) <br />
[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=jeremy%2eschroeder%40gmail%2ecom&lc=US&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted Donate to aufdemrand] Don't forget to donate to the Citizens2 project as well, as none of this would be possible without that!<br />
<br />
'''Thank you:''' A lot of people have stepped forward to help out with Denizen, and that's awesome! Special thanks to everyone who has beta tested, and a huge to these people: fullwall, AgentKid, aPunch, NeonMaster, Instinx, tenowg, groggluebutt, Wreyth, jrbudda, spidi, the list could go on!<br />
<br />
'''CitizensUI:''' For a GUI interface, check out [[CitizensUI]] by jrbudda which provides an interface for Citizens NPCs as well as managing scripts and other NPC types.<br />
<br><br />
<br />
}} <br />
</div><br />
</div><br />
<br />
<div style="padding:10px; font-family:camingodos-web; font-size:110%;"><br />
[[image:Denizen-Logo-Large.png|center]]<br />
<br />
If you need help, visit our [http://webchat.esper.net/?nick=random_denizen_...&channels=denizen-dev&prompt=1 IRC channel].<br />
<br><br><br><br />
<span style="font-family:natalya-alternate-one; font-size:750%; margin-right:-7px; margin-left:-10px;">D</span>enizen is a great way to add complex interactive role-playing NPCs to your server. Denizen NPCs use scripts with steps and events to interact with the player and world. Imagine interactive gate-keepers, magical wizards, experience trainers, bankers, talking townspeople and more! They can be used in thousands of different ways, from tutorials, to questing, to administrating.. your imagination is just about the limit! Though Denizen uses Scripting, it is not to be confused with [[Scripting|Citizens2 Core Scripting]] which utilizes JavaScript and other major scripting languages to implement Goals. Instead, Denizen uses its own YML scripting language which is designed to be easily read and edited by hand.<br />
<br />
<br />
<br />
===Table of Contents===<br />
<br />
# [[Denizen/Introduction|Introduction]]<br />
# [[Denizen/Types of Scripts|Types of Scripts]]<br />
# [[Denizen/Requirements|Requirements]]<br />
# [[Denizen/Triggers|Triggers]]<br />
# [[Denizen/Commands|Commands]]<br />
# [[Denizen/Replaceable Tags|Replaceable Tags]]<br />
<br />
<br />
<br />
<div style="padding:10px; font-family:camingodos-web; font-size:110%;"><br />
===How it works===<br />
Denizen is an extension of Citizens2 that adds an incredible amount of interactivity and automation to NPCs and Players with some of these major features:<br />
<br />
* '''The Script Engine''' carries out and sends all the commands to be executed in an orderly and predictable fashion; this is the backbone of Denizen. Currently has 3 queues, one for the Player, one for Denizens, and one for Tasks. There's not much to see on the outside, this is the interworkings of Denizen, but rest assured that this is high performance machine behind the scenes!<br />
* '''Interact Scripts''' are the meat of Denizen, allowing Players and NPCs to interact with each other and the world. These are highly customizable with 20+ requirement types, 40+ script commands, and thousands of different ways to use them together. This with the Denizen Script Engine also allows commands to help control the rest of Denizen with script flow commands and such.<br />
* '''Activity Scripts''' are exciting. Imagine Johnny Appleseed planting trees, on his own, or simple villagers wandering around and socializing. Activities, of course, work with the rest of Denizen's other functions and features, allowing hundreds of ways to use Activities to add automation and liveliness to your world. <br />
* '''Activity Scheduler''' takes Activity Scripts one step further, allowing Denizen NPCs to have daily schedules, based on the Minecraft day, to allow certain functionality to different times of the day. This also enables certain Script Commands to be executed and carried out, as well.<br />
* '''Task Scripts''' are simple scripts that can be carried out in a variety of different ways. These can be used along side both Activity and Interact Scripts, but perhaps the most powerful way to use them is by allowing your plugin to utilize them, if you're a developer, or using other plugins that harness the ability to run a Denizen Task Script as well.<br />
* '''Listeners''' are currently in an 'experimental phase', but are already allowing control over minecraft and bukkit events like nothing other. This already allows scripts to keep track of and assign 'quest-like' objectives, such as a 'kill quest', if you're familiar with the C1 Quester. But whereas many quest plugins are limited to this feature alone, Denizen, of course, allows you to use this in addition and along side the rest of the plugin, making room for extremely dynamic and intricate 'quest scripts'.<br />
* '''Flag System''' is the key to Denizen being dynamic. An intricate, yet easy to learn 'Flag/Variable' system has been implemented into Denizen to help keep track of events, items, numbers, players, and more. The new Flag System is still getting more powerful each and every day.. it's the key to a spectacular script is sure to have a flag or two.<br />
* '''Extensible Commands/Requirements/Activities and more''' make it easy to add-on to Denizen with very little Java knowledge. This also makes it extremely easy to let users utilize your plugin with script commands. Denizen also has API Events to use.<br />
* '''Denizen Debugger''' is an extremely friendly and informative way to test out scripts and interactions. Commands, events, and interactions are all logged in an easy to read format to show the exact progression of a script and its surroundings. No more guessing! Less headaches!<br />
* '''A note on YML''' Most of the time when a server owner uses YML, they edit an existing configuration. In Denizens, it is required to frequently *add* additional content. Be careful of your spacing, and never use tabs. You can use Spazzmatic in IRC chat (a very useful tool crafted by one of the developers) to check your YML files or you can use [http://yaml-online-parser.appspot.com/ this online YAML parser.]<br />
<br />
<br />
<br />
<br />
Seem overwhelming? Stop! Start small! Denizen is easy, Denizen is simple. But. Denizen is hard, Denizen is complex. Simply put: Denizen is what you make it! Our advice? Start small, and build upon what you have. Read the wiki articles, watch the youtube videos, test our your scripts, and test out some of the sample scripts! Before you know it, you'll be a Denizen poweruser, drunken with power, just like us!<br />
</div><br />
<br />
<br />
[[Category:Denizen]]</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Introduction&diff=4680Denizen/Introduction2013-07-14T02:14:57Z<p>Morphan1: Created page with "= Introduction = Denizen, powered by Citizens2 and Bukkit, is an extensive add-on pack that allows for a scriptable Minecraft experience, including enhanced NPCs, custom com..."</p>
<hr />
<div>= Introduction =<br />
<br />
Denizen, powered by Citizens2 and Bukkit, is an extensive add-on pack that allows for a scriptable Minecraft experience, including enhanced NPCs, custom commands, items, world events and many other features. Inspired by MUDs, features and NPCs powered by Denizen have a unique RPG feel unmatched by any other Bukkit-only solution. Imagine interactive gate-keepers, magic spells, magical wizards, experience trainers, experience and player-stat systems, bankers that have bankers’ hours, talking townspeople, magical quests, and more! Denizen can be used in thousands of different ways, from tutorials, to gameplay, to administering --- your imagination is the limit!<br />
<br />
By sharing your scripts, you can enable the most exciting feature. Since dScript, the language that powers Denizen, is made to be easily read, users can share and tweak scripts to fit their needs with ease. Many can already be found online in the Citizens Script Repository[http://scripts.citizensnpcs.com]. <br />
<br />
While we are currently still in pre-release beta, the YAML-based dScript is becoming a fully featured core-set of features that can control your server in hundreds of ways. If that’s not enough, there’s also many ways to extend the functionality since Denizen is being programmed with a fully featured Java API in mind. With some simple Java, it’s easy to make your own dScript commands, requirements, script containers, tags, triggers, and many more. Many plugin developers are already extending their plugins with custom Denizen content for easy use with scripts, and by the time one point ‘o’ hits, we hope your plugins will take notice as well!</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands/Flag&diff=4651Denizen/Commands/Flag2013-07-08T01:34:56Z<p>Morphan1: /* Usage */</p>
<hr />
<div>== Introduction ==<br />
Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement.<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
Once you set a flag, you can call it back at any time with one of the [[Denizen/Replaceable_Tags#Flags|replaceable tags]].<br />
<br />
= The flag command =<br />
== Usage ==<br />
To begin, you need to actually set a flag. You can do this by using <br />
{| class="wikitable" border="1"<br />
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)<br />
|}<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
...Too much for you? Let's slow it down.<br />
=== The Basics ===<br />
<br />
To start using flags, you must first understand the basics. This means learning the 4 types of flags you can use: booleans, strings, integers/doubles, and lists.<br />
<br />
==== Boolean ====<br />
<br />
The first, most used, most basic flag you need (besides a default flag) is a boolean flag. A boolean is a variable that represents either true or false.<br />
You can set a boolean flag to true by using <pre>- flag "RandomFlag"</pre> ...That's it. That automatically sets the flag named RandomFlag attached to the player interacting with the script as 'true'.<br />
You can set it to false by simply doing <pre>- flag "RandomFlag:false"</pre><br />
This type of flag is helpful for 'if' statements. More information on that can be found [[Denizen/Commands/If#Flags|here]].<br />
<br />
==== String ====<br />
<br />
Let's move forward. Probably the second most important flag you'll need on your journey is the string flag. Strings are variables that represent words or phrases that you can change at any time.<br />
<br />
For example, <pre>- flag "RandomFlag:Blah something whatever"</pre> would set the flag 'RandomFlag' on the player who's interacting with the script as 'Blah something whatever'.<br />
Remember, you can also attach the flag to the NPC that the script is being run by, or the server itself by specifying 'npc' or 'global'. That will be covered in the advanced section.<br />
<br />
==== Integer/Doubles ====<br />
<br />
Onto the next step... Integers and doubles! If you know a little about math, you probably already know that integers are just a fancy way of saying 'whole numbers'. In that sense, all doubles are are numbers with decimals. (Non-whole numbers.)<br />
<br />
= Usage inside scripts =<br />
<br />
== Mathematical calculations ==<br />
Number flags (Integer, Double, ...) can be used in calculations. You can either use the <m: > tag or add the operation directly behind the flag (examples in the different kinds of operations).<br />
<br />
=== Addition ===<br />
To add a flag and a number together, just use <code>add[]</code>.<br />
Example:<br />
<pre><player.flag[money].add[2]></pre><br />
<br />
=== Subtraction ===<br />
To subtract the flag's value, just use <code>sub[]</code>.<br />
Example:<br />
<pre><player.flag[money].sub[10]></pre><br />
<br />
=== Multiplication ===<br />
To multiply the value of a flag, just use <code>mul[]</code>.<br />
Example:<br />
<pre><player.flag[money].mul[1.25]></pre><br />
<br />
=== Multiplication ===<br />
To divide a flag by something use <code>div[]</code>.<br />
Example:<br />
<pre><player.flag[money].div[1.25]></pre><br />
<br />
=== Mod ===<br />
Denizen allows you to mod two numbers as well! Just use <code>mod[]</code>.<br />
Example:<br />
<pre><player.flag[money].mod[3]></pre><br />
<br />
== Advanced usage ==<br />
=== Checking if a flag exists ===<br />
With the new 0.9 Development release you can now check if a flag exists. Just check a flag against null like in the following example:<br />
<br />
<pre>- if <player.flag[flag_to_check]> == null narrate 'flag is null!'<br />
else narrate "<player.flag[flag_to_check]>"</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands/Flag&diff=4650Denizen/Commands/Flag2013-07-07T22:37:51Z<p>Morphan1: /* Checking if a flag exists */</p>
<hr />
<div>== Introduction ==<br />
Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement.<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
Once you set a flag, you can call it back at any time with one of the [[Denizen/Replaceable_Tags#Flags|replaceable tags]].<br />
<br />
= The flag command =<br />
== Usage ==<br />
To begin, you need to actually set a flag. You can do this by using <br />
{| class="wikitable" border="1"<br />
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)<br />
|}<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
...Too much for you? Let's slow it down.<br />
=== The Basics ===<br />
<br />
To start using flags, you must first understand the basics. This means learning the 4 types of flags you can use: booleans, strings, integers, and lists.<br />
<br />
==== Boolean ====<br />
<br />
The first, most used, most basic flag you need (besides a default flag) is a boolean flag. A boolean is a variable that represents either true or false.<br />
You can set a boolean flag to true by using <pre>- flag "RandomFlag"</pre> ...That's it. That automatically sets the flag named RandomFlag attached to the player interacting with the script as 'true'.<br />
You can set it to false by simply doing <pre>- flag "RandomFlag:false"</pre><br />
This type of flag is helpful for 'if' statements. More information on that can be found [[Denizen/Commands/If#Flags|here]].<br />
<br />
==== String ====<br />
<br />
Let's move forward. Probably the second most important flag you'll need on your journey is the string flag. Strings are variables that represent words or phrases that you can change at any time.<br />
<br />
For example, <pre>- flag "RandomFlag:Blah something whatever"</pre> would set the flag 'RandomFlag' on the player who's interacting with the script as 'Blah something whatever'.<br />
Remember, you can also attach the flag to the NPC that the script is being run by, or the server itself by specifying 'npc' or 'global'. That will be covered in the advanced section.<br />
<br />
==== Integer ====<br />
<br />
<br />
= Usage inside scripts =<br />
<br />
== Mathematical calculations ==<br />
Number flags (Integer, Double, ...) can be used in calculations. You can either use the <m: > tag or add the operation directly behind the flag (examples in the different kinds of operations).<br />
<br />
=== Addition ===<br />
To add a flag and a number together, just use <code>add[]</code>.<br />
Example:<br />
<pre><player.flag[money].add[2]></pre><br />
<br />
=== Subtraction ===<br />
To subtract the flag's value, just use <code>sub[]</code>.<br />
Example:<br />
<pre><player.flag[money].sub[10]></pre><br />
<br />
=== Multiplication ===<br />
To multiply the value of a flag, just use <code>mul[]</code>.<br />
Example:<br />
<pre><player.flag[money].mul[1.25]></pre><br />
<br />
=== Multiplication ===<br />
To divide a flag by something use <code>div[]</code>.<br />
Example:<br />
<pre><player.flag[money].div[1.25]></pre><br />
<br />
=== Mod ===<br />
Denizen allows you to mod two numbers as well! Just use <code>mod[]</code>.<br />
Example:<br />
<pre><player.flag[money].mod[3]></pre><br />
<br />
== Advanced usage ==<br />
=== Checking if a flag exists ===<br />
With the new 0.9 Development release you can now check if a flag exists. Just check a flag against null like in the following example:<br />
<br />
<pre>- if <player.flag[flag_to_check]> == null narrate 'flag is null!'<br />
else narrate "<player.flag[flag_to_check]>"</pre></div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands&diff=4649Denizen/Commands2013-07-07T17:31:28Z<p>Morphan1: </p>
<hr />
<div>__TOC__<br />
<br />
==List of commands==<br />
<br />
<big><div style="color:red">Denizen is continously being updated. This page shows only basic script commands (We will try to update the page when something changes)!</div></big><br />
<br />
<br />
===Script flow===<br />
<br />
<br />
{{Denizen Command<br />
|assignment|<nowiki>[{set}|remove] (script:name)</nowiki><br />
|Sets or removes an assignment for the NPC. If set or remove aren't specified, it will set by default.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- assignment set "script:Evil Wizard"<br />
- assignment remove<br />
- assignment "script:Pet Cat"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|anchor|<nowiki>[id:name] [assume|add|remove|walkto|walknear] (range:#)</nowiki><br />
|Assumes, Adds, Removes and orders an NPC to walkto or to walknear an anchor that has been specified using the Citizens 2 npc command <br />
"/npc anchor" Allows for dynamic specified pathing based on predefined points. Allows for a specified range in which the NPC in question <br />
can walk to an anchor point.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
A command having an NPC assume an Anchor:<br />
- anchor id:postoffice assume range:20<br />
-------------------------------------<br />
Two commands demonstrating how one may add an anchor based on the NPC's location:<br />
- Chat "Wow <player.name>, Now that I've walked to this location I am going to create an anchor point at this location so <br />
I can walk back here later."<br />
- anchor id:example_anchor add<br />
-------------------------------------<br />
Two commands demonstrating how one may remove a specified anchor via an NPC"<br />
- chat "You know <player.name>, I actually don't think I'll ever need to return here again, I will delete this anchor point"<br />
- anchor id:example_anchor remove<br />
-------------------------------------<br />
An example of a command for an NPC to walk towards a specified anchor point. Walkto has the NPC walk directly to the point; <br />
whereas Walknear has the npc be less precise when walking to the point:<br />
- anchor id:Treasure_Chest walkto range:30<br />
- anchor id:Wheat_Fields walknear<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|chunkload|<nowiki>({add}|remove|removeall) [location:x,y,z,world] (duration:{-1s})</nowiki><br />
|Loads the chunk of the location as specified into the server memory so that it does not despawn. NPCs do not stay spawned if a chunk<br />
despawns. As such this command is useful for ensuring a NPC spawn and do what it ought to regardless if a player is around to keep<br />
the chunk that that NPC is in, spawned. This command allows for adding of a chunk to memory by specifying a block location within a chunk, removing a chunk loaded to memory by also specifying a location within the chunk, as well as the ability to remove all chunks<br />
currently loaded into server memory by this command (removeall). Additionally a duration can be set in which a chunk loaded into memory<br />
will automatically despawn; the default is set to -1 meaning the chunk will stay loaded until the chunkload command is used again<br />
to remove it from memory.<br />
<br />
'''This does not create nor delete new or already generated chunks of terrain it merely brings it into memory for the server so that<br />
an NPC may spawn regardless if someone is around'''<br />
<br />
'''Examples'''<br />
<pre><br />
- chunkload add location:1000,64,1000,world duration:-1s<br />
- chunkload add location:323,4,745,creative_world duration:10m<br />
- chunkload remove location: 1000,64,1000,world<br />
- chunkload removeall<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|clear|(queue:name) (...)<br />
'''WARNING THIS COMMAND IS DEPRECATED, ALL SCRIPTWRITERS SHOULD NOW USE THE QUEUE COMMAND'''<br />
|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.<br />
<br />
Use this command to stop a script from another script or a script from an action.<br />
<br />
'''Examples'''<br />
<pre><br />
- clear<br />
- clear queue:magicalattacks queue:movingwalls<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|cooldown|<nowiki>(duration:#{60s}) (global|player:name{attached player}) (script:name)</nowiki><br />
|Makes this script not get executed again by this player for a duration of time, which is 60 seconds by default.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cooldown<br />
- cooldown duration:30s player:Bob "script:Offer Quest"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|determine|["value"]<br />
|This command only works together with the [[Denizen/Replaceable Tags#procedure|procedure]] replaceable tag. It is put in the procedure script run by the tag and sets the tag's value to anything you choose. It is generally used as the result of an [[#if|if]] command or together with the [[#random|random]] command.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- if <player.name> == "Bob" determine "Bobby"<br />
- if <flag.p:Enemy> == "Galerion" determine "the fearsome Galerion"<br />
else if <flag.p:Enemy> == "Narkon" determine "the evil Narkon"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|disengage|(npcid:#)<br />
|Stops an [[#engage|engage]] command used formerly on this NPC. If the npcid is specified, a different NPC can be disengaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- disengage<br />
- disengage npcid:8<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|engage|(duration:#) (npcid:#)<br />
|Temporarily deactivates this NPC's triggers, making it impossible for players to interact with it for the chosen duration or until the [[#disengage|disengage]] command is used on it. If the npcid is specified, a different NPC can be engaged.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- engage<br />
- engage duration:40s npcid:7<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|execute|<nowiki>[as_player|as_op|as_npc|as_server] ["Bukkit command"]</nowiki><br />
|Executes a Bukkit command on behalf of the player (as_player), the player as an operator (as_op), the NPC as an operator (as_npc), or the server (as_server).<br />
<br />
Any Bukkit command that you can use in the server console or in the chat with a slash works here. You can thus use the execute command to make NPCs that act as interfaces for other plugins.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- execute as_player "home"<br />
- execute as_op "gamemode 1"<br />
- execute as_npc "spawnmob zombie 3"<br />
- execute as_server "jail <player.name>"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|fail|(script:script_name{attached script}) (player:name)<br />
|Adds 1 to the number of times this script or another script has been failed by this player, or by another player if one is specified. You can then check the times a script has been failed using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- fail<br />
- fail "script:Defend the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|finish|(script:script_name{attached script}") (player:name)<br />
|Adds 1 to the number of times this script or another script has been finished by this player, or by another player if one is specified. You can then check the times a script has been finished using the [[Denizen/Script Requirements#script|script]] requirement.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- finish<br />
- finish "script:Siege the Castle" player:Bob<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|flag|<nowiki>({player}|npc|global) [name([#])](:action)[:value] (duration:#)</nowiki><br />
|Sets the value of a flag, a variable that can be checked elsewhere in this script and in other scripts by using [[Denizen/Replaceable Tags#Flags|flag replaceable tags]] or the [[Denizen/Script Requirements#flagged|flagged requirement]].<br />
<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
For more info, [[Denizen/Commands/Flag|click here]].<br />
<br />
'''Examples'''<br />
<pre><br />
- flag "Finished Baker's Quest"<br />
- flag global "Skeleton Invasion Ended"<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|random|[#]<br />
|Runs a single one out of a number of commands, chosen at random.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- random 3<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In the above example, only one of the three chat commands will be run.<br />
<br />
<pre><br />
- random 2<br />
- chat "One."<br />
- chat "Two."<br />
- chat "Three."<br />
</pre><br />
<br />
In this example, either "One" or "Two" will be displayed, but "Three" will always be displayed.<br />
<br />
<pre><br />
- random 3<br />
- attack<br />
- chat "Get out of here!"<br />
- runtask "script:Call Reinforcements"<br />
</pre><br />
<br />
Here, the NPC will either attack the player, tell the player to leave, or run a script in which it calls for reinforcements.<br />
}}<br />
<br />
===Messages===<br />
<br />
<br />
{{Denizen Command<br />
|announce|["announcement text"] (to_ops)<br />
|Sends a message to every player on the server. If the to_ops argument is used, the message is sent only to operators.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- announce "The skeleton invasion has ended."<br />
- announce "<player.name> has joined the blue team!"<br />
- announce to_ops "<player.name> is requesting help from operators."<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chat|<nowiki>["chat text"] (npcid:#) (target(s):npc.#|player.name{attached player})</nowiki><br />
|Sends a message from this NPC to the player.<br />
<br />
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.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- chat "It's nice to see you again, <player.name>."<br />
- chat "I would like to introduce you to <player.name>." target:npc.7<br />
- chat "Bob, do you know <player.name>?" target:player.Bob<br />
- chat npcid:9 "Our enemy is giving orders to his companion." target:player.Bob<br />
</pre><br />
}}<br />
<br />
<br />
<br />
{{Denizen Command<br />
|narrate|["narration text"] (player:name)<br />
|Sends a message to this player, or to another player if one is specified.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- narrate "A musty odor hangs in the air and you can hear the distant sound of trickling sewer water."<br />
- narrate player:Bob "<player.name> has been hired to track you down!"<br />
</pre><br />
}}<br />
<br />
===Denizen interaction===<br />
<br />
<br />
{{Denizen Command<br />
|attack|(stop)<br />
|Makes the NPC attack or stop attacking the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- attack<br />
- attack stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|chair|<nowiki>(sit|stand) (location:x,y,z,world)</nowiki><br />
|Makes the NPC sit or stand at a location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- sit location:300,65,300,world<br />
- sit location:<anchor:Chair><br />
- stand<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|follow|(stop)<br />
|Makes the NPC follow or stop following the player.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- follow<br />
- follow stop<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|look|[location:x,y,z,world]<br />
|Makes the NPC look towards a certain location.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- look location:300,60,500,world<br />
- look location:<player.location><br />
- look location:<anchor:Lever><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|shoot|[entity:name] (ride) (burn) (explode) (location:x,y,z,world) (script:name)<br />
|Makes the NPC shoot out an entity. All valid entity names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/entity/EntityType.html here].<br />
<br />
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.<br />
<br />
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.<br />
<br />
'''Examples'''<br />
<pre><br />
- shoot entity:zombie<br />
- shoot entity:arrow location:<player.location><br />
- shoot entity:fireball location:<player.location> "script:Shoot Another Fireball"<br />
- shoot entity:minecart ride location:<anchor:Rollercoaster><br />
- shoot entity:cow ride burn explode location:<anchor:Hill> "script:Bovine Destruction"<br />
</pre><br />
}}<br />
<br />
<br />
<br />
===Player interaction===<br />
<br />
<br />
{{Denizen Command<br />
|cast|<nowiki>[effect] (duration:#{60s}) (power:#{1}) (target(s):npc|player|npc.#|player.name|entity_name)</nowiki><br />
|Gives a potion effect to a target, which can be a player, an NPC or another entity. All valid potion effect names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/potion/PotionEffectType.html here].<br />
<br />
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 <nowiki>|</nowiki> characters.<br />
<br />
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 greater than that will not do anything.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- cast blindness power:3 duration:7<br />
</pre><br />
<br />
In the above example, the player talking to this NPC will be blinded strongly for 7 seconds.<br />
<br />
<pre><br />
- cast regeneration power:1 duration:10 target:player.<npc.owner><br />
</pre><br />
<br />
In this example, the NPC will give a weak regeneration effect to its owner for 10 seconds.<br />
<br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|feed|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's food bar, or this NPC's food bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be fed. A completely full food bar has an amount of 20. Thus, an amount of 1 is half a shank in the food bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- feed<br />
- feed amt:15 target:npc<br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|heal|<nowiki>(amt:#) (target:npc|{player})</nowiki><br />
|Fills the player's health bar, or this NPC's health bar if the NPC is specified as the target. An amount can also be set by which the player or NPC will be healed. A completely full health bar has an amount of 20. Thus, an amount of 1 is half a heart in the health bar.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- heal<br />
- heal amt:7 target:npc<br />
</pre><br />
}}<br />
<br />
===World interaction===<br />
<br />
{{Denizen Command<br />
|animatechest|<nowiki>[location:x,y,z,world] ({open}|close) (sound:{true}|false)</nowiki><br />
|Causes a chest located at the specified coordinates to animate as either open or closed; defaults to open if not specified. Allows for the animated chest to play the "open chest" sound (true) or to open silently (false); defaults to true. '''There must be a chest located at the coordinates, this command does not spawn a chest.'''<br />
<br />
'''Examples'''<br />
<pre><br />
- animatechest location:1000,63,1000,world open sound:true<br />
- animatechest location:100,74,777,world close sound:false<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|copyblock|<nowiki>[location:x,y,z,world] [to:x,y,z,world]</nowiki><br />
|Simply copies whatever type of block is at one location and essentially pastes it at another defined location.<br />
<br />
'''Examples'''<br />
<pre><br />
- copyblock location:204,68,12,world to:55,64,100,castle_world<br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|displayitem|<nowiki>[item_name|remove] [location:x,y,z,world] (duration:#)</nowiki><br />
|Has the server create a "Phantom Item" at the specified location which will remain there until removed. The Phantom Item<br />
only appears to the player and cannot be picked up by the player. Currently the "Duration:#" setting is unreliable and as such <br />
players should expect to have to use the "- displayitem remove" command if they wish to remove the displayed item.<br />
<br />
'''Examples'''<br />
<pre><br />
- displayitem 10 location:77,64,2453,world duration:20s<br />
- displayitem Stick location:<player.location><br />
- displayitem remove location:77,64,2453,world<br />
- displayitem remove location:<player.location><br />
</pre><br />
}}<br />
<br />
{{Denizen Command<br />
|drop|<nowiki>[item:#(:#)|item:material(:#)|xp] (qty:#{1}) (location:x,y,z,world)</nowiki><br />
|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 [http://www.minecraftwiki.net/wiki/Data_values here] and all valid material names are found [http://jd.bukkit.org/rb/apidocs/org/bukkit/Material.html here].<br />
<br />
The ID or material can also be followed by a [http://www.minecraftwiki.net/wiki/Data_values#Data special data value] for the item, so you can - for instance - drop a specific kind of wood or color of wool.<br />
<br />
'''Examples'''<br />
<pre><br />
- drop item:38 location:500,63,500,world<br />
- drop item:diamond qty:5 location:<anchor:Treasury><br />
- drop xp qty:30 location:<anchor:Altar><br />
- drop item:wood:3 qty:30 location:<anchor:Jungle><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|strike|(no_damage) [location:x,y,z,world]<br />
|Makes lightning strike a location, optionally without causing any damage.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- strike location:200,73,200,world<br />
- strike location:<player.location><br />
- strike no_damage location:<anchor:Mountaintop><br />
</pre><br />
}}<br />
<br />
<br />
{{Denizen Command<br />
|switch|<nowiki>[location:x,y,z,world] (state:[{toggle}|on|off]) (duration:#)</nowiki><br />
|Changes the state of the lever, stone button, stone plate, wood plate, wooden door, iron door or trap door at the specified location. By default the state is toggled from on/open to off/closed and back again, but you can choose to set the state just to on or off. You can also specify a duration for which the state will remain like that.<br />
<br />
<br />
'''Examples'''<br />
<pre><br />
- switch location:500,45,700,world<br />
- switch state:on location:<anchor:Secret Lever> duration:30<br />
</pre><br />
}}</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Commands/Flag&diff=4647Denizen/Commands/Flag2013-07-07T16:57:40Z<p>Morphan1: </p>
<hr />
<div>== Introduction ==<br />
Flags are variables that can be checked anywhere in a script and in other scripts by using flag replaceable tags or the flagged requirement.<br />
A flag can be placed on the player, the NPC or globally. Flags placed on a player only apply to that player, and flags placed on an NPC only apply to that individual NPC based on its ID, so NPCs with the same name have different flags because they have different IDs. However, a global flag applies to the entire server and can easily be read from any script.<br />
<br />
Once you set a flag, you can call it back at any time with one of the [[Denizen/Replaceable_Tags#Flags|replaceable tags]].<br />
<br />
== Usage ==<br />
To begin, you need to actually set a flag. You can do this by using <br />
{| class="wikitable" border="1"<br />
||- flag ({player}|npc|global) [name([#])](:action)[:value] (duration:#)<br />
|}<br />
If a flag's type (player, npc or global) is not specified, the flag is placed on the player by default, and if a value for the flag is not specified, the value is "true" by default.<br />
<br />
...Too much for you? Let's slow it down.<br />
=== The Basics ===<br />
<br />
To start using flags, you must first understand the basics. This means learning the 4 types of flags you can use: booleans, strings, integers, and lists.<br />
<br />
==== Boolean ====<br />
<br />
The first, most used, most basic flag you need (besides a default flag) is a boolean flag. A boolean is a variable that represents either true or false.<br />
You can set a boolean flag to true by using <pre>- flag "RandomFlag"</pre> ...That's it. That automatically sets the flag named RandomFlag attached to the player interacting with the script as 'true'.<br />
You can set it to false by simply doing <pre>- flag "RandomFlag:false"</pre><br />
This type of flag is helpful for 'if' statements. More information on that can be found [[Denizen/Commands/If#Flags|here]].<br />
<br />
==== String ====<br />
<br />
Let's move forward. Probably the second most important flag you'll need on your journey is the string flag. Strings are variables that represent words or phrases that you can change at any time.<br />
<br />
For example, <pre>- flag "RandomFlag:Blah something whatever"</pre> would set the flag 'RandomFlag' on the player who's interacting with the script as 'Blah something whatever'.<br />
Remember, you can also attach the flag to the NPC that the script is being run by, or the server itself by specifying 'npc' or 'global'. That will be covered in the advanced section.<br />
<br />
==== Integer ====</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Replaceable_Tags&diff=4646Denizen/Replaceable Tags2013-07-07T16:00:51Z<p>Morphan1: </p>
<hr />
<div>__TOC__<br />
<br />
==Flags==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <flag.g:flag_name><br />
| Returns the value of a flag attached to the server. NOTE: In 0.9, it's more preferred to use <server.flag[flag_name]><br />
|-<br />
| <flag.n:flag_name><br />
| Returns the value of a flag attached to the current NPC. NOTE: In 0.9, it's more preferred to use <npc.flag[flag_name]><br />
|-<br />
| <flag.p:flag_name><br />
| Returns the value of a flag attached to the current player. NOTE: In 0.9, it's more preferred to use <player.flag[flag_name]><br />
|-<br />
|}<br />
<br />
==Location==<br />
All location tags require coordinates. You can have tags in the brackets [] or you can specify exact locations by yourself. For example, you could use <pre><location[<npc.location>].biome.temperature></pre> to get the temperature at the NPC's location.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <location[x,y,z,world].biome.formatted><br />
| The formatted name of the biome at coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.humidity><br />
| The current humidity at the coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.temperature><br />
| The current temperature at the coordinates.<br />
|-<br />
| <location[x,y,z,world].distance[x,y,z,world]><br />
| The distance between 2 coordinates.<br />
|-<br />
| <location[x,y,z,world].formatted><br />
| The coordinates in an easier-to-read format.<br />
|-<br />
| <location[x,y,z,world].is_liquid><br />
| Whether or not the block at the coordinates are a liquid. Can be true or false.<br />
|-<br />
| <location[x,y,z,world].light><br />
| The light level at the coordinates.<br />
|}<br />
<br />
==NPC==<br />
NOTE: You can reference an NPC other than the one in the current script by using <npc[npc_id]>... So for example, <npc[2].id> (which would be completely useless) would return '2'.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <npc.flag[flag_name]><br />
| Returns the value of a flag attached to an NPC.<br />
|-<br />
| <npc.id><br />
| The ID number of the NPC.<br />
|-<br />
| <npc.location><br />
| The coordinates of the NPC. [x,y,z,world]<br />
|-<br />
| <npc.location.previous_location><br />
| The last location the NPC was at.<br />
|-<br />
| <npc.location.standing_on><br />
| The Bukkit block name that the NPC is standing on.<br />
|-<br />
| <npc.location.standing_on_display><br />
| The formatted block name that the NPC is standing on.<br />
|-<br />
| <npc.location.world><br />
| The name of the world the NPC is in.<br />
|-<br />
| <npc.location.world_spawn><br />
| The coordinates of the spawn of the world that the NPC is currently in.<br />
|-<br />
| <npc.location.x><br />
| The x coordinate the NPC is at.<br />
|-<br />
| <npc.location.y><br />
| The y coordinate the NPC is at.<br />
|-<br />
| <npc.location.z><br />
| The z coordinate the NPC is at.<br />
|-<br />
| <npc.name><br />
| The NPC's name.<br />
|-<br />
| <npc.name.nickname><br />
| The NPC's nickname.<br />
|-<br />
| <npc.owner><br />
| The owner of the NPC.<br />
|}<br />
<br />
==Player==<br />
NOTE: You can reference a player other than the one in the current script by using <player[player_name]>... So for example, <player[Morphan1].name> (which would be completely useless) would return 'Morphan1'.<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <player.chat_history><br />
| Last message the player sent.<br />
|-<br />
| <player.chat_history[X]><br />
| Message the player sent X times ago.<br />
|-<br />
| <player.equipment.boots><br />
| The Bukkit name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.equipment.boots.formatted><br />
| The formatted name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.flag[flag_name]><br />
| Returns the value of a flag attached to a player.<br />
|-<br />
| <player.health><br />
| The player's health, 1-20. Each number is half of a heart.<br />
|-<br />
| <player.health.formatted><br />
| The player's formatted health. Can be healthy, scraped, injured, seriously wounded, and dying.<br />
|-<br />
| <player.health.percentage><br />
| The player's health as a percentage.<br />
|-<br />
| <player.inventory.contains.display[display_name]><br />
| Checks if the player's inventory contains an item with a name chosen on an anvil. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.inventory.contains[item_id]><br />
| Checks if the player's inventory contains an item. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.food_level><br />
| The player's food level, 1-20. Each number is half of a thing-on-the-hunger-bar.<br />
|-<br />
| <player.food_level.formatted><br />
| The player's formatted food level. Can be healthy, parched, hungry, and famished.<br />
|-<br />
| <player.food_level.percentage><br />
| The player's food level as a percentage.<br />
|-<br />
| <player.group[group_name]><br />
| Checks if the player is in a group via Vault. Can be true or false.<br />
|-<br />
| <player.group[group_name].global>><br />
| Checks if the player is in a global group via Vault. Can be true or false.<br />
|-<br />
| <player.item_in_hand.enchantments><br />
| List of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level><br />
| List of enchantments and their levels on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level_only><br />
| List of levels of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand><br />
| Contains all details of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.data><br />
| The material data of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.display><br />
| The name chosen on an anvil for the item the player is holding.<br />
|-<br />
| <player.item_in_hand.durability><br />
| The durability of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.id><br />
| The ID of the block or item the player is holding. All block and item IDs are found [http://www.minecraftwiki.net/wiki/Data_values here].<br />
|-<br />
| <player.item_in_hand.lore><br />
| List of lore on item in the player's hand.<br />
|-<br />
| <player.item_in_hand.max_stack><br />
| The maximum amount you can have in one inventory slot of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.material><br />
| Bukkit material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.material.formatted><br />
| Formatted material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.qty><br />
| The current amount of the inventory slot of the item the player is holding.<br />
|-<br />
| <player.is_banned><br />
| Whether the player is banned. Can be true or false.<br />
|-<br />
| <player.is_online><br />
| Whether the player is online. Can be true or false.<br />
|-<br />
| <player.is_op><br />
| Whether the player is an operator. Can be true or false.<br />
|-<br />
| <player.location><br />
| The coordinates of the player. [x,y,z,world]<br />
|-<br />
| <player.location.bed_spawn><br />
| The coordinates of the last bed the player slept in, if any.<br />
|-<br />
| <player.location.cursor_on[X]><br />
| The location of the block the player's cursor is on, within X range.<br />
|-<br />
| <player.location.standing_on><br />
| The Bukkit block name that the player is standing on.<br />
|-<br />
| <player.location.standing_on.formatted><br />
| The formatted block name that the player is standing on.<br />
|-<br />
| <player.location.world><br />
| The name of the world the player is in.<br />
|-<br />
| <player.location.world_spawn><br />
| The coordinates of the spawn of the world that the player is currently in.<br />
|-<br />
| <player.location.x><br />
| The x coordinate the player is at.<br />
|-<br />
| <player.location.y><br />
| The y coordinate the player is at.<br />
|-<br />
| <player.location.z><br />
| The z coordinate the player is at.<br />
|-<br />
| <player.money><br />
| The amount of money in this player's account. Requires Vault and an economy plugin.<br />
|-<br />
| <player.name><br />
| The player's name.<br />
|-<br />
| <player.name.display><br />
| The player's display name. (The one that shows in chat.)<br />
|-<br />
| <player.mcmmo.level[skill_name]><br />
| The player's current level for an McMMO skill.<br />
|-<br />
| <player.money><br />
| How much money the player has, as a number. (0.0, 1.5, 2.25, etc.)<br />
|-<br />
| <player.money.asint><br />
| How much money the player has, as an integer. (0, 1, 2, etc.)<br />
|-<br />
| <player.money.currency><br />
| The currency set in this server's economy plugin.<br />
|-<br />
| <player.money.currency.plural><br />
| The currency set in this server's economy plugin, in its plural form.<br />
<br />
Examples: Dollars, pounds, coins<br />
|-<br />
| <player.money.currency.singular><br />
| The currency set in this server's economy plugin, in its singular form.<br />
<br />
Examples: Dollar, pound, coin<br />
|-<br />
| <player.script[script_name].failed><br />
| Checks if the player has failed a script. Can be true or false.<br />
|-<br />
| <player.script[script_name].finished><br />
| Checks if the player has finished a script. Can be true or false.<br />
|-<br />
| <player.time><br />
| The player's time in ticks, from 0 to 23999. For a quick view of what different tick values mean in real life hours, look [http://media-mcw.cursecdn.com/b/bc/Day_Night_Clock_24h.png here].<br />
|-<br />
| <player.time.period><br />
| The time period for this player. Can be "day" or "night".<br />
|-<br />
| <player.xp><br />
| The total experience of a player.<br />
|-<br />
| <player.xp.level><br />
| The current experience level of a player.<br />
|-<br />
| <player.weather><br />
| The current weather in this player's world. Is "storming" if there's a storm, "sunny" if the weather is clear and it's daytime, and "clear" if the weather is clear and it's nighttime.<br />
|}<br />
<br />
==Util==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
|}<br />
<br />
==Text==<br />
<br />
===Colors===<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="25%" border="1"<br />
|-<br />
| width="60%" | <aqua><br />
| style="background-color:#55FFFF" |<br />
|-<br />
| <black><br />
| style="background-color:black" |<br />
|-<br />
| <blue><br />
| style="background-color:#5555FF" |<br />
|-<br />
| <dark_aqua><br />
| style="background-color:#00AAAA" |<br />
|-<br />
| <dark_blue><br />
| style="background-color:#0000AA" |<br />
|-<br />
| <dark_gray><br />
| style="background-color:#555555" |<br />
|-<br />
| <dark_green><br />
| style="background-color:#00AA00" |<br />
|-<br />
| <dark_purple><br />
| style="background-color:#AA00AA" |<br />
|-<br />
| <dark_red><br />
| style="background-color:#AA0000" |<br />
|-<br />
| <gold><br />
| style="background-color:#FFAA00" |<br />
|-<br />
| <gray><br />
| style="background-color:#AAAAAA" |<br />
|-<br />
| <green><br />
| style="background-color:#55FF55" |<br />
|-<br />
| <light_purple><br />
| style="background-color:#FF55FF" |<br />
|-<br />
| <red><br />
| style="background-color:#FF5555" |<br />
|-<br />
| <white><br />
| style="background-color:white" |<br />
|-<br />
| <yellow><br />
| style="background-color:#FFFF55" |<br />
|}<br />
<br />
==Pssst...==<br />
http://pastebin.com/KBADLinZ<br><br />
Here is a summary of them :)<br><br />
-Jeebs</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Replaceable_Tags&diff=4636Denizen/Replaceable Tags2013-07-01T11:25:38Z<p>Morphan1: </p>
<hr />
<div>__TOC__<br />
<br />
==Location==<br />
All location tags require coordinates. You can have tags in the brackets [] or you can specify exact locations by yourself. For example, you could use <pre><location[<npc.location>].biome.temperature></pre> to get the temperature at the NPC's location.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| <location[x,y,z,world].biome.formatted><br />
| The formatted name of the biome at coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.humidity><br />
| The current humidity at the coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.temperature><br />
| The current temperature at the coordinates.<br />
|-<br />
| <location[x,y,z,world].distance[x,y,z,world]><br />
| The distance between 2 coordinates.<br />
|-<br />
| <location[x,y,z,world].formatted><br />
| The coordinates in an easier to read format.<br />
|-<br />
| <location[x,y,z,world].is_liquid><br />
| Whether or not the block at the coordinates are a liquid. Can be true or false.<br />
|-<br />
| <location[x,y,z,world].light><br />
| Something, something, something... Erm... I'll finish this after I get more sleep.<br />
|}<br />
<br />
==NPC==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| <npc.id><br />
| The ID number of the NPC.<br />
|-<br />
| <npc.location><br />
| The coordinates of the NPC. [x,y,z,world]<br />
|-<br />
| <npc.location.previous_location><br />
| The last location the NPC was at.<br />
|-<br />
| <npc.location.standing_on><br />
| The Bukkit block name that the NPC is standing on.<br />
|-<br />
| <npc.location.standing_on_display><br />
| The formatted block name that the NPC is standing on.<br />
|-<br />
| <npc.location.world><br />
| The name of the world the NPC is in.<br />
|-<br />
| <npc.location.world_spawn><br />
| The coordinates of the spawn of the world that the NPC is currently in.<br />
|-<br />
| <npc.location.x><br />
| The x coordinate the NPC is at.<br />
|-<br />
| <npc.location.y><br />
| The y coordinate the NPC is at.<br />
|-<br />
| <npc.location.z><br />
| The z coordinate the NPC is at.<br />
|-<br />
| <npc.name><br />
| The NPC's name.<br />
|-<br />
| <npc.name.nickname><br />
| The NPC's nickname.<br />
|-<br />
| <npc.owner><br />
| The owner of the NPC.<br />
|}<br />
<br />
==Player==<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <player.chat_history><br />
| Last message the player sent.<br />
|-<br />
| <player.chat_history[X]><br />
| Message the player sent X times ago.<br />
|-<br />
| <player.equipment.boots><br />
| The Bukkit name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.equipment.boots.formatted><br />
| The formatted name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.health><br />
| The player's health, 1-20. Each number is half of a heart.<br />
|-<br />
| <player.health.formatted><br />
| The player's formatted health. Can be healthy, scraped, injured, seriously wounded, and dying.<br />
|-<br />
| <player.health.percentage><br />
| The player's health as a percentage.<br />
|-<br />
| <player.inventory.contains.display[display_name]><br />
| Checks if the player's inventory contains an item with a name chosen on an anvil. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.inventory.contains[item_id]><br />
| Checks if the player's inventory contains an item. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.food_level><br />
| The player's food level, 1-20. Each number is half of a thing-on-the-hunger-bar.<br />
|-<br />
| <player.food_level.formatted><br />
| The player's formatted food level. Can be healthy, parched, hungry, and famished.<br />
|-<br />
| <player.food_level.percentage><br />
| The player's food level as a percentage.<br />
|-<br />
| <player.group[group_name]><br />
| Checks if the player is in a group via Vault. Can be true or false.<br />
|-<br />
| <player.group[group_name].global>><br />
| Checks if the player is in a global group via Vault. Can be true or false.<br />
|-<br />
| <player.item_in_hand.enchantments><br />
| List of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level><br />
| List of enchantments and their levels on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level_only><br />
| List of levels of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand><br />
| [Planned v0.9] Contains all details of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.data><br />
| The material data of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.display><br />
| The name chosen on an anvil for the item the player is holding.<br />
|-<br />
| <player.item_in_hand.durability><br />
| The durability of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.id><br />
| The ID of the block or item the player is holding. All block and item IDs are found [http://www.minecraftwiki.net/wiki/Data_values here].<br />
|-<br />
| <player.item_in_hand.lore><br />
| List of lore on item in the player's hand.<br />
|-<br />
| <player.item_in_hand.max_stack><br />
| The maximum amount you can have in one inventory slot of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.material><br />
| Bukkit material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.material.formatted><br />
| Formatted material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.qty><br />
| The current amount of the inventory slot of the item the player is holding.<br />
|-<br />
| <player.is_banned><br />
| Whether the player is banned. Can be true or false.<br />
|-<br />
| <player.is_online><br />
| Whether the player is online. Can be true or false.<br />
|-<br />
| <player.is_op><br />
| Whether the player is an operator. Can be true or false.<br />
|-<br />
| <player.location><br />
| The coordinates of the player. [x,y,z,world]<br />
|-<br />
| <player.location.bed_spawn><br />
| The coordinates of the last bed the player slept in, if any.<br />
|-<br />
| <player.location.cursor_on[X]><br />
| The location of the block the player's cursor is on, within X range.<br />
|-<br />
| <player.location.standing_on><br />
| The Bukkit block name that the player is standing on.<br />
|-<br />
| <player.location.standing_on.formatted><br />
| The formatted block name that the player is standing on.<br />
|-<br />
| <player.location.world><br />
| The name of the world the player is in.<br />
|-<br />
| <player.location.world_spawn><br />
| The coordinates of the spawn of the world that the player is currently in.<br />
|-<br />
| <player.location.x><br />
| The x coordinate the player is at.<br />
|-<br />
| <player.location.y><br />
| The y coordinate the player is at.<br />
|-<br />
| <player.location.z><br />
| The z coordinate the player is at.<br />
|-<br />
| <player.money><br />
| The amount of money in this player's account. Requires Vault and an economy plugin.<br />
|-<br />
| <player.name><br />
| The player's name.<br />
|-<br />
| <player.name.display><br />
| The player's display name. (The one that shows in chat.)<br />
|-<br />
| <player.mcmmo.level[skill_name]><br />
| The player's current level for an McMMO skill.<br />
|-<br />
| <player.money><br />
| How much money the player has, as a number. (0.0, 1.5, 2.25, etc.)<br />
|-<br />
| <player.money.asint><br />
| How much money the player has, as an integer. (0, 1, 2, etc.)<br />
|-<br />
| <player.money.currency><br />
| The currency set in this server's economy plugin.<br />
|-<br />
| <player.money.currency.plural><br />
| The currency set in this server's economy plugin, in its plural form.<br />
<br />
Examples: Dollars, pounds, coins<br />
|-<br />
| <player.money.currency.singular><br />
| The currency set in this server's economy plugin, in its singular form.<br />
<br />
Examples: Dollar, pound, coin<br />
|-<br />
| <player.script[script_name].failed><br />
| Checks if the player has failed a script. Can be true or false.<br />
|-<br />
| <player.script[script_name].finished><br />
| Checks if the player has finished a script. Can be true or false.<br />
|-<br />
| <player.time><br />
| The player's time in ticks, from 0 to 23999. For a quick view of what different tick values mean in real life hours, look [http://media-mcw.cursecdn.com/b/bc/Day_Night_Clock_24h.png here].<br />
|-<br />
| <player.time.period><br />
| The time period for this player. Can be "day" or "night".<br />
|-<br />
| <player.weather><br />
| The current weather in this player's world. Is "storming" if there's a storm, "sunny" if the weather is clear and it's daytime, and "clear" if the weather is clear and it's nighttime.<br />
|}<br />
<br />
==Util==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
|}<br />
<br />
==Text==<br />
<br />
===Colors===<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="25%" border="1"<br />
|-<br />
| width="60%" | <aqua><br />
| style="background-color:#55FFFF" |<br />
|-<br />
| <black><br />
| style="background-color:black" |<br />
|-<br />
| <blue><br />
| style="background-color:#5555FF" |<br />
|-<br />
| <dark_aqua><br />
| style="background-color:#00AAAA" |<br />
|-<br />
| <dark_blue><br />
| style="background-color:#0000AA" |<br />
|-<br />
| <dark_gray><br />
| style="background-color:#555555" |<br />
|-<br />
| <dark_green><br />
| style="background-color:#00AA00" |<br />
|-<br />
| <dark_purple><br />
| style="background-color:#AA00AA" |<br />
|-<br />
| <dark_red><br />
| style="background-color:#AA0000" |<br />
|-<br />
| <gold><br />
| style="background-color:#FFAA00" |<br />
|-<br />
| <gray><br />
| style="background-color:#AAAAAA" |<br />
|-<br />
| <green><br />
| style="background-color:#55FF55" |<br />
|-<br />
| <light_purple><br />
| style="background-color:#FF55FF" |<br />
|-<br />
| <red><br />
| style="background-color:#FF5555" |<br />
|-<br />
| <white><br />
| style="background-color:white" |<br />
|-<br />
| <yellow><br />
| style="background-color:#FFFF55" |<br />
|}<br />
<br />
==Pssst...==<br />
http://pastebin.com/KBADLinZ<br><br />
Here is a summary of them :)<br><br />
-Jeebs</div>Morphan1https://wiki.citizensnpcs.co/index.php?title=Denizen/Replaceable_Tags&diff=4630Denizen/Replaceable Tags2013-06-21T02:46:00Z<p>Morphan1: </p>
<hr />
<div>__TOC__<br />
<br />
==Location==<br />
All location tags require coordinates. You can have tags in the brackets [] or you can specify exact locations by yourself. For example, you could use <pre><location[<npc.location>].biome.temperature></pre> to get the temperature at the NPC's location.<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| <location[x,y,z,world].biome.formatted><br />
| The formatted name of the biome at coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.humidity><br />
| The current humidity at the coordinates.<br />
|-<br />
| <location[x,y,z,world].biome.temperature><br />
| The current temperature at the coordinates.<br />
|-<br />
| <location[x,y,z,world].distance[x,y,z,world]><br />
| The distance between 2 coordinates.<br />
|-<br />
| <location[x,y,z,world].formatted><br />
| The coordinates in an easier to read format.<br />
|-<br />
| <location[x,y,z,world].is_liquid><br />
| Whether or not the block at the coordinates are a liquid. Can be true or false.<br />
|-<br />
| <location[x,y,z,world].light><br />
| Something, something, something... Erm... I'll finish this after I get more sleep.<br />
|}<br />
<br />
==NPC==<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| <npc.id><br />
| The ID number of the NPC.<br />
|-<br />
| <npc.location><br />
| The coordinates of the NPC. [x,y,z,world]<br />
|-<br />
| <npc.location.previous_location><br />
| The last location the NPC was at.<br />
|-<br />
| <npc.location.standing_on><br />
| The Bukkit block name that the NPC is standing on.<br />
|-<br />
| <npc.location.standing_on_display><br />
| The formatted block name that the NPC is standing on.<br />
|-<br />
| <npc.location.world><br />
| The name of the world the NPC is in.<br />
|-<br />
| <npc.location.world_spawn><br />
| The coordinates of the spawn of the world that the NPC is currently in.<br />
|-<br />
| <npc.location.x><br />
| The x coordinate the NPC is at.<br />
|-<br />
| <npc.location.y><br />
| The y coordinate the NPC is at.<br />
|-<br />
| <npc.location.z><br />
| The z coordinate the NPC is at.<br />
|-<br />
| <npc.name><br />
| The NPC's name.<br />
|-<br />
| <npc.name.nickname><br />
| The NPC's nickname.<br />
|-<br />
| <npc.owner><br />
| The owner of the NPC.<br />
|}<br />
<br />
==Player==<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="100%" border="1"<br />
|-<br />
| width="30%" | <player.chat_history><br />
| Last message the player sent.<br />
|-<br />
| <player.chat_history[X]><br />
| Message the player sent X times ago.<br />
|-<br />
| <player.equipment.boots><br />
| The Bukkit name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.equipment.boots.formatted><br />
| The formatted name for the boots the player is wearing. Can also be used for chestplate, leggings, and helmet.<br />
|-<br />
| <player.health><br />
| The player's health, 1-20. Each number is half of a heart.<br />
|-<br />
| <player.health.formatted><br />
| The player's formatted health. Can be healthy, scraped, injured, seriously wounded, and dying.<br />
|-<br />
| <player.health.percentage><br />
| The player's health as a percentage.<br />
|-<br />
| <player.inventory.contains.display[display_name]><br />
| Checks if the player's inventory contains an item with a name chosen on an anvil. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.inventory.contains[item_id]><br />
| Checks if the player's inventory contains an item. You can also add .qty[X] to check if the player has an X amount of the item. Can be true or false.<br />
|-<br />
| <player.food_level><br />
| The player's food level, 1-20. Each number is half of a thing-on-the-hunger-bar.<br />
|-<br />
| <player.food_level.formatted><br />
| The player's formatted food level. Can be healthy, parched, hungry, and famished.<br />
|-<br />
| <player.food_level.percentage><br />
| The player's food level as a percentage.<br />
|-<br />
| <player.group[group_name]><br />
| Checks if the player is in a group via Vault. Can be true or false.<br />
|-<br />
| <player.group[group_name].global>><br />
| Checks if the player is in a global group via Vault. Can be true or false.<br />
|-<br />
| <player.item_in_hand.enchantments><br />
| List of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level><br />
| List of enchantments and their levels on item in player's hand.<br />
|-<br />
| <player.item_in_hand.enchantments_with_level_only><br />
| List of levels of enchantments on item in player's hand.<br />
|-<br />
| <player.item_in_hand><br />
| [Planned v0.9] Contains all details of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.data><br />
| The material data of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.display><br />
| The name chosen on an anvil for the item the player is holding.<br />
|-<br />
| <player.item_in_hand.durability><br />
| The durability of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.id><br />
| The ID of the block or item the player is holding. All block and item IDs are found [http://www.minecraftwiki.net/wiki/Data_values here].<br />
|-<br />
| <player.item_in_hand.lore><br />
| List of lore on item in the player's hand.<br />
|-<br />
| <player.item_in_hand.max_stack><br />
| The maximum amount you can have in one inventory slot of the item the player is holding.<br />
|-<br />
| <player.item_in_hand.material><br />
| Bukkit material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.material.formatted><br />
| Formatted material name of the item in the player's hand.<br />
|-<br />
| <player.item_in_hand.qty><br />
| The current amount of the inventory slot of the item the player is holding.<br />
|-<br />
| <player.is_banned><br />
| Whether the player is banned. Can be true or false.<br />
|-<br />
| <player.is_online><br />
| Whether the player is online. Can be true or false.<br />
|-<br />
| <player.is_op><br />
| Whether the player is an operator. Can be true or false.<br />
|-<br />
| <player.location><br />
| The coordinates of the player. [x,y,z,world]<br />
|-<br />
| <player.location.bed_spawn><br />
| The coordinates of the last bed the player slept in, if any.<br />
|-<br />
| <player.location.cursor_on[X]><br />
| The location of the block the player's cursor is on, within X range.<br />
|-<br />
| <player.location.standing_on><br />
| The Bukkit block name that the player is standing on.<br />
|-<br />
| <player.location.standing_on.formatted><br />
| The formatted block name that the player is standing on.<br />
|-<br />
| <player.location.world><br />
| The name of the world the player is in.<br />
|-<br />
| <player.location.world_spawn><br />
| The coordinates of the spawn of the world that the player is currently in.<br />
|-<br />
| <player.location.x><br />
| The x coordinate the player is at.<br />
|-<br />
| <player.location.y><br />
| The y coordinate the player is at.<br />
|-<br />
| <player.location.z><br />
| The z coordinate the player is at.<br />
|-<br />
| <player.money><br />
| The amount of money in this player's account. Requires Vault and an economy plugin.<br />
|-<br />
| <player.name><br />
| The player's name.<br />
|-<br />
| <player.name.display><br />
| The player's display name. (The one that shows in chat.)<br />
|-<br />
| <player.mcmmo.level[skill_name]><br />
| The player's current level for an McMMO skill.<br />
|-<br />
| <player.money><br />
| How much money the player has, as a number. (0.0, 1.5, 2.25, etc.)<br />
|-<br />
| <player.money.asint><br />
| How much money the player has, as an integer. (0, 1, 2, etc.)<br />
|-<br />
| <player.money.currency><br />
| The currency set in this server's economy plugin.<br />
|-<br />
| <player.money.currency.plural><br />
| The currency set in this server's economy plugin, in its plural form.<br />
<br />
Examples: Dollars, pounds, coins<br />
|-<br />
| <player.money.currency.singular><br />
| The currency set in this server's economy plugin, in its singular form.<br />
<br />
Examples: Dollar, pound, coin<br />
|-<br />
| <player.script[script_name].failed><br />
| Checks if the player has failed a script. Can be true or false.<br />
|-<br />
| <player.script[script_name].finished><br />
| Checks if the player has finished a script. Can be true or false.<br />
|-<br />
| <player.time><br />
| The player's time in ticks, from 0 to 23999. For a quick view of what different tick values mean in real life hours, look [http://media-mcw.cursecdn.com/b/bc/Day_Night_Clock_24h.png here].<br />
|-<br />
| <player.time.period><br />
| The time period for this player. Can be "day" or "night".<br />
|-<br />
| <player.weather><br />
| The current weather in this player's world. Is "storming" if there's a storm, "sunny" if the weather is clear and it's daytime, and "clear" if the weather is clear and it's nighttime.<br />
|}<br />
<br />
==Text==<br />
<br />
===Colors===<br />
<br />
{{Denizen Replaceable<br />
|<player.name>|The player's name.<br />
}}<br />
<br />
{| class="wikitable" width="25%" border="1"<br />
|-<br />
| width="60%" | <aqua><br />
| style="background-color:#55FFFF" |<br />
|-<br />
| <black><br />
| style="background-color:black" |<br />
|-<br />
| <blue><br />
| style="background-color:#5555FF" |<br />
|-<br />
| <dark_aqua><br />
| style="background-color:#00AAAA" |<br />
|-<br />
| <dark_blue><br />
| style="background-color:#0000AA" |<br />
|-<br />
| <dark_gray><br />
| style="background-color:#555555" |<br />
|-<br />
| <dark_green><br />
| style="background-color:#00AA00" |<br />
|-<br />
| <dark_purple><br />
| style="background-color:#AA00AA" |<br />
|-<br />
| <dark_red><br />
| style="background-color:#AA0000" |<br />
|-<br />
| <gold><br />
| style="background-color:#FFAA00" |<br />
|-<br />
| <gray><br />
| style="background-color:#AAAAAA" |<br />
|-<br />
| <green><br />
| style="background-color:#55FF55" |<br />
|-<br />
| <light_purple><br />
| style="background-color:#FF55FF" |<br />
|-<br />
| <red><br />
| style="background-color:#FF5555" |<br />
|-<br />
| <white><br />
| style="background-color:white" |<br />
|-<br />
| <yellow><br />
| style="background-color:#FFFF55" |<br />
|}<br />
<br />
==Pssst...==<br />
http://pastebin.com/KBADLinZ<br><br />
Here is a summary of them :)<br><br />
-Jeebs</div>Morphan1