Skip to content

占位符参考

PlaceholderAPI 占位符

扩展标识符:emakistrengthen

安装 PlaceholderAPI 后,EmakiStrengthen 会自动注册以下占位符。所有占位符读取玩家主手物品的强化数据。

占位符说明示例
%emakistrengthen_mainhand_star%主手物品当前星级(不可强化时为 0)。7
%emakistrengthen_mainhand_temper%主手物品锻印等级。3
%emakistrengthen_mainhand_recipe%主手物品关联的强化配方 ID(无则为空)。weapon_basic
%emakistrengthen_mainhand_eligible%主手物品是否可强化。true
%emakistrengthen_mainhand_success_count%主手物品累计成功次数。5
%emakistrengthen_mainhand_failure_count%主手物品累计失败次数。2
%emakistrengthen_mainhand_max_star%配方最大星级上限。12
%emakistrengthen_mainhand_success_rate%当前星级的强化成功率。65.5
%emakistrengthen_mainhand_crack_level%裂缝等级(锻印值)。3

使用示例

yaml
lore:
  - '<gray>星级: <white>%emakistrengthen_mainhand_star%'
  - '<gray>锻印: <white>%emakistrengthen_mainhand_temper%'
  - '<gray>配方: <white>%emakistrengthen_mainhand_recipe%'
  - '<gray>可强化: <white>%emakistrengthen_mainhand_eligible%'

内部模板变量

StrengthenSnapshotBuilder 在配方的 structured_presentationname_actionslore_actions 和属性行模板中提供以下变量。

通用变量

变量说明示例
%star%当前星级。7
%temper%锻印等级。3
%max_temper%配方最大锻印上限。10
%temper_color%锻印颜色标记(锻印 > 0 时为 <red>,否则为 <green>)。<red>

属性行变量

用于属性行模板中:

变量说明示例
%id%属性 ID。physical_attack
%sign%正负号。+
%value%格式化后的属性绝对值。15.5
{<stat_id>}任意累计属性值(动态)。120

模板示例

yaml
structured_presentation:
  lore_actions:
    - action: "append"
      content:
        - ""
        - "<yellow>★ 强化等级: +%star%"
        - "%temper_color%锻印: %temper%/%max_temper%"
        - "<gray>攻击力: <white>%sign%%value%"

动作上下文变量

强化成功/失败动作(StrengthenActionCoordinator)触发时,以下变量会注入到 Action 上下文中:

变量说明示例
%strengthen_recipe_id%强化配方 ID。weapon_basic
%strengthen_recipe%强化配方显示名。基础武器强化
%strengthen_star%结果星级。8
%strengthen_temper%锻印等级。3
%strengthen_max_star%配方最大星级。12
%strengthen_success_rate%本次尝试的成功率。65.5
%strengthen_show_item%结果物品的 hover 文本。[影刃 +8]
%was_star%强化前的星级(仅失败动作)。8
%dropped%物品是否掉落(仅失败动作)。false
%protected%是否触发了保护(仅失败动作)。true

说明

  • PlaceholderAPI 占位符中所有 key 以 mainhand_ 开头,读取主手物品数据。
  • 玩家主手没有强化数据的物品时,startemper 返回 0recipe 返回空字符串。
  • 内部模板变量仅在 Strengthen 的 structured_presentation 中生效。
  • {<stat_id>} 是动态变量,取决于配方中配置的属性 key。