Skip to content

Latest commit

 

History

History
55 lines (28 loc) · 2.82 KB

09-Variables-List.md

File metadata and controls

55 lines (28 loc) · 2.82 KB

Variables List

Player: player

This variable will be replaced with the name of the player. If you add display argument, it will use display name instead of real name.

Example: %player.display%

NPC: npc

It's a very simple variable. It's replaced by the name of the NPC in player's language.

Example: %npc%

Objective: objective

Using this variable you can display a property of an objective. The first argument is an ID of the objective as defined in objectives.yml (not the type). Make sure that the player has this objective active or it will be replaced with nothing (""). Second argument is the name of a property you want to display. All properties are described in "Objectives List" chapter.

Example: %objective.kill_zombies.left%

Point: point

This variable displays the amount of points you have in some category or amount of points you need to have to reach a number. The first argument is the name of a category and the second argument is either amount or left:x, where x is a number.

Example: %point.reputation.left:15%

Global point: globalpoint

Works the same as normal point variable but instead of displaying points from a players category it displays points in a global, player independent category.

Example: %globalpoint.global_knownusers.left:100%

Item: item

With this variable you can display amount of specific items in player's inventory or a number needed to reach specific amount. The first argument is the name of an item (as defined in items.yml) and the second one is either amount or left:x, where x is a number.

Example: %item.stick.amount%

Version: version

This variable displays the version of the plugin. You can optionally add the name of the plugin as an argument to display version of another plugin.

Example: %version.Citizens%

Location: location

This variable resolves to player's current location, formatted as an absolute location format (more about it in the Reference chapter). The location will contain yaw and pitch. You can use it instead of coordinates as location arguments in events, conditions and objectives.

Example: %location%

Calculate mathematical expression: math.calc

This variable allows you to perform a calculation based on other variables (for example point or objective variables) and resolves to the result of the specified calculation. The variable always starts with math.calc:, followed by the calculation which should be calculated. Supported operations are +, -, *, / and ^. You can use ( ) and [ ] braces and also calculate absolute values with | | (but don't use this in the command event as it splits the commands at every |). If you want to use variables in the calculation, don't put % around them.

Example: %math.calc:100*(15-point.reputation.amount)%