💰 AdventureMoney

AdventureMoney 是 PlayCraft 独立经济与游戏币提供器,同时管理 Vault 银币、A币、G币和 PlayerPoints 兼容余额,并提供税率、公益金、账单与统一收支通知。

🏦

Vault 提供器

可替换现有经济提供器,为商店等插件提供统一银币账户。

📈

分段税率

收入按金额区间扣税,支持免税权限和独立税收通知。

🎮

游戏币

A币、G币以及基于 G币的 PlayerPoints 兼容层。

📒

交易追踪

收入、支出、税收、转账、管理和捐款日志。

版本1.0.3
服务端Spigot / Paper 1.21.4,Java 21
必需依赖Vault
可选依赖PlaceholderAPI、LuckPerms
存储本地 YAML 或 MySQL + HikariCP

📥 安装与数据库

  1. 安装 Vault,并将 AdventureMoney 放入 plugins/
  2. 启动生成 Settings/Economy.ymlSettings/Database.yml
  3. 单服可保留本地 YAML;群组服启用 MySQL。
  4. 确认日志显示 AdventureMoney 已注册为 Vault Economy Provider。
database:
  enabled: false
  mysql:
    host: localhost
    port: 3306
    database: adventuremoney
    username: root
    password: ""
    table-prefix: "am_"
  sync-interval: 30
⚠️ 表前缀说明

共享同一套余额的服务器必须使用同一数据库和表前缀;只有确实需要隔离经济时才使用不同前缀。

🪙 货币体系

货币精度/定位接口
银币两位小数,主经济Vault
A币一位小数,专属游戏币AdventureMoney CoinManager
G币一位小数,通用游戏币CoinManager / PlayerPoints 桥
金币PlayerPoints 显示名称兼容层取 G币整数部分
公益金全服公共银币账户转账与 PAPI

各货币的接收、支出和转账权限彼此独立,适合在完成正式玩家认证前限制经济行为。

🏦 Vault 银币

economy:
  enabled: true
  currency:
    name: "银币"
    symbol: "银"
  vault:
    provide: true
    replace-existing-providers: true

账户限制

  • receive:是否可接收收入。
  • spend:是否可消费。
  • transfer-send / transfer-receive:玩家转账。
  • 启用 LuckPerms 离线查询后,可对离线玩家检查认证权限。
💡 经济迁移

replace-existing-providers 会抢占 Vault 服务。已有经济插件时先在测试服核对余额迁移和加载顺序。

📈 税率系统

收入区间默认税率
0—1,0000%
1,000—10,0005%
10,000—100,00010%
100,000 以上15%

max: -1 表示无上限。拥有 adventuremoney.eco.tax.exempt 的玩家免税。

追踪范围

普通收入和商店收入都能显示毛收入、税额与净到账;税收记录由日志系统保留,默认 30 天。

💸 转账与公益金

玩家转账

/pay <玩家> <数量> [原因]
  • 最低金额默认 0.01,无最高限制。
  • 禁止给自己转账。
  • 原因默认可选,最多 32 字符。

公益金

/pay <数量> treasury [原因]
/money treasury

捐款默认全服播报,并可推动 AdventurePass 的 week4_donate_5000 任务。管理员可使用 /pay forcedonate

🎮 A币与 G币

游戏币系统使用独立权限和转账上下限,不经过 Vault 税率。

命令说明
/coin balance [玩家]查看 A币和 G币
/coin pay <玩家> <acoin|gcoin> <数量>游戏币转账
/coin types查看币种
/coin give|take|set管理员修改余额
/coin reset <玩家>重置两种游戏币

默认最小转账 0.1。AdventurePlayerPoints 将 PlayerPoints API 的点数映射到 G币。

📒 账单与通知

日志类型

可分别追踪 earnspendtaxtransferadmindonate,默认保存 30 天。

玩家反馈

  • Chat:默认开启。
  • Title:默认开启。
  • ActionBar / BossBar:默认关闭。
  • 银币、PlayerPoints、A币、G币可分别覆盖开关。

/money logs [数量] 查看自己的账单;管理员可指定玩家和条数。

⌨️ 命令

命令说明
/money / /money wallet查看钱包
/money top银币排行榜
/money logs [玩家] [数量]交易记录
/money treasury公益金
/pay <玩家> <数量> [原因]银币转账
/pay <数量> treasury [原因]捐款
/pay <玩家> balance管理员查询余额
/pay <玩家> give|take|set <数量> [原因]管理员改款
/pay forcedonate <玩家> <数量>强制捐款
/coin ...游戏币命令组
/money reload重载配置

🔑 权限

权限默认用途
adventuremoney.eco.query所有人查询自己
adventuremoney.eco.receive/spend所有人接收与支出银币
adventuremoney.eco.transfer.send/receive所有人转账
adventuremoney.eco.tax.exempt无人免税
adventuremoney.eco.adminOP经济管理
adventuremoney.coin.receive/spend所有人游戏币收支
adventuremoney.coin.transfer.send/receive所有人游戏币转账
adventuremoney.coin.view.othersOP查看他人
adventuremoney.coin.adminOP游戏币管理

📊 PAPI 变量

变量前缀为 amoney

变量结果
%amoney_balance%银币数值
%amoney_balance_formatted%格式化银币
%amoney_acoin% / _gcoin%A币 / G币
%amoney_points%G币向下取整后的 PlayerPoints
%amoney_treasury%公益金余额
%amoney_last_income_amount%最近收入金额
%amoney_last_income_reason%最近收入原因
%amoney_last_expense_amount%最近支出金额
%amoney_last_expense_source%最近支出来源

🔗 插件联动

插件作用
Vault向全服插件提供银币 Economy 服务
PlaceholderAPI钱包、游戏币、公益金和最近交易变量
LuckPerms检查离线玩家经济资格
AdventurePass公益金捐款推进任务
AdventurePlayerPoints以 G币支撑 PlayerPoints API 和命令

🧰 故障排查

Vault 未使用 AdventureMoney

  • 确认 Vault 已先加载。
  • 检查 economy.vault.providereplace-existing-providers
  • 移除重复经济提供器或调整加载顺序。

群组服余额不同步

  • 所有服启用 MySQL并连接同一库表。
  • 确认各服币种配置一致。
  • 检查数据库账号的建表、读写权限和 30 秒同步任务。

玩家无法收款

检查 receive、transfer receive 权限;启用 LuckPerms 离线检查时还要确认玩家已完成正式认证。