Skip to content

shop.yml:四分类商店

商店根节点必须只有 tabs,分类必须且只能是 backpackkitmedicalbuff。菜单为 6 行:分类槽位 0..8,商品槽位 9..53

通用显示字段

字段类型约束
display.materialMaterial有效 Bukkit 材质
display.custom-model-data非负整数,可选资源包模型值
display.name字符串菜单名
display.lore[]字符串列表价格由程序自动追加,请勿手写价格 lore
slot整数tab 为 0..8;entry 为 9..53;同层不可重复

条目类型

分类条目 ID / 字段价格与交付
backpack必须与四个背包档完全一致;仅 display,slot价格和权益取 backpack.yml
kit必须与五个装备档完全一致;仅 display,slot价格和装备券取 kits.yml
medical / buffID 匹配 [a-z0-9][a-z0-9-]*;需 display,slot,price,actionsprice >= 0;动作被解析成安全物品交付

actions 当前只允许 [console] minecraft:give %player_name% <有效材质> <数量>,数量 1..6400。不能借此执行任意命令,也不能用 /give、省略命名空间或改成 player;这是经济发货的防刷约束。Buff 商品的 ID 还应与 buffs.yml 中对应增益一致。

完整默认配置

yaml
# 背包与装备券条目只负责陈列(display/slot),价格由 backpack.yml / kits.yml 提供;
# 所有条目的价格 lore 由商店菜单自动追加,配置中不要手写。
tabs:
  backpack:
    display:
      material: CHEST
      name: "&6背包"
      lore:
        - "&7购买下一次入场使用的背包档位"
    slot: 1
    entries:
      small:
        display:
          material: CHEST
          name: "&f小型背包"
          lore:
            - "&74 × 2 格"
        slot: 11
      medium:
        display:
          material: BARREL
          name: "&a中型背包"
          lore:
            - "&74 × 3 格"
        slot: 20
      large:
        display:
          material: ENDER_CHEST
          name: "&b大型背包"
          lore:
            - "&74 × 4 格"
        slot: 29
      huge:
        display:
          material: SHULKER_BOX
          name: "&5巨型背包"
          lore:
            - "&74 × 6 格"
        slot: 38
  kit:
    display:
      material: NETHERITE_SWORD
      name: "&c装备券"
      lore:
        - "&7购买可在选装阶段使用的装备券"
    slot: 3
    entries:
      t4-basic:
        display:
          material: IRON_CHESTPLATE
          name: "&fT4 基础装备券"
          lore:
            - "&7铁制护甲与基础武器"
        slot: 10
      t4-full:
        display:
          material: IRON_BLOCK
          name: "&fT4 完整装备券"
          lore:
            - "&7全套铁甲、盾牌与远程武器"
        slot: 19
      t5-basic:
        display:
          material: DIAMOND_CHESTPLATE
          name: "&bT5 基础装备券"
          lore:
            - "&7钻石胸甲与高阶近战武器"
        slot: 28
      t5-mid:
        display:
          material: DIAMOND_BLOCK
          name: "&bT5 强化装备券"
          lore:
            - "&7全套钻甲与强化补给"
        slot: 37
      t5-full:
        display:
          material: NETHERITE_CHESTPLATE
          name: "&5T5 完整装备券"
          lore:
            - "&7顶级突击装备与完整补给"
        slot: 46
  medical:
    display:
      material: GOLDEN_APPLE
      name: "&a医疗"
      lore:
        - "&7战局中的即时恢复补给"
    slot: 5
    entries:
      golden-apple:
        display:
          material: GOLDEN_APPLE
          name: "&e金苹果 × 2"
          lore:
            - "&7即时恢复补给"
        slot: 12
        price: 600
        actions:
          - "[console] minecraft:give %player_name% golden_apple 2"
      enchanted-golden-apple:
        display:
          material: ENCHANTED_GOLDEN_APPLE
          name: "&d附魔金苹果"
          lore:
            - "&7强力恢复补给"
        slot: 21
        price: 3000
        actions:
          - "[console] minecraft:give %player_name% enchanted_golden_apple 1"
      cooked-beef:
        display:
          material: COOKED_BEEF
          name: "&6熟牛肉 × 16"
          lore:
            - "&7基础口粮"
        slot: 30
        price: 240
        actions:
          - "[console] minecraft:give %player_name% cooked_beef 16"
  buff:
    display:
      material: BLAZE_POWDER
      name: "&d增益"
      lore:
        - "&7战术增益消耗品"
    slot: 7
    entries:
      speed:
        display:
          material: SUGAR
          name: "&b疾行增益"
          lore:
            - "&7供增益系统识别的疾行材料"
        slot: 14
        price: 800
        actions:
          - "[console] minecraft:give %player_name% sugar 1"
      strength:
        display:
          material: BLAZE_POWDER
          name: "&c强袭增益"
          lore:
            - "&7供增益系统识别的强袭材料"
        slot: 23
        price: 1200
        actions:
          - "[console] minecraft:give %player_name% blaze_powder 1"
      resistance:
        display:
          material: MAGMA_CREAM
          name: "&6坚韧增益"
          lore:
            - "&7供增益系统识别的坚韧材料"
        slot: 32
        price: 1500
        actions:
          - "[console] minecraft:give %player_name% magma_cream 1"

常见错误与验证

  • 给背包/装备条目写 priceactions 会失败;它们的事实源在对应文件。
  • 分类缺失、商品槽位冲突、未知材质、命令数量为 0 都会保留旧配置。
  • /fkescape reload 后逐页打开 /fkescape shop;核对动态价格 lore。测试购买时同时验证余额只扣一次、库存只增加一次,断线/重复点击不得重复交付。