SimpleCurrencies
一个轻量级的 Paper (1.21+) 插件,支持在单个插件内使用多个独立的货币系统。plugins/SimpleCurrencies/ 目录下的每个 .yml 文件都定义了自己的货币、自定义命令、规则和余额。
功能特性
- 无限自定义货币 — 在
plugins/SimpleCurrencies/ 中创建一个新的 .yml 文件(例如 coins.yml、gems.yml),即可自动获得一个专用的 /<command> 命令。
- 小数与余额限制 — 支持按货币配置小数位、初始余额、默认最大余额,以及通过权限覆盖的最大余额。
- 玩家间转账 (
/pay) — 允许玩家之间互相发送货币,并支持按货币设置 pay-enabled 开关以启用或禁用此功能。
- 提取为物品 (
/withdraw & /deposit) — 将货币提取为可定制的实体钞票物品(包含 item、display-name、lore),并使用 PersistentDataContainer 元数据进行保护。通过右键点击该物品或运行 /<command> deposit 来兑换。
- 汇率与货币转换 — 可在 YAML 文件中或通过
/sc rate 命令定义货币间的汇率,并通过 /<command> transfer 命令迁移货币余额。
- Vault 经济导入 — 从任何兼容 Vault 的经济系统(例如 EssentialsX、CMI)导入余额到 SimpleCurrencies 的某个货币中,可选设置汇率和清除 Vault 中的原始余额。
- PlaceholderAPI 支持 — 内置扩展,支持获取玩家余额、格式化后的余额、全局余额及最大余额等占位符。
命令
主命令 (/simplecurrencies, /sc, /simplecurrencys)
| 命令 |
权限 |
默认权限 |
描述 |
/sc help |
— |
所有人 |
显示插件命令概览 |
/sc reload <currency|all> |
simplecurrencies.reload |
op |
重载一个或所有货币配置 |
/sc rate set <from> <to> <rate> |
simplecurrencies.rate |
op |
设置汇率(1 <from> = <rate> <to>) |
/sc rate get <from> <to> |
simplecurrencies.rate |
op |
查看两个货币之间配置的汇率 |
/sc rate remove <from> <to> |
simplecurrencies.rate |
op |
移除已配置的汇率 |
/sc rate list [currency] |
simplecurrencies.rate |
op |
列出已配置的汇率 |
/sc import Vault <currency> [rate] [clearVault] |
simplecurrencies.import |
op |
从 Vault 导入玩家余额到 <currency> |
按货币划分的命令 (/<command>)
每种货币都会注册在其 .yml 文件的 command: 下配置的命令:
| 命令 |
权限 |
默认值 |
描述 |
/<command> |
— |
所有人 |
查看你自己格式化后的余额 |
/<command> balance [player] |
— |
所有人 |
查看你自己或其他玩家的余额 |
/<command> pay <player> <amount> |
simplecurrencies.pay |
true |
向其他玩家付款(需要配置 pay-enabled: true) |
/<command> withdraw <amount> |
simplecurrencies.withdraw |
true |
将货币提取为纸币物品(需要配置 withdraw.enabled: true) |
/<command> deposit |
simplecurrencies.deposit |
true |
存入手中持有的纸币物品(或右键点击该物品) |
/<command> give <player> <amount> |
simplecurrencies.give |
op |
增加玩家的货币余额 |
/<command> remove <player> <amount> |
simplecurrencies.remove |
op |
减少玩家的货币余额 |
/<command> wipe |
simplecurrencies.wipe |
op |
清除所有玩家在该货币下的余额 |
/<command> transfer <targetCurrency> [rate] |
simplecurrencies.transfer |
op |
使用配置的或提供的汇率,将所有余额转移到 <targetCurrency>,然后清除源货币的余额 |
配置文件 (plugins/SimpleCurrencies/<id>.yml)
在首次启动时(当不存在 .yml 文件时),会自动生成 default.yml:
# 此货币的显示名称
name: "默认货币"
# 为此货币注册的命令
command: "default"
# 此货币是否支持小数?
decimals: false
# 玩家能否使用此货币互相支付?
pay-enabled: true
# 将货币提取为实体物品(纸币)
# display-name 和 lore 中的占位符:%amount%, %currency%, %currency_id%, %player%
withdraw:
enabled: false
item: "PAPER"
display-name: "&a%amount% %currency%"
lore:
- "&7价值:&e%amount% %currency%"
- "&7提取者:&f%player%"
- "&7右键点击以兑换"
平衡:新玩家初始余额
start-balance: 0
玩家最大余额(<= 0 表示无限制)
max-balance: 0
按权限设置自定义最大余额
如果玩家拥有多个权限,取最高值
max-balance-permissions:
simplecurrencies.maxbalance.premium: 10000
禁用该货币的世界列表
disabled-worlds:
将此货币转换为其他货币时的汇率
格式:<目标货币ID>: <汇率> (1单位此货币 = <rate> 单位目标货币)
exchange-rates:
points: 0.5
balances:
00000000-0000-0000-0000-000000000000:
name: "玩家"
balance: 0
---
## PlaceholderAPI 占位符
需要 [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/)。将 `<id>` 替换为货币的文件名(不含 `.yml`):
| 占位符 | 描述 |
| :--- | :--- |
| `%simplecurrencies_<id>_balance%` | 玩家的数值余额 |
| `%simplecurrencies_<id>_balance_formatted%` | 带有货币显示名称的玩家余额 |
| `%simplecurrencies_<id>_global_balance%` | `<id>` 中所有玩家余额的总和 |
| `%simplecurrencies_<id>_max_balance%` | 为 `<id>` 配置的默认最大余额 |
---
SimpleCurrencies
A lightweight Paper (1.21+) plugin that supports multiple independent currency systems within a single plugin. Each .yml file inside plugins/SimpleCurrencies/ defines its own currency, custom command, rules, and balances.
Features
- Unlimited Custom Currencies — Create a new
.yml file in plugins/SimpleCurrencies/ (e.g., coins.yml, gems.yml) and get a dedicated /<command> automatically.
- Decimals & Balance Limits — Per-currency toggle for decimal support, starting balances, default max balances, and permission-based max balance overrides.
- Player Payments (
/pay) — Let players send currency to each other, with a per-currency pay-enabled toggle.
- Withdraw to Item (
/withdraw & /deposit) — Withdraw currency into customizable physical banknote items (item, display-name, lore) secured with PersistentDataContainer metadata. Redeem by right-clicking the item or running /<command> deposit.
- Exchange Rates & Currency Transfers — Define conversion rates between currencies in YAML or via
/sc rate, and migrate balances between currencies with /<command> transfer.
- Vault Economy Import — Import balances from any Vault-compatible economy (e.g., EssentialsX, CMI) into a SimpleCurrencies currency with optional exchange rates and Vault balance clearing.
- PlaceholderAPI Support — Built-in expansion for player, formatted, global, and max balances.
Commands
Main Commands (/simplecurrencies, /sc, /simplecurrencys)
| Command |
Permission |
Default |
Description |
/sc help |
— |
Everyone |
Show plugin command overview |
/sc reload <currency|all> |
simplecurrencies.reload |
op |
Reload one or all currency configurations |
/sc rate set <from> <to> <rate> |
simplecurrencies.rate |
op |
Define an exchange rate (1 <from> = <rate> <to>) |
/sc rate get <from> <to> |
simplecurrencies.rate |
op |
View the configured exchange rate between two currencies |
/sc rate remove <from> <to> |
simplecurrencies.rate |
op |
Remove a configured exchange rate |
/sc rate list [currency] |
simplecurrencies.rate |
op |
List configured exchange rates |
/sc import Vault <currency> [rate] [clearVault] |
simplecurrencies.import |
op |
Import player balances from Vault into <currency> |
Per-Currency Commands (/<command>)
Each currency registers the command configured under command: in its .yml file:
| Command |
Permission |
Default |
Description |
/<command> |
— |
Everyone |
View your own formatted balance |
/<command> balance [player] |
— |
Everyone |
View your own or another player's balance |
/<command> pay <player> <amount> |
simplecurrencies.pay |
true |
Pay another player (requires pay-enabled: true) |
/<command> withdraw <amount> |
simplecurrencies.withdraw |
true |
Withdraw currency into a banknote item (requires withdraw.enabled: true) |
/<command> deposit |
simplecurrencies.deposit |
true |
Deposit the banknote item held in hand (or right-click the item) |
/<command> give <player> <amount> |
simplecurrencies.give |
op |
Add currency to a player's balance |
/<command> remove <player> <amount> |
simplecurrencies.remove |
op |
Remove currency from a player's balance |
/<command> wipe |
simplecurrencies.wipe |
op |
Wipe all player balances for this currency |
/<command> transfer <targetCurrency> [rate] |
simplecurrencies.transfer |
op |
Transfer all balances into <targetCurrency> using the configured or provided exchange rate, then wipe the source currency |
Configuration (plugins/SimpleCurrencies/<id>.yml)
On first startup (when no .yml files exist), default.yml is generated automatically:
# Display name of this currency
name: "Default Currency"
# Command that will be registered for this currency
command: "default"
# Should this currency support decimals?
decimals: false
# Can players pay each other using this currency?
pay-enabled: true
# Withdraw currency into a physical item (banknote)
# Placeholders for display-name and lore: %amount%, %currency%, %currency_id%, %player%
withdraw:
enabled: false
item: "PAPER"
display-name: "&a%amount% %currency%"
lore:
- "&7Value: &e%amount% %currency%"
- "&7Withdrawn by: &f%player%"
- "&7Right-click to redeem"
# Balance new players start with
start-balance: 0
# Maximum balance for players (<= 0 means unlimited)
max-balance: 0
# Custom maximum balances by permission
# If a player has multiple permissions, the highest value wins
max-balance-permissions:
simplecurrencies.maxbalance.premium: 10000
# Worlds where this currency is disabled
disabled-worlds:
- example_world
# Exchange rates when transferring this currency to another currency
# Format: <target_currency_id>: <rate> (1 unit of this currency = <rate> units of target currency)
exchange-rates:
points: 0.5
balances:
00000000-0000-0000-0000-000000000000:
name: "Player"
balance: 0
PlaceholderAPI Placeholders
Requires PlaceholderAPI. Replace <id> with the currency's filename (without .yml):
| Placeholder |
Description |
%simplecurrencies_<id>_balance% |
Player's numeric balance |
%simplecurrencies_<id>_balance_formatted% |
Player's balance with the currency display name |
%simplecurrencies_<id>_global_balance% |
Sum of all player balances in <id> |
%simplecurrencies_<id>_max_balance% |
Default maximum balance configured for <id> |
评论 0
登录后参与评分
还没有评论,来抢沙发吧