跨模块集成
Item 模块通常作为装备、材料、消耗品和展示物品的统一来源。它可以被 Attribute、Forge、Strengthen、Gem、Skills、Cooking 等模块引用。跨模块引用时,推荐使用 CoreLib 的物品来源短横线格式,例如 emakiitem-shadow_ingot。
集成方式
| 场景 | 推荐方式 |
|---|---|
| 作为配方材料 | 在其他模块的 item_sources 中引用 EmakiItem ID。 |
| 作为装备基础 | 在物品定义中写入属性、组件、套装、触发器和 PDC。 |
| 作为技能消耗品 | 在 Skills 条件或动作中检查物品来源。 |
| 作为宝石或强化材料 | 使用稳定 ID,并避免只依赖名称或 Lore。 |
Forge 中引用
yaml
materials:
- item_sources:
- "emakiitem-shadow_ingot"
amount: 3
capacity_cost: 5Forge 当前配方材料使用 item_sources 列表描述材料来源。
Gem 中引用
宝石定义使用 item_sources 识别哪种物品是宝石:
yaml
id: "ruby_t1"
display_name: "<red>红宝石 I</red>"
gem_type: "attack"
item_sources:
- "emakiitem-ruby_t1"
socket_compatibility:
- "attack"
- "universal"插槽物品配置使用 match.item_sources 判断哪些装备可以拥有插槽:
yaml
match:
item_sources:
- "emakiitem-shadow_blade"
slot_groups:
- "weapon"Strengthen 中引用
yaml
stars:
1:
materials:
- item_sources:
- "emakiitem-strengthen_stone"
amount: 1PDC 与 Lore
跨模块集成应优先使用 PDC 保存真实数据,Lore 只作为展示层。这样可以避免语言切换、颜色变化或其他插件改 Lore 导致数据失效。
排查建议
- 物品无法被识别时,先确认 EmakiItem 物品是否写入了稳定 ID。
- 配方材料无法提交时,检查
item_sources是否使用了正确来源前缀。 - 外部插件生成的同名物品不会自动等同于 EmakiItem 物品,除非它拥有对应 PDC 标记。