Skip to content

拍卖行

功能介绍

拍卖行基于公共变量实现的全服材料交易系统,支持左键购买、右键出售,并实时同步库存

效果展示

img

配置文件

yaml


#          Powered by YeeCore          #
#        https://www.goodmc.cn/        #



title: "§c§l材料拍卖行"
layout:
  - "         "
  - "         "
  - "         "
  - "         "
  - "         "
  - "         "
entry:
  库存变量: "{functionName}库存"
  库存: "%variable_info_{库存变量}%"
function:
  暗黑指挥官核心:
    index: 10
    display:
      item: "mm {functionName} 1"
    entry:
      "购买价格": "2200"
      "出售价格": "2000"
    demand: []
    action: []
  恶魔战士核心:
    index: 11
    display:
      item: "mm {functionName} 1"
    entry:
      "购买价格": "5200"
      "出售价格": "5000"
    demand: []
    action: []
  深渊领主核心:
    index: 12
    display:
      item: "mm {functionName} 1"
    entry:
      "购买价格": "12000"
      "出售价格": "10000"
    demand: []
    action: []
  炼狱魂王核心:
    index: 13
    display:
      item: "mm {functionName} 1"
    entry:
      "购买价格": "22000"
      "出售价格": "20000"
    demand: []
    action: []
# 执行function时
on-execute:
  rules:
    - condition:
        - "{left-click}"
        - "money.look()>={购买价格} else '{prefix}§f购买所需金币不足'"
        - "{库存} >= 1 else '{prefix}&f库存不足'"
      action:
        - 物品给予('mm','{functionName}',1)
        - money.take({购买价格})
        - variable.take('{库存变量}',1)
        - showitem('{prefix}§7购买成功 ${获取物品名()}')
    - condition:
        - "{right-click}"
        - "物品统计('mm','{functionName}') >=1 else '{prefix}§f您没有这么多材料可以出售'"
      action:
        - 物品扣除('mm','{functionName}',1)
        - money.add({出售价格})
        - variable.add('{库存变量}',1)
        - showitem('{prefix}§7出售成功 ${获取物品名()}')
message:
  desc:
    demand:
      item: '§7购买需要 §f%demand% §7%name%'
      money: '§7购买需要 §f%demand% §7金币'
      points: '§7购买需要 §f${取整(%demand%)} §7点券'
      currency: '§7购买需要 §f%demand% §7%name%'
    state:
      enough: "§7[§a✔§7] §3点击购买"
      insufficient: "§7[§c✘§7] §3点击购买"
      condition: "§c购买条件不足"
      purchase-limit: "§7[§c§l!§7] §e已购买上限"
global-desc:
  - ""
  - "&7当前库存: &f{库存}"
  - "&7购买价格: &f{购买价格}"
  - "&7出售价格: &f{出售价格}"
  - ""
  - "§7当前拥有 §f%variable_info_金币% §7金币"
  - ""
  - "§f> §a左键购买  §f|  §b右键出售 §f<"
yaml
暗黑指挥官核心库存:
  default: 0
  min: 0
  public: true
恶魔战士核心库存:
  default: 0
  min: 0
  public: true
深渊领主核心库存:
  default: 0
  min: 0
  public: true
炼狱魂王核心库存:
  default: 0
  min: 0
  public: true