Built-in Scripts
Built-in scripts which can be called quickly and easily in the menu.

Examples

Script without arguments
1
#
2
# A simple custom script
3
# The returned value can be obtained with ${ID_OF_THE_SCRIPT}
4
#
5
6
Functions:
7
health: |-
8
function health(){
9
return player.getHealth()
10
}
11
health()
Copied!
Script with arguments
1
#
2
# You can create a script wich requires arguments
3
# You can specify them with ${ID_arg1_arg2_...}
4
# and use them in the script with {0}, {1}, ....
5
#
6
7
Functions:
8
flash: |-
9
function flash() {
10
var parsed = "%animations_<flash>{0}</flash>%"
11
return parsed.isEmpty() ? utils.emptyString("{0}".length()) : parsed
12
}
13
flash()
Copied!

Usage

  • Each script must have a unique identifier
  • You can use ${SCRIPT_IDENTIFIER} to get the value returned by a script
  • You 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%...
1
'Health':
2
update: 20
3
display:
4
material: RED_STAINED_GLASS_PANE
5
name: 'Health'
6
lore:
7
- ''
8
- '&cHealth: ${health}'
9
- ''
10
actions:
11
all: 'close'
Copied!
1
# ...
2
lore:
3
- '&b${flash_➥} &3Left-Click &7to display more info.'
Copied!
Last modified 1yr ago
Copy link