docs/Functional Place Holders

Functional Place Holders

To Getting Started

Functional Place Holders are similar to Place Holders except they are replaced at the time they are executed in the script and most of them take one or more arguments. $object.Variable and <placeholders> may be used as arguments. You may not use a Functional Place holder inside another Functional Place Holder.

Functional Place Holders Specific to Chat Event

<chatword:index>This will return the word typed in the chat line at the index. Index starts at 1. If an index is out of range a 'null' text is returned.

Functional Place Holders Specific to Command Triggers

<cmdarg:index>This will return the argument typed in the command line not including the command itself. Index starts at 1. If an index is out of range a 'null' text is returned.
See Place Holders for Command Triggers for more info

General Purpose Functional Place Holders

<haspermission:argument>Replace argument with a permission node as in some.node
Will replace with a boolean true or false depending on if the triggering player has the supplied permission.
<haspotioneffect:argument>Replace argument with the name of a Potion Effect
Will replace with a boolean true or false depending on if the triggering player has the supplied Potion Effect.
<currentloc:optionalarg>This place holder now takes an optional argument of playername
If no argument is provided it will return the triggering players current location x,y,z. If a player name is provided it will return the current location of the player provided if player is found online. If player is not online will return null
<random0to:argument>Replace argument with an integer number
Will replace with a random number from 0 to the number supplied.
<random1to:argument>Replace argument with an integer number
Will replace with a random number from 1 to the number supplied.
<health:>No argument
Will replace with an integer of the players current health at this moment in the script.
<issneaking:>No argument
Will replace with a boolean true or false depending on if the player is currently sneaking at this moment in the script.
<issprinting:>No argument
Will replace with a boolean true or false depending on if the player is currently sprinting at this moment in the script.
<totalexp:optionalarg>Gets a players Total Experience earned so far. Replace optionalarg with the name of a player. If player is not found a 'null' text is returned. If playername is not provided then the triggering players total exp is returned.
<relativeloc:arg1:arg2>Replace arg1 with a location, replace arg2 with a relative location
This will be replaced with a new location relative to arg1 by arg2. As an example:
<relativeloc:122,67,-218:5,-2,15> This would be replaced with 127,65,203
<relativeloc:$obj.var:20,0,3> or <relativeloc:<triggerloc>:5,-2,15>
<hasmoney:arg1:arg2>Replace arg1 with the name of the player and arg2 with a the amount of money you want to see if player has. Replaces with true | false - depending on success
Requires Vault with Economy support
<givemoney:arg1:arg2>Replace arg1 with name of player and arg2 with a the amount of money you want to give player. Replaced with true | false - depending on success
Requires Vault with Economy support
<takemoney:arg1:arg2>Replace arg1 with name of player and arg2 with a the amount of money you want to take from player. Replaced with true | false - depending on success. If player does not have enough money this returns false and does not take any.
Requires Vault with Economy support
<isblocktype:arg1:arg2:arg3>Replace arg1 with location to check and arg2 with the block id and arg3 with the data byte. Replaced with true | false - depending on if the block at location matches.
Examples: <isblocktype:33,65,122:2:0> or <isblocktype:$Obj.Var:<blocktype>> as long as $Obj.Var is a location or <isblocktype:<triggerloc>:$Obj.Var> as long as the $Obj.Var is of type str in the format of 76:5
<distance:arg1:arg2>Replace arg1 with a location, replace arg2 with a location
this will be replaced with an integer representing the distance in blocks between the two locations.
<distance:22,67,123:44,71,153> or <distance:<triggerloc>:<playerloc>> or <distance:$loc.var1:22,67,$temp.z>
<startswith:arg1:arg2>Replace arg1 with a string, replace arg2 with a string to test
this will be replaced with a true | false depending on if arg2 starts with arg1.
<startswith:Lex:LexLaiden> or <startswith:Lex:<playername>> or <startswith:$string.var1:$string.var2>
<endswith:arg1:arg2>Replace arg1 with a string, replace arg2 with a string to test
this will be replaced with a true | false depending on if arg2 ends with arg1.
<endswith:Laiden:LexLaiden> or <endswith:Laiden:<playername>> or <endswith:$string.var1:$string.var2>
<direction:returntype>returns the current direction of the triggering player.
ReturnType is the type you want returned. Replace with INT or TEXT
INT will return direction as an integer 0-15. 0 = NORTH, 1 = NORTH_NORTH_EAST, 2 = NORTH_EAST and so on...
TEXT will return a string NORTH, NORTH_NORTH_EAST and so on...
<secondticks:arg1>Returns the seconds since January 1970. Replace arg1 with a number you want added to it. 0 if you only whant the accual seconds
Example: <secondcticks:0> will return the actual seconds.
Example: <secondcticks:60> will return the seconds plus 60 seconds
Example: <secondcticks:-30> will return the actual seconds minus 30 seconds.
<getarea:arg>Replace arg with the location to get. Returns the area name or null if not in an area
Example: <getarea:<playerloc>> or <getarea:$obj.var>
<hour:>Returns the hour. this is game time not real time and it is 0 to 23 no am or pm. 15 would be 3pm
<min:>Returns the minute. this is game time not real time and it is 00 to 59
<getblocklos:proc:range>This is a Line Of Sight function It usses the line of sight of the triggering player. proc can be LOC, NAME, TYPE, ID, DATA and range is the max range in blocks to test and returns the first block found. Not only is this useful for dealing with blocks but it is a great way to get the location the player is looking at.
This returns different values depending on the :proc argument
LOC - returns the location as x,y,z
NAME - returns the Name of the block
TYPE - returns id:data as in 36:1
ID - returns the block id
DATA - returns the data byte of the block
Returns null text if no block is reached within the range so besure you test for null before using the return.
<var:$Obj.Var>Gets the value of an Object Variable. This will be usefull for dynamicaly modifying variable names for possible array creation and usefull for more dynamic use of @CALL
Example: $varArray.s<var:$some.arrayIndex>
Assuming $some.arrayIndex = 12 then you would end up with an object variable named $varArray.s12
This is not required for normal $ObjVar use. as in:
@IF i $<playername>.var = 22
@BROADCAST $some.value
It is only needed for creating unicq variable names.
<getchar:string:index>Returns the character at index in string. Index starts at 1. If index is out of bounds a 'null' text is returned.
<hasitem:PLAYER:ITEMID>This will search the PLAYER's Inventory for ITEMID and return the total quantity found. If item is not found will return 0
<takeitem:PLAYER:ITEMID:QUANTITY>This will search the PLAYER's Inventory for QUANTITY of ITEMIDs and take them if QUANTITY is avalible, If PLAYER does not have enough, ITEMID's are not removed and false is returnd.
<giveitem:PLAYER:ITEMID:QUANTITY>This will give PLAYER QUANTITY of ITEMID's. This returns the amount accually given. Player nay not have enough room in inventory for full quntity.
If you need to specify an ID such as Blue Wool 35:3 then you will need to do it with a variable like @SETSTR $obj.var 35:3 and then <hasitem:<playername>:$obj.var> or <takeitem:<playername>:$obj.var:20>
<uuid:PLAYER>Obtain an offline player UUID
Example: <uuid:WinneonSword>
<food:PLAYER>Obtain a player's food level
<saturation:PLAYER>Obtain a player's saturation level
<playeruuid>Returns the unique identifier of the triggering player.
<playerloc:x>Returns the X coord of the triggering player.
<playerloc:y>Returns the Y coord of the triggering player.
<playerloc:z>Returns the Z coord of the triggering player.
<holdingitem:[player]:[material]>Returns true or false if [player] is holding [material]
Example: @IF b <holdingitem:<playername>:cobblestone> = true
<clickedslot>The slot number from an Inventory Event
<clickeditem>The material name of the clicked item in an Inventory Event
<clickeditemname>The display name of the clicked item in an Inventory Event
<inventorytitle>The title of the inventory involved in an Inventory Event To test for spaces, use "_"
<clickeditemlore:index>The lore of the clicked item in an Inventory Event
Example: <clickeditemlore:<<color red>>0> would return the first line of lore
<eval:>Completes the math for the argument.
Usage: <eval:[math]>
Example: <eval:$object.variable%*4*100+10*%object.variable2%+10>
Info: Variables must be separated by "%" symbols so that the script can read them properly.
Example: To say "5 times $object.var plus 7" it would be <eval:5*%$object.var%+7>
<systemtime:default>Displays the date and time. You can change default to your preferred format.
See this page for help on formatting.
http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html
The default is set at EEEEE, MMMMM dd, H:mm
<signtext:coords:line>Grabs the sign text on the line at coords. The first line is 0. Coord format is 50,50,50.
<sn:>Supernesting. It reads the statement backwards and converts all of the variables into one final string.
Example: <sn:$var.$var2.$var3.$var4.$var5.$var6.var7>

To Getting Started