Are you an LLM? You can read better optimized documentation at /paid-plugins\lyinventory\inventories.md for this page in Markdown format
背包配置
背包文件通常放在 inventory 目录。每个背包都有独立 id、标题、大小、打开权限、打开条件、默认物品和槽位规则。
基础结构
yaml
示例背包:
id: "example"
title: "&8示例背包"
size: 54
permission: ""
condition: []1
2
3
4
5
6
2
3
4
5
6
| 配置 | 说明 |
|---|---|
id | 背包唯一 id |
title | 背包界面标题 |
size | 背包大小,通常为 9 的倍数 |
permission | 打开背包需要的权限 |
condition | 打开背包需要满足的条件 |
id 会被指令、变量、龙核映射和其他插件联动使用,建议使用英文或数字。
默认物品
yaml
default-set:
背景:
id: "160:15"
name: "&8"
lore: []
command: []
slot: "0-8,45-53"1
2
3
4
5
6
7
2
3
4
5
6
7
| 配置 | 说明 |
|---|---|
id | 展示物品 id |
name | 展示物品名称 |
lore | 展示物品说明 |
command | 点击后执行的指令 |
slot | 放置到哪些界面槽位 |
slot 支持单个槽位、多个槽位和范围写法,例如 0-8,17,26。
功能槽位
yaml
slot-set:
头饰槽:
slot: 10
id: "160:5"
name: "&a头饰槽"
lore:
- "&7可放入指定头饰"
replace-condition: []
click-command: []
unlock-condition: []
unlock-command: []
attribute-condition: []
take-out-condition: []
attribute-rate: 1.01
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
| 配置 | 说明 |
|---|---|
slot | 界面槽位 |
id | 空槽显示物品 id |
name | 空槽显示名 |
lore | 空槽说明 |
replace-condition | 物品放入条件 |
click-command | 点击槽位执行的指令 |
unlock-condition | 槽位解锁条件 |
unlock-command | 解锁成功后执行的指令 |
attribute-condition | 物品属性生效条件 |
take-out-condition | 物品取出条件 |
attribute-rate | 该槽位属性倍率 |
槽位类型名需要保持唯一。其他插件通过 LyInventoryReload#背包id#类型 读取槽位时,使用的就是这个类型名。
点击指令
yaml
click-command:
- "[console]say {player} 点击了背包槽位"1
2
2
常见前缀:
| 前缀 | 执行身份 |
|---|---|
[console] | 控制台执行 |
[op] | 临时以管理员身份执行 |
[player] | 玩家身份执行 |
点击指令适合做槽位说明、跳转菜单、购买解锁和任务引导。
属性倍率
yaml
attribute-rate: 0.51
attribute-rate 只有在主配置开启 attribute-rate-enable 后才会参与计算。它可以让同一件物品在不同槽位中提供不同强度的属性。
例如饰品栏可使用 1.0,副饰品栏可使用 0.5。