Skip to content

商店配置

商店配置文件位于 plugins/AIOShop/shops/ 目录,每个 .yml 文件定义一个商店。

基础结构

yaml
# shops/my-shop.yml
display-name: "&2&l我的商店"
description:
  - "&7商店描述第一行"
  - "&7商店描述第二行"

gui-template: "general-store"
permission: "aioshop.shop.myshop"  # 可选

items:
  item_id:
    # 商品配置...

配置项详解

基础属性

属性类型必填说明
display-name字符串商店显示名称
description列表商店描述
gui-template字符串使用的 GUI 模板
permission字符串访问权限

随机商店配置

yaml
random-generation:
  enabled: true
  generation-mode: "ITEM_BY_ITEM"  # 或 "RARITY_FIRST"
  period: "PERSONAL_DAILY"
  count: 8                          # ITEM_BY_ITEM 模式
  rarity-counts:                    # RARITY_FIRST 模式
    普通: 4
    稀有: 2
  allow-duplicates: false
  manual-refresh-enabled: true

商品配置

基础商品

yaml
items:
  bread:
    display-name: "&f新鲜面包"
    description:
      - "&7美味的面包"
    buy-price:
      amount: 5.0
      currency: "VAULT"
    buy-rewards:
      self:
        type: "ITEM"
        item: "bread"
        amount: 1
    enabled: true

完整商品配置

yaml
items:
  advanced_item:
    # 物品标识
    item-id: "diamond_sword"           # 使用 items.yml 中的物品模板
    neige-item-id: "mythic_sword"      # NeigeItems 物品 ID(可选)

    # 显示信息
    display-name: "&b&l钻石剑"
    description:
      - "&7锋利的钻石剑"
      - "&7攻击力 +7"

    # 稀有度(随机商店使用)
    rarity: "史诗"

    # 购买配置
    buy-price:
      amount: 500.0
      currency: "VAULT"
    buy-rewards:
      self:
        type: "ITEM"
        item: "diamond_sword"
        amount: 1

    # 出售配置
    sell-item-matcher:
      material: "diamond_sword"
    sell-rewards:
      main:
        type: "CURRENCY"
        amount: 200.0
        currencyType: "VAULT"

    # 限购配置
    limit-type: "PERSONAL_DAILY"
    limit-amount: 5
    # 或随机范围
    # limit-amount-range: "3-8"

    # 出售限制
    sell-limit-type: "GLOBAL_DAILY"
    sell-limit-amount: 100

    # 折扣
    discount: 20  # 20% 折扣

    # 权限
    permission: "aioshop.vip"

    # 启用状态
    enabled: true

价格配置

Vault 货币

yaml
buy-price:
  amount: 100.0
  currency: "VAULT"

PlayerPoints 点券

yaml
buy-price:
  amount: 50
  currency: "PLAYER_POINTS"

物品货币

yaml
buy-price:
  amount: 5
  currency: "ITEM"
  currency-item:
    material: "gold_ingot"
    display-name: "金锭"

PAPI 货币

yaml
buy-price:
  amount: 100
  currency: "PAPI"
  currency-name: "vault_eco"

奖励配置

物品奖励

yaml
buy-rewards:
  self:
    type: "ITEM"
    item: "diamond"          # 物品 ID 或 items.yml 中的模板
    amount: 1

货币奖励

yaml
sell-rewards:
  main:
    type: "CURRENCY"
    amount: 100.0
    currencyType: "VAULT"    # VAULT, PLAYER_POINTS, PAPI

经验奖励

yaml
buy-rewards:
  exp:
    type: "EXPERIENCE"
    amount: 50
    isLevel: false           # false=经验点, true=等级

命令奖励

yaml
buy-rewards:
  command:
    type: "COMMAND"
    commands:
      - "give {player} golden_apple 1"
      - "broadcast &e{player} 购买了商品!"

物品匹配器

用于出售物品的匹配:

yaml
sell-item-matcher:
  # 基础匹配
  material: "diamond"

  # 名称匹配
  display-name: "特殊钻石"
  nameContains: "钻石"

  # Lore 匹配
  loreContains: "稀有物品"

  # NBT 匹配
  nbt-contains:
    - key: "custom.id"
      value: "special_diamond"

仅购买/仅出售

仅购买

yaml
items:
  buy_only:
    buy-price:
      amount: 100
      currency: "VAULT"
    buy-rewards:
      self:
        type: "ITEM"
        item: "diamond"
        amount: 1
    # 不配置 sell-item-matcher 和 sell-rewards

仅出售

yaml
items:
  sell_only:
    buy-price: null  # 或不配置 buy-price
    sell-item-matcher:
      material: "emerald"
    sell-rewards:
      main:
        type: "CURRENCY"
        amount: 50
        currencyType: "VAULT"

完整示例

yaml
# shops/example-shop.yml
display-name: "&6&l示例商店"
description:
  - "&7这是一个示例商店"
  - "&7展示各种配置方式"

gui-template: "general-store"

items:
  # 基础商品
  bread:
    display-name: "&f面包"
    buy-price:
      amount: 5
      currency: "VAULT"
    buy-rewards:
      self:
        type: "ITEM"
        item: "bread"
        amount: 1
    sell-item-matcher:
      material: "bread"
    sell-rewards:
      main:
        type: "CURRENCY"
        amount: 2
        currencyType: "VAULT"
    enabled: true

  # 限购商品
  golden_apple:
    display-name: "&6金苹果"
    buy-price:
      amount: 100
      currency: "VAULT"
    buy-rewards:
      self:
        type: "ITEM"
        item: "golden_apple"
        amount: 1
    limit-type: "PERSONAL_DAILY"
    limit-amount: 10
    enabled: true

  # 复合奖励
  gift_box:
    display-name: "&d礼包"
    buy-price:
      amount: 500
      currency: "VAULT"
    buy-rewards:
      item:
        type: "ITEM"
        item: "diamond"
        amount: 5
      money:
        type: "CURRENCY"
        amount: 100
        currencyType: "VAULT"
      exp:
        type: "EXPERIENCE"
        amount: 10
        isLevel: true
    enabled: true

基于 CC0 1.0 许可发布