内置脚本
可在菜单内快速调用的内置脚本
示例
#
# 菜单内置的自定义脚本变量
# 通过 ${ID_参数_参数} 的方式可以调用
#
Functions:
health: |-
function math(){
return player.getHealth()
}
math()
Functions:
flash: |-
function flash() {
var parsed = "%animations_<flash>{0}</flash>%"
return parsed.isEmpty() ? utils.emptyString("{0}".length()) : parsed
}
flash()
调用
每个内置脚本都有独一无二的 Id 标识
在菜单内容中,你可以使用 ${Id} 的形式调用
若需提供参数,则按照 ${Id_参数1_参数2} 的格式调用
参数在脚本中以 {0}, {1} ... 的形式使用,若需要菜单传参,则使用 PlaceholderAPI 变量
'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?