Built-in Scripts
Built-in scripts which can be called quickly and easily in the menu.
Examples
#
# A simple custom script
# The returned value can be obtained with ${ID_OF_THE_SCRIPT}
#
Functions:
health: |-
function health(){
return player.getHealth()
}
health()
#
# You can create a script wich requires arguments
# You can specify them with ${ID_arg1_arg2_...}
# and use them in the script with {0}, {1}, ....
#
Functions:
flash: |-
function flash() {
var parsed = "%animations_<flash>{0}</flash>%"
return parsed.isEmpty() ? utils.emptyString("{0}".length()) : parsed
}
flash()
Usage
Each script must have a unique identifier
You can use
${SCRIPT_IDENTIFIER}
to get the value returned by a scriptYou can use arguments with `${IDENTIFIER_ARG1_ARG2} and then get the value in the script with {0}, {1}...
Since you have to use {0} for *scripts*' arguments, you have to use PlaceholderAPI placeholders to get the menu's arguments:
%trmenu_args_0%,%trmenu_args_1%, %trmenu_args_2%...
'Health':
update: 20
display:
material: RED_STAINED_GLASS_PANE
name: 'Health'
lore:
- ''
- '&cHealth: ${health}'
- ''
actions:
all: 'close'
# ...
lore:
- '&b${flash_➥} &3Left-Click &7to display more info.'
Last updated
Was this helpful?