Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # javascript_placeholders.yml
- # You can create custom placeholders which utilize javascript to determine the result of the custom placeholder you create.
- # You can specify if the result is based on a boolean or the actual javascript.
- #
- # If you do not specify a type: the placeholder will default to a boolean type
- # A boolean type must contain a true_result: and false_result:
- #
- # A string type only requires the expression: entry
- #
- # Javascript placeholders can contain normal placeholders in the expression, true_result, or false_result
- # These placeholders will be parsed to the correct values before the expression is evaluated.
- #
- # Your javascript placeholders will be identified by: %javascript_<identifier>%
- #
- # Javascript placeholder format:
- #
- # BOOLEAN TYPE
- # <identifier>:
- # expression: <expression>
- # type: 'boolean'
- # true_result: <result if expression is true>
- # false_result: <result if expression is false>
- #
- # STRING TYPE
- # <identifier>:
- # expression: <expression>
- # type: 'string'
- #
- #
- # ==== ADVANCED VARIABLES ====
- # DO NOT USE THESE VARIABLES UNLESS YOU KNOW WHAT YOU ARE DOING!
- #
- # You can access a few Bukkit API classes and methods using certain keywords:
- #
- # Using "BukkitServer" in your javascript will return Bukkit.getServer()
- # You can use any methods inside of the Server class:
- #
- # Example: BukkitServer.getBannedPlayers().size().toFixed()
- # Will return how many players are banned
- #
- # This variable is handy if you want to iterate through all online players.'
- #
- # Using "BukkitPlayer" in your javascript will return the Player object you are setting placeholders for.
- # You can use any methods inside of the Player class:
- #
- # Example: BukkitPlayer.hasPermission("some.permission")
- # Will return if the player has a specific permission
- # This variable is handy if you want to check a players permission node, or access other methods inside of
- # the player class for the specified player.
- #
- # More advanced variables are coming soon! Only use these variables if you know what you are doing!
- #
- # ==================
- #
- #
- # Javascript placeholder examples:
- #
- # millionaire:
- # expression: '%vaulteco_balance% >= 1000000'
- # type: 'boolean'
- # true_result: '&aMillionaire'
- # false_result: '&cbroke'
- # is_staff:
- # expression: '"%vault_group%" == "Moderator" || "%vault_group%" == "Admin" || "%vault_group%" == "Owner"'
- # type: 'boolean'
- # true_result: '&bStaff'
- # false_result: '&ePlayer'
- # health_rounded:
- # expression: 'Math.round(%player_health%)'
- # type: 'string'
- # staff_online:
- # expression: 'var i = 0; for (var p in BukkitServer.getOnlinePlayers()) { if (BukkitServer.getOnlinePlayers()[p].hasPermission("staff.online")) {i = i+1;};} i.toFixed();'
- # type: 'string'
- #
- #
- # You can optionally specify a file that the javascript expression will be loaded from if your expression
- # is bigger than 1 line. To specify javascript be loaded from a file, follow this format:
- #
- # is_op:
- # expression: 'file: is_op.js'
- # type: 'string'
- #
- # The following placeholder will attempt to load javascript from the /plugins/DeluxeChat/javascripts/is_op.js file
- # if the folder/file exists. If the folder/file does not exist it will be created.
- # You must specify the file extension with the file name. Any file extension is accepted.
- is_op:
- expression: 'file: is_op.js'
- type: string
- staff_online:
- expression: var i = 0; for (var p in BukkitServer.getOnlinePlayers()) { if (BukkitServer.getOnlinePlayers()[p].hasPermission("staff.online")) {i = i+1;};} i.toFixed();
- type: string
- banned:
- expression: BukkitServer.getBannedPlayers().size().toFixed()
- type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement