内置货币类型

货币标识说明依赖
VAULTVault 经济系统金币Vault + 经济插件(如 EssentialsX)
PLAYERPOINTSPlayerPoints 点数PlayerPoints 插件

使用内置货币

Vault 金币

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

sell-rewards:
  main:
    type: "CURRENCY"
    amount: 50.0
    currencyType: "VAULT"

PlayerPoints 点数

buy-price:
  amount: 50
  currency: "PLAYERPOINTS"

sell-rewards:
  main:
    type: "CURRENCY"
    amount: 25
    currencyType: "PLAYERPOINTS"

PAPI 自定义货币

通过 PlaceholderAPI 变量,可以将任何插件的数值作为货币使用。

配置文件位置

plugins/AIOShop/papi-currencies.yml

配置结构

currencies:
  货币ID:
    display-name: "显示名称"
    placeholder: "PAPI占位符(不含%符号)"
    add-command: "增加余额的命令"
    take-command: "扣除余额的命令"
    description: "货币描述(可选)"

完整示例

currencies:
  # 使用其他插件的点数作为货币
  guild_coins:
    display-name: "&e公会币"
    placeholder: "guild_player_coins"
    add-command: "guild coins add {player} {amount}"
    take-command: "guild coins take {player} {amount}"
    description: "公会系统的专属货币"

  # 使用经验值作为货币
  exp_currency:
    display-name: "&a经验值"
    placeholder: "statistic_player_exp"
    add-command: "xp add {player} {amount}"
    take-command: "xp add {player} -{amount}"
    description: "使用玩家经验值作为货币"
注意placeholder 不需要包含 % 符号,插件会自动添加。 命令中的 {player}{amount} 会被自动替换。

在商品中使用 PAPI 货币

# 使用 PAPI 货币作为购买价格
buy-price:
  amount: 100
  currency: "PAPI:guild_coins"  # 格式:PAPI:货币ID

# 使用 PAPI 货币作为出售奖励
sell-rewards:
  main:
    type: "CURRENCY"
    amount: 50
    currencyType: "PAPI:guild_coins"

物品作为货币

可以使用物品作为购买的"货币",即以物易物:

items:
  trade_item:
    item-id: "netherite_ingot"
    display-name: "&6用钻石换下界合金"
    description:
      - "&7消耗 10 颗钻石"
      - "&7获得 1 个下界合金锭"
    buy-price:
      amount: 10
      currency: "ITEM:diamond"  # 使用 10 颗钻石作为价格
    buy-rewards:
      self:
        type: "ITEM"
        item: "netherite_ingot"
        amount: 1
    enabled: true
物品货币格式:ITEM:物品名称,如 ITEM:diamondITEM:emerald

混合货币商店

同一个商店中可以有使用不同货币的商品:

items:
  gold_item:
    item-id: "gold_ingot"
    display-name: "&6金锭"
    buy-price:
      amount: 50
      currency: "VAULT"
    # ...

  points_item:
    item-id: "diamond"
    display-name: "&b钻石"
    buy-price:
      amount: 100
      currency: "PLAYERPOINTS"
    # ...

  guild_item:
    item-id: "emerald"
    display-name: "&a绿宝石"
    buy-price:
      amount: 30
      currency: "PAPI:guild_coins"
    # ...