Skip to content

物品定义完整参考

把文件放入 plugins/SealItems/items/ 或其子目录。顶层键是稳定物品 ID;文件名只用于整理。文件名以 示例- 开头时不会加载,因此第一次使用应复制文件、改名、再修改副本。

从复制到发放

  1. 复制 items/示例-物品.ymlitems/tutorial.yml
  2. 保留一个顶层物品,改成新的小写 ID。
  3. 删除不需要的 gameplay 节点;写出节点就表示参加对应玩法。
  4. 执行 /si admin system reload items config 或全量重载。
  5. /si admin item list 确认 ID,再用 /si admin item give <玩家> <ID> 1 发放。
  6. 主手持有物品,执行 /si admin item inspect 检查身份和状态。

完整注释示例

yaml
# 文件名以“示例-”开头,不会加载;复制后改名即可启用。
# 一个文件可写多个物品,也可按武器、防具、材料继续分文件夹。

# 完整装备示例;下面列出装备可用的全部字段。
demo_blade:
  # 原版物品材质。
  material: NETHERITE_SWORD
  # 物品名称;支持 MiniMessage 颜色。
  name: '<gold>示例回响长剑'
  # 物品说明;每项显示一行。
  lore:
    - '<gray>用于测试 SealItems 全部玩法。'
  # true 可与同类物品堆叠;装备通常填 false。
  stackable: false
  # 物品分类;供界面筛选。
  category: weapon
  # 装备槽;套装不另写槽位时会使用这里。
  slot: main-hand
  # 物品标签;供词条等规则筛选。
  tags: [weapon, demo]
  # 资源包模型编号;不用资源包时删除。
  model: 10001
  # true 表示不损失耐久。
  unbreakable: true
  # 初始损伤值;0 表示全新。
  damage: 0
  # true 强制显示附魔光效。
  glow: false
  # 隐藏的原版物品信息;字段名使用小写和短横线。
  flags: [hide-attributes]
  # 原版附魔;左边是附魔名,右边是等级。
  enchantments:
    # 锋利 III。
    sharpness: 3
  # 属性名由 config.yml 选择的属性插件提供。
  attributes:
    # 同一属性需要同时写固定值和百分比时使用展开写法。
    physical_attack:
      # 固定增加 12 点。
      add: 12
      # 最终增加 10%。
      total-percent: 10%
    # 生成时在 18 到 24 之间取值。
    max_health: [18, 24]
  # 随机词条设置。
  affixes:
    # 引用 rules/affixes 中的规则。
    scheme: demo_weapon_affixes
    # 这件物品抽取词条时使用的等级。
    affix-level: 20
    # 只覆盖这件物品的词条数量;删除则使用规则或品质设置。
    slots:
      # 主词条容量与初始数量。
      primary: { capacity: 2, initial: 2 }
      # 副词条容量与初始数量。
      secondary: { capacity: 1, initial: 1 }
  # 品质设置;fixed 与 pool 只填一种。
  quality:
    # 固定品质可改写为 fixed: demo_common;fixed 与 pool 只填一种。
    # 按权重随机品质;数字越大越常见。
    pool: { demo_common: 80, demo_epic: 20 }
  # 写出节点即开启该物品的玩法;不需要 enabled。
  gameplay:
    # 鉴定规则。
    identification: demo_identification
    # 重铸与洗练规则。
    modification: demo_modification
    # 宝石孔规则;maximum-sockets 只覆盖这件物品的上限。
    sockets: { rule: demo_weapon_sockets, maximum-sockets: 3 }
    # 强化规则;maximum-level 只覆盖这件物品的上限。
    enhancement: { rule: demo_weapon_enhancement, maximum-level: 20 }
    # 分解规则;maximum-batch 只覆盖单次处理上限。
    decomposition: { rule: demo_equipment_decomposition, maximum-batch: 9 }
    # 绑定规则。
    binding: demo_binding
    # 套装编号;槽位自动使用上面的 main-hand。
    set: demo_adventurer

# 防具示例;展示固定品质和自定义套装槽位。
demo_chestplate:
  # 原版物品材质。
  material: LEATHER_CHESTPLATE
  # 玩家看到的名称。
  name: '<aqua>示例回响胸甲'
  # 防具不堆叠。
  stackable: false
  # 物品分类。
  category: armor
  # 装备槽。
  slot: chestplate
  # 词条筛选标签。
  tags: [armor, demo]
  # 皮革染色。
  color: '#315A68'
  # 防具参与的玩法。
  gameplay:
    # 所有物品都可绑定;这里复用同一规则。
    binding: demo_binding
    # 明确填写套装编号与槽位。
    set: { id: demo_adventurer, slots: [chestplate] }

# 宝石物品;宝石行为直接写在物品内。
demo_ruby:
  # 原版材质。
  material: RED_DYE
  # 玩家看到的名称。
  name: '<red>示例红宝石'
  # 宝石可以堆叠。
  stackable: true
  # 界面分类。
  category: gem
  # 筛选标签。
  tags: [gem, fire, demo]
  # 写出 gem 即表示这是宝石。
  gameplay:
    # 宝石行为。
    gem:
      # 宝石分类;孔型与共鸣按分类判断。
      categories: [fire, elemental]
      # 同组宝石共用互斥数量上限。
      exclusive-group: demo_elemental_core
      # 这颗宝石的生效数量上限;删除某项表示不限制该项。
      limits:
        # 单件装备最多生效 1 颗同名宝石。
        same-gem-per-item: 1
        # 全身最多生效 2 颗同名宝石。
        same-gem-equipped: 2
        # 单件装备最多生效 1 颗同互斥组宝石。
        exclusive-group-per-item: 1
        # 全身最多生效 2 颗同互斥组宝石。
        exclusive-group-equipped: 2
      # 默认提供的属性;是否把属性写入装备 Lore 由 config.yml 全局控制。
      attributes:
        # 固定增加 20 点最大生命。
        max_health: { add: 20 }
      # 按装备孔位的 context 追加属性。
      contexts:
        # 孔位 context 为 weapon 时生效。
        weapon:
          # 增加 12 点并最终增加 10% 物理攻击。
          physical_attack: { add: 12, total-percent: 10% }

# 图纸物品;学习后解锁指定配方。
demo_blueprint:
  # 原版材质。
  material: PAPER
  # 玩家看到的名称。
  name: '<gold>示例长剑图纸'
  # 图纸可以堆叠。
  stackable: true
  # 界面分类。
  category: blueprint
  # 图纸玩法。
  gameplay:
    # 图纸学习规则。
    blueprint:
      # 学习后解锁的配方编号。
      recipes: [demo_blade_recipe]
      # true 表示学习后消耗一张图纸。
      consume: true

# 下列材料供整套示例互相引用。
demo_identify_scroll:
  # 原版材质。
  material: PAPER
  # 玩家看到的名称。
  name: '<aqua>示例鉴定卷轴'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 重铸材料。
demo_reforge_stone:
  # 原版材质。
  material: AMETHYST_SHARD
  # 玩家看到的名称。
  name: '<light_purple>示例重铸石'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 洗练材料。
demo_refine_stone:
  # 原版材质。
  material: QUARTZ
  # 玩家看到的名称。
  name: '<white>示例洗练石'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 词条锁定材料。
demo_locking_wax:
  # 原版材质。
  material: HONEYCOMB
  # 玩家看到的名称。
  name: '<gold>示例锁定蜡'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 初级强化保护符。
demo_guard_charm:
  # 原版材质。
  material: PRISMARINE_CRYSTALS
  # 玩家看到的名称。
  name: '<aqua>示例初级保护符'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material
  # 强化辅助材料的行为直接写在物品内。
  gameplay:
    # 失败时最多抵消 1 级降级;保护符无论成败都会消耗。
    enhancement-material: { protection-levels: 1 }

# 高级强化保护符。
demo_guard_charm_high:
  # 原版材质。
  material: ECHO_SHARD
  # 玩家看到的名称。
  name: '<light_purple>示例高级保护符'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material
  # 强化辅助材料行为。
  gameplay:
    # true 表示失败时完全不降级;保护符无论成败都会消耗。
    enhancement-material: { protect-all: true }

# 宝石操作材料。
demo_gem_dust:
  # 原版材质。
  material: GLOWSTONE_DUST
  # 玩家看到的名称。
  name: '<yellow>示例宝石粉尘'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 强化幸运材料。
demo_luck_powder:
  # 原版材质。
  material: GLOWSTONE_DUST
  # 玩家看到的名称。
  name: '<yellow>示例幸运粉尘'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material
  # 强化辅助材料行为。
  gameplay:
    # 每投入 1 个增加 5 个成功百分点。
    enhancement-material: { luck-bonus-percent: 5 }

# 高代价解绑材料。
demo_unbind_contract:
  # 原版材质。
  material: NETHER_STAR
  # 玩家看到的名称。
  name: '<red>示例解绑契约'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 合成与分解材料。
demo_iron_scrap:
  # 原版材质。
  material: IRON_NUGGET
  # 玩家看到的名称。
  name: '<gray>示例铁屑'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material

# 武器强化直升材料。
demo_boost_scroll:
  # 原版材质。
  material: EXPERIENCE_BOTTLE
  # 玩家看到的名称。
  name: '<gold>示例武器直升卷轴'
  # true 允许堆叠。
  stackable: true
  # 物品分类。
  category: material
  # 强化辅助材料行为。
  gameplay:
    # 直升规则。
    enhancement-material:
      # 仅在装备正好 +15 时可用。
      boost:
        # 起始强化等级。
        from-level: 15
        # 使用后直接达到的等级。
        to-level: 20
        # 允许使用的物品 category;本例只允许武器。
        categories: [weapon]