Skip to content

占位符参考

PlaceholderAPI 占位符

扩展标识符:emakicooking

安装 PlaceholderAPI 后,EmakiCooking 会自动注册以下占位符。

占位符说明示例
%emakicooking_recipe_count%所有烹饪站配方总数。42
%emakicooking_recipe_count_chopping_board%砧板配方数量。8
%emakicooking_recipe_count_wok%炒锅配方数量。12
%emakicooking_recipe_count_grinder%研磨机配方数量。5
%emakicooking_recipe_count_steamer%蒸锅配方数量。6
%emakicooking_recipe_count_oven%烤箱配方数量。4
%emakicooking_recipe_count_juicer%榨汁机配方数量。3
%emakicooking_recipe_count_fermentation_barrel%发酵桶配方数量。4

使用示例

yaml
lore:
  - '<gray>总配方数: <white>%emakicooking_recipe_count%'
  - '<gray>炒锅配方: <white>%emakicooking_recipe_count_wok%'

内部模板变量

以下变量可用于配方的 structured_presentation(名称与 Lore 操作模板)中,使用 %variable% 格式。

变量说明示例
%recipe_id%配方 ID。grilled_steak
%recipe_name%配方显示名。烤牛排
%station_type%工位类型(文件夹名)。furnace
%phase%当前烹饪阶段。cooking
%output_source%产出物品源 ID。emaki:grilled_steak
%output_amount%产出数量。1
%output_chance%产出概率。100%
%output_amount_min%产出数量范围最小值。1
%output_amount_max%产出数量范围最大值。3

模板示例

yaml
structured_presentation:
  lore_actions:
    - action: "append"
      content:
        - ""
        - "<gray>配方: <white>%recipe_name%"
        - "<gray>工位: <white>%station_type%"
        - "<gray>产出: <white>%output_amount%x %output_source%"

动作上下文变量

烹饪奖励动作(CookingRewardService)触发时,以下变量会注入到 Action 上下文中:

变量说明示例
%player%玩家名称。Steve
%world%世界名称。world
%x%工位方块 X 坐标。100
%y%工位方块 Y 坐标。64
%z%工位方块 Z 坐标。-200
%recipe_id%当前配方 ID。grilled_steak
%station_type%工位类型。furnace
%outcome%烹饪结果。success
%slot_index%槽位索引。0

动作示例

yaml
actions:
  - type: message
    value: '<green>%player% 在 %station_type% 完成了 %recipe_id% 的烹饪!'

说明

  • PAPI 占位符不依赖玩家状态,recipe_count 系列为全局值,适合用于管理面板或计分板。
  • CoreLib 的内置上下文变量(%player_name%%player_uuid% 等)同样可用。