现金返还
Vault 现金返还周期,适用于 Paper 1.20.6-26.3、Purpur 1.21.11 / 26.2 和 Folia 1.20.6-26.3 · Java 21+
玩家在商店消费以填充进度条。当进度条满时,现金返还将变为激活状态,系统将通过 Vault 自动返还他们下一次消费的一定比例金额。当配额耗尽后,周期重置并重新开始填充。
1.4.0 更新内容
- 玩家菜单 -
/cb 打开原生 GUI:包含一个状态页面和一个分页历史记录页面,5 或 6 行,实时刷新,可配置的填充物材质和点击音效。该界面为只读模式,因此没有需要领取或提取的内容。
- 自定义商店支持 - 支持由插件自身收费的商店。
- 无缝升级 - 无需更改数据库。文本命令保留,且可在配置文件中关闭菜单功能。
周期工作原理
- 填充 (FILL) - 购买行为会增加进度条的值。这些购买不会产生现金返还。
- 激活 (ACTIVATE) - 在达到 100% 时,进度条解锁现金返还配额。
- 发放 (PAYOUT) - 在激活状态下进行的每次购买都会按配置的比例(默认为 30%)进行返还。
- 重置 (RESET) - 当配额归零时,周期重新开始。
功能特性
- 玩家菜单 - 状态页面(等级、模式、填充条、剩余配额、累计现金返还)以及带分页的历史记录。
- 防崩溃发放 - 每次发放都在 Vault 存款之前于数据库中记录,防止崩溃后重复支付。
/cb admin recover 处理遗留的待结算款项,且已支付的款项会被阻止,直到你使用 force 确认它们。
- 无重复计数 - 一次购买对应一次发放,即使商店插件触发了多个事件。
- 大额购买全额计算 - 价值超过多个周期的购买会精确计算,不会被截断。
- 基于等级的目标和现金返还率 - 通过权限节点实现,支持 LuckPerms。
- 可选的结转功能 - 超出阶段限制的值可以延续到下一阶段,而不是被丢弃。
- 自定义商店 -
/cb grant 记录一笔购买或直接发放奖励,并设有金额限制。
- 管理员诊断 -
/cb admin health 显示 Vault 提供商、商店适配器、待发放款项、周期设置、等级、存储以及服务器/Java 信息;/cb admin history <player> 列出最近 10 笔交易及其商店来源。
- 重置保留终身收益 -
/cb admin reset 仅清除当前周期。
- PlaceholderAPI - 支持模式、填充、配额、比率、等级和终身收益占位符。
- 英文和印尼语 消息内置;更新时会添加新键值,而不会覆盖你的编辑内容。
- 自动清理历史记录 及可选的 bStats 统计。
菜单配置
/cb 打开菜单
gui:
enabled: true # false = 仅聊天模式
on-command: true # false = /cb 保持文本输出,/cb menu 仍打开 GUI
rows: 6 # 5 或 6
refresh-ticks: 20 # 0 = 不自动刷新
history-per-page: 10 # 最大 28(5 行)或 35(6 行)
fill-material: GRAY_STAINED_GLASS_PANE
sound: "minecraft:ui.button.click"
自定义商店
Cashback 无法检测到其他插件产生的购买行为。如果某个菜单由插件自身向玩家收费,请在收费后从控制台运行以下命令:
/cb grant
amount 是菜单已经扣除的金额,而非现金返还金额:一件 25,000 的物品应填写 25000。按钮先扣费,再发放:
left_click_commands:
- '[console] eco take %player% 25000'
- '[console] cashback grant %player% 25000'
启用它只需两行代码;块内的其余部分可保持默认值:
custom-grants:
enabled: true
require-console: true # 仅限控制台/RCON:此类发放视为金钱操作
依赖要求
平台支持: 这是一个 Paper 插件。由于它使用了 Paper API 和 plugin.yml 库加载器,因此不能在 Spigot 或 CraftBukkit 上运行。
安装步骤
- 将
Cashback.jar 放入服务器的 /plugins 文件夹并重启服务器。
- 确保已安装 Vault 和经济插件。
- 编辑
plugins/Cashback/config.yml 以设置目标、比率和菜单选项。
- 运行
/cb admin health - 它将一次性检查 Vault、商店适配器、待发放款项、周期和存储。
- 在商店中购买一些物品,然后检查
/cb status 和 /cb。
命令列表
| 命令 |
描述 |
/cb |
打开菜单(当 GUI 禁用时为文本形式)。 |
/cb menu [status|history] [page] |
打开特定的菜单页面。 |
/cb history [page] |
通过菜单查看历史记录。 |
/cb status |
文本形式的状态信息,始终可用。 |
/cb version |
版本、服务器、Java、适配器和存储信息。 |
/cb help |
命令列表,根据权限过滤。 |
/cb admin health |
检查 Vault、适配器、待发放款项、周期、存储和服务器。 |
/cb admin history <player> |
最近 10 笔交易,包括商店来源。 |
/cb admin inspect <player> |
查看玩家的周期状态和等级。 |
/cb admin reset <player> |
重置周期(保留终身收益)。 |
/cb admin recover [force] |
处理因崩溃而遗留的待发放款项。 |
/cb admin reload |
重新加载配置文件和语言文件。 |
/cb grant <player> <amount> |
注册自定义商店购买(可选参数:--reward)。 |
权限
| 权限 |
默认值 |
描述 |
cashback.use |
true |
/cb, /cb menu, /cb history, /cb status. |
cashback.admin |
op |
所有管理员命令,包括 grant。 |
cashback.admin.help |
- |
/cb help. |
cashback.admin.version |
- |
/cb version. |
cashback.admin.reload |
- |
/cb admin reload. |
cashback.admin.health |
- |
/cb admin health. |
cashback.admin.inspect |
- |
/cb admin inspect <player>. |
cashback.admin.history |
- |
/cb admin history <player>. |
cashback.admin.reset |
- |
/cb admin reset <player>. |
cashback.admin.recover |
- |
/cb admin recover [force]. |
cashback.admin.grant |
- |
/cb grant,仅在 custom-grants.require-console: false 时可用。 |
cashback.rank.<name> |
- |
针对各等级的目标值和倍率,来源于 ranks.groups。 |
占位符
%cashback_mode% FILLING / ACTIVE
%cashback_mode_display% 当前语言下的模式文本
%cashback_fill% %cashback_fill_percent%
%cashback_quota% %cashback_quota_percent%
%cashback_rate% 玩家所属等级的倍率
%cashback_rank% 等级名称,或默认值
%cashback_total_earned%
支持
在讨论区发帖时,请提供你的服务端软件及版本、Cashback 版本(通过 /cb version 查看)、商店插件版本以及相关控制台日志行。
Cashback
Vault cashback cycles for Paper 1.20.6-26.3, Purpur 1.21.11 / 26.2 and Folia 1.20.6-26.3 · Java 21+
Players spend money at your shop to fill a progress bar. When the bar is full, cashback becomes ACTIVE, and a percentage of their next purchases is paid back automatically through Vault. When the quota runs out, the cycle resets and filling starts again.
What's new in 1.4.0
- Menu for players -
/cb opens a native GUI: a status page plus a paginated history page, 5 or 6 rows, live refresh, configurable filler and click sound. It is read-only, so there is nothing to claim or take.
- Custom shop support - a shop that charges money itself.
- Drop-in upgrade - no database changes. Text commands stay, and the menu can be switched off in config.
How a cycle works
- FILL - purchases add value to the progress bar. These purchases do not pay cashback.
- ACTIVATE - at 100%, the progress bar unlocks a cashback quota.
- PAYOUT - every purchase while ACTIVE pays back the configured percentage, 30% by default.
- RESET - when the quota reaches zero, the cycle starts again.
Features
- Menu for players - status page (rank, mode, fill bar, remaining quota, total cashback) and history with pages.
- Crash-safe payouts - every payout is claimed in the database before the Vault deposit, preventing duplicate payments after a crash.
/cb admin recover settles anything left over, and payouts that may already have been paid are blocked until you confirm them with force.
- No double counting - one purchase equals one payout, even if a shop plugin fires several events.
- Large purchases count in full - a purchase worth several cycles is calculated exactly and is never truncated.
- Per-rank targets and cashback rates through permission nodes, with LuckPerms support.
- Optional carry-over - value that passes a stage limit can continue into the next stage instead of being discarded.
- Custom shops -
/cb grant records a purchase or pays a direct reward, with amount limits.
- Admin diagnostics -
/cb admin health shows the Vault provider, shop adapters, pending payouts, cycle settings, ranks, storage and server/Java; /cb admin history <player> lists the last 10 transactions with the shop source.
- Reset keeps lifetime earned -
/cb admin reset clears the cycle only.
- PlaceholderAPI - mode, fill, quota, rate, rank and lifetime earned.
- English and Indonesian messages included; new keys are added on update without overwriting your edits.
- Automatic history cleanup and optional bStats.
The menu
/cb opens the menu
gui:
enabled: true # false = chat only
on-command: true # false = /cb stays text, /cb menu still opens the GUI
rows: 6 # 5 or 6
refresh-ticks: 20 # 0 = no automatic refresh
history-per-page: 10 # max 28 (5 rows) or 35 (6 rows)
fill-material: GRAY_STAINED_GLASS_PANE
sound: "minecraft:ui.button.click"
Custom shops
Cashback cannot see purchases made by other plugins. If a menu charges the player itself, have it run this command from console after the charge:
/cb grant
amount is the money the menu already took, not the cashback: a 25,000 item is 25000. A button charges first, then grants:
left_click_commands:
- '[console] eco take %player% 25000'
- '[console] cashback grant %player% 25000'
Enable it with two lines; the rest of the block can stay at its defaults:
custom-grants:
enabled: true
require-console: true # console/RCON only: a grant is money
Requirements
Platform support: This is a Paper plugin. It does not run on Spigot or CraftBukkit because it uses the Paper API and the plugin.yml libraries loader.
Installation
- Drop
Cashback.jar into the server's /plugins folder and restart the server.
- Make sure Vault and an economy plugin are installed.
- Edit
plugins/Cashback/config.yml for targets, rates and the menu.
- Run
/cb admin health - it checks Vault, shop adapters, pending payouts, cycle and storage in one place.
- Buy something in your shop and check
/cb status, then /cb.
Commands
| Command |
Description |
/cb |
Open the menu (text when the GUI is disabled). |
/cb menu [status|history] [page] |
Open a specific menu page. |
/cb history [page] |
History through the menu. |
/cb status |
Text status, always available. |
/cb version |
Version, server, Java, adapters and storage. |
/cb help |
Command list, filtered by permission. |
/cb admin health |
Vault, adapters, pending payouts, cycle, storage and server. |
/cb admin history <player> |
Last 10 transactions, including shop source. |
/cb admin inspect <player> |
Cycle state and rank of a player. |
/cb admin reset <player> |
Reset the cycle (lifetime earned stays). |
/cb admin recover [force] |
Settle payouts left pending by a crash. |
/cb admin reload |
Reload config and language files. |
/cb grant <player> <amount> |
Register a custom shop purchase (optional: --reward). |
Permissions
| Permission |
Default |
Description |
cashback.use |
true |
/cb, /cb menu, /cb history, /cb status. |
cashback.admin |
op |
All admin commands, including grant. |
cashback.admin.help |
- |
/cb help. |
cashback.admin.version |
- |
/cb version. |
cashback.admin.reload |
- |
/cb admin reload. |
cashback.admin.health |
- |
/cb admin health. |
cashback.admin.inspect |
- |
/cb admin inspect <player>. |
cashback.admin.history |
- |
/cb admin history <player>. |
cashback.admin.reset |
- |
/cb admin reset <player>. |
cashback.admin.recover |
- |
/cb admin recover [force]. |
cashback.admin.grant |
- |
/cb grant, only when custom-grants.require-console: false. |
cashback.rank.<name> |
- |
Target and rate per rank, from ranks.groups. |
Placeholders
%cashback_mode% FILLING / ACTIVE
%cashback_mode_display% mode text in the active language
%cashback_fill% %cashback_fill_percent%
%cashback_quota% %cashback_quota_percent%
%cashback_rate% rate for the player's rank
%cashback_rank% rank name, or default
%cashback_total_earned%
Support
Post in the discussion tab with your server software and version, the Cashback version (/cb version), the shop plugin version, and the relevant console lines.
评论 0
登录后参与评分
还没有评论,来抢沙发吧