跳转到正文
iPlugin

变量与占位符

在名称、Lore、标题和消息中显示动态内容。

两种写法

写法内容示例
{{语句}}Kether 计算结果{{&status}}、{{page get}}
%占位符%PlaceholderAPI 扩展结果%player_name%

菜单变量

在菜单打开前设置初始值:

# 菜单顶层
events:
  pre_open: 'ctx set status to ready true'

在图标中使用变量,并在点击后更新:

# 写在 icons 中
A:
  material: PAPER
  name: '&f状态:{{&status}}'
  action: 'ctx set status to done icon update'

打开显示 ready,点击后显示 done。变量也可通过菜单打开参数传入,见命令绑定。

元素数据

生成器 output 使用当前元素的字段。字段 title 对应 element_title,在线玩家的 name 对应 element_name:

# 写在 generator 的 output 中
name: '&f{{&element_title}}'

元素字段只在对应生成器元素中使用,见生成器。

PlaceholderAPI

name: '&a%player_name%'

该写法需要 PlaceholderAPI 与提供 player_name 的扩展。

Invero 数据占位符读取内容
%invero_data_player_theme%当前玩家的 theme
%invero_data_global_season%全局 season

持久键的设置见持久数据。

内容更新

修改变量后,使用 icon update / icons update 刷新显示;sub 条件变化时重新选择子状态,见图标刷新。只有窗口标题文字需要变化时才使用 menu title update。NULL 或原样占位符的处理见问题排查。

最后更新于