Placeholders

Overview

Placeholders are dynamically replaced when a script is executed and depend on the sender, and the user who is executing the script.

Usage:

- The basic usage is to just put a {placeholder} in your script e.g. {player}
- For non functional placeholders you can add modifiers which change which player you are referring to:
e.g. {group:Empire92} would get the group of me rather than whoever is executing
- Functional placeholders usually have multiple modifiers you can use.
MORE INFORMATION ON SCRIPTING COMING SOON!

Common Modifiers:

Modifiers are used to alter the perspective from which a placeholder is evaluated from

ModifierDescriptionExample
usernameHas a placeholder evaluate as a different playere.g. {money:Notch}
worldnameChanges the world to evaluate withe.g. {time:world1}
listA list is anything seperated by commas ","e.g. {index:a,b,c:0}
will return a
nodeA node is anything seperated by a period "."e.g. {hasperm:essentials.build}
*locationSets the location to evaluate withA location can be a player, a world or a set of coords e.g. W,X,Y,Z
Where W=the world
e.g {biome:world1,15,30,26}

*Offline users will be introduced in version 0.5.0 - this means you can get the location or held item etc of an offline player.

Basic Placeholders

* indicates an optional placeholder

Player StatsModifiersExplanation
{player}*usernameReturns the players name.
{sender}Returns the original player who called the script
{display}*usernameReturns the player's nickname
{money}*usernameReturns a player's money
{prefix}*usernameReturns a player's prefix
{suffix}*usernameReturns a player's suffix
{clicks}*integerReturns the number of times the user has clicked the sign
{group}*usernameReturns a player's group
{x}*usernameReturns the x value of a user
{y}*usernameReturns the y value of a user
{z}*usernameReturns the z value of a user
{lvl}*usernameReturns a player's XP level
{exhaustion}*usernameReturns the player's exhaustion
{health}*usernameReturns the player's health
{exp}*usernameReturns a player's experience
{hunger}*usernameReturns a player's hunger
{air}*usernameReturns a player's air
{grounded}*usernameReturns true if the player is on the ground
{passenger}*usernameReturns the vehicle the player is in or false
{maxhealth}*usernameReturns a player's max health
{maxair}*usernameReturns a player's max air
{gamemode}*usernameReturns the player's gamemode
{direction}*usernameReturns the player's facing direction
{biome}*location#Returns the biome at the player's location
{itemname}*usernameReturns the item a player is holding
{itemid}*usernameReturns the ID the player is holding
{itemamount}*usernameReturns the number of items a player is holding
{durability}*usernameReturns the item durability for what a player is holding
{dead}*usernameReturns true/false if player is alive/dead
{sleeping}*usernameReturns true if player is using a bed
{whitelisted}*usernameReturn true if player is whitelisted
{operator}*usernameReturns true if the player is Op
{sneaking}*usernameReturns true if the player is sneaking
{itempickup}*usernameReturns true if a player can pick up items
{flying}*usernameReturns true if the player is flying
{blocking}*usernameReturns true if the player is blocking
{firstjoin}*usernameReturns the timestamp (seconds) for when the player joined
{age}*usernameReturns the time since the player joined in seconds.
{lastplayed}*usernameReturns the time since the player last played.
LocationsModifiersExplanation
{player}*usernameThe player's name can be used as a location
{sender}The sender's name can be used as a location
{bed}*usernameThe location of a player's bed
{compass}*usernameThe location a player's compass points
{world}*worldname OR *usernameReturns the name of the world
{x}*usernameReturns the x value of a user
{y}*usernameReturns the y value of a user
{z}*usernameReturns the z value of a user
{spawn}*worldname OR *usernameReturns the location of a world's spawn
{hasperm:NODE}NODEReturns true if a player has the permission

Note: A location is simply W,X,Y,Z - where W is the world.

{world}*locationReturns the name of the world
{worldtype}*locationReturns the type of world at a location(e.g. FLAT, AMPLIFIED)
{seed}*locationReturns the seed for a world
{biome}*locationReturns the biome at the player's location
{weatherduration}*locationReturns the duration in ticks of the weather
{environment}*locationReturns the environment at a location(e.g. NETHER, END)
{storm}*locationReturns true if there is a storm at a location
{thunder}*locationReturns true if there is thunder at a location
{spawn}*locationReturns the spawn location for a world
{online}*locationReturns the list of online players
Optional arg of worldname

{animals}*locationReturns if animals are enabled for a world
{monsters}*locationReturns if monsters are enabled for a world
{autosave}*locationReturns true if autosaving is enabled
{worldticks}*locationReturns the time in ticks for a world
{time}*locationThe time (24hr) in a world
{time12}*locationThe time (12hr) in a world
Server statsModifiersExplanation
{ip}*usernameReturns the player's IP address
{plugins}Returns the list of plugins
{slots}Returns the max slots on the server
{port}Returns the port the server is running on
{version}Returns the minecraft version
{allowflight}Returns true if flying is allowed
{viewdistance}Returns the server view distance
{defaultgamemode}Returns the server's default gamemode
{autosave}Returns true if autosaving is enabled
{animals}*locationReturns if animals are enabled for a world
{monsters}*locationReturns if monsters are enabled for a world
{motd}Returns the server MOTD
{difficulty}*locationReturns the difficulty for a world
TimeModifiersExplanation
{firstjoin}*usernameReturns the timestamp (seconds) for when the player joined
{age}*usernameReturns the time since the player joined in seconds.
{lastplayed}*usernameReturns the time since the player last played.
{worldticks}*locationReturns the time in ticks for a world
{time}*locationThe time (24hr) in a world
{time12}*locationThe time (12hr) in a world
{epoch}Returns the seconds since the epoch
{epochmilli}Returns the milliseconds since the epoch
{epochnano}Returns the nanoseconds since the epoch
ListsModifiersExplanation
{online}Returns the list of online players
{playerlist}Returns the whole list of players
{plugins}Returns the list of plugins
{worlds}Returns the list of worlds
{gamerules}Returns the list of gamerules
{banlist}Returns the list of banned players
{baniplist}Returns the list of banned IPs
{operators}Returns the list of operators
{whitelist}Returns the whitelist
{range:X}XReturns a list from 0 to X
{range:X,Y}X, YReturns a list from X to Y
{index:LIST:INDEX}LIST, INDEXReturns the item at INDEX in a list
{split:LIST:DELIMETER}LIST, DELIMETERSplits a string by a specified delimeter
{randchoice:LIST}LISTReturns a random choice from a list
{length:LIST}LISTReturns the length of the list
{setindex:LIST:INDEX:VALUE}LIST, INDEX, VALUEReturns a new list with the item set at index
{delindex:LIST:INDEX:VALUE}LIST, INDEX, VALUEReturns the list with the item deleted at the index
{getindex:LIST:VALUE}LIST, VALUEReturns the index for an item in the list
{listhas:LIST:VALUE}LIST, VALUEReturns true if a list contains a value
{contains:STRING:VALUE}STRING, VALUEReturns true if a string contains a value
{sublist:X:Y}X, YReturns a new list from index X to index Y
{listreplace:VALUE:VALUE2}VALUE, VALUE2Returns a new list with occurrences of VALUE replaced with VALUE2
{count:LIST:VALUE}LIST, VALUEReturns the number of times a value appears in a list

Note: a list is just entries seperated by a comma e.g. 1,2,3

ScriptingModifiersExplanation
{js:SCRIPT}The javascript function is very powerful and can do anything you can do in javascriptExamples
{js:(new Date()).getTime()}

{js:file.js}Executes a javascript fileExamples
{js:test.js}
Javascript files are located in the scripts folder for the plugin

{elevated}Returns true if the script is elevated
{line}Returns the current script line
{rand:X}XReturns a random number between 0 and X
{matchgroup:STRING}STRINGReturns the closest matching group (useful to getting the case right)
{matchplayer:STRING}STRINGReturns the closest matching online player
{substring:X:Y}X, YReturns part of the string from index X to index Y
{replace:VALUE:VALUE2}VALUE, VALUE2Returns a new string with occurrences of VALUE replaced with VALUE2
{config:NODE}NODEReturns the value from the config for the given node
{MSG:ID}IDReturns the given message from the language file

Comments

Posts Quoted:
Reply
Clear All Quotes