界面模板
饰品栏界面由 plugins/EmakiAccessory/gui/accessory_gui.yml 描述。
槽位必须显式写 type
饰品格必须显式写 type: "accessory_slot",不写 type 的格子只是纯装饰。
可用类型
type | 作用 |
|---|---|
accessory_slot | 饰品格。键名必须等于槽位实例 id。 |
orphan_slot | 孤儿格,展示该页不再声明的槽位里的饰品供玩家取回。 |
page_enable | 启用格。点击把当前页设为生效页;只有生效页的饰品产生效果。 |
page_switch | 切页格。键名必须等于目标页的 page_id,点击切换到该页。 |
一个布局可以被多页共用:pages/*.yml 的 gui_template 指向布局 id。共用时要注意布局里摆放的槽位实例必须被该页的 parts 声明,否则该格对这一页不可用。
accessory_slot
键名必须等于槽位实例 id,格式为 <部位id>_<序号>,序号从 1 开始,与 parts.yml 里该部位的 count 对应。
例如 ring 部位 count: 2 就要摆放 ring_1 和 ring_2 两格:
slots:
ring_1:
slots: [12]
type: "accessory_slot"
item:
source: "LIGHT_GRAY_STAINED_GLASS_PANE"
components:
custom_name: "<gray>戒指</gray>"
lore:
- "<dark_gray>放入饰品以生效</dark_gray>"
ring_2:
slots: [13]
type: "accessory_slot"每个 accessory_slot 只能占一格。写成多格时只有第一格生效,其余会记录警告。
parts.yml 里声明了但这里没摆放的槽位同样会记录警告,且玩家无法使用该槽位。
槽位的 item 段定义空槽时显示的占位物品,放入饰品后由真实物品替换。
orphan_slot
该页不再声明的槽位里的饰品会显示在这里供玩家取回,取走后不能再放回。缩减 parts.yml 的 count、删除部位,或把部位从某页的 parts 移除,都会产生孤儿。
slots:
orphan:
slots: "37-43"
type: "orphan_slot"
item:
source: "GRAY_STAINED_GLASS_PANE"
components:
custom_name: "<gray>"
tooltip_display:
hide_tooltip: true孤儿格可以占多格。判定按「所属页是否声明该槽位」,因此其他页的饰品不会被当成孤儿。
不摆放孤儿格也不会丢东西:数据仍在文件里,但玩家没有界面取回入口,只能靠 /eacc retrieve <页> 或改回配置。
page_enable
点击把当前打开的页设为生效页。只有生效页的饰品提供属性、技能与套装件数,其余页保留数据但不生效。
slots:
page_enable:
slots: [8]
type: "page_enable"
item:
source: "lime_dye"page_switch
键名必须等于目标页的 page_id,点击切换到该页。切页只是换界面,不改变生效页;要让新页生效仍需点 page_enable。
slots:
main:
slots: [0]
type: "page_switch"
item:
source: "gold_ingot"
secondary:
slots: [1]
type: "page_switch"
item:
source: "iron_ingot"目标页设了 permission 且玩家没有该权限时,切页会被拒绝。
装饰格
不写 type 的格子是纯装饰,例如边框:
slots:
frame:
slots: "0-8,45-53"
item:
source: "BLACK_STAINED_GLASS_PANE"
components:
custom_name: "<gray>"
tooltip_display:
hide_tooltip: true顶层键
| 键 | 示例值 | 说明 |
|---|---|---|
id | "accessory_gui" | 模板 id,供 pages/*.yml 的 gui_template 引用。 |
gui_type | CHEST | 界面类型。 |
title | "<dark_gray>饰品栏</dark_gray>" | 界面标题,支持 MiniMessage。 |
rows | 6 | 行数。 |
slots | — | 槽位定义。 |