Commands
Economy
config.yml for the money itself, modules/economy.yml for the commands.
| Command | Permission |
|---|---|
/pay <player> <amount> |
chorus.economy.pay |
/balance [player] |
chorus.economy.balance |
/baltop [refresh] |
chorus.economy.baltop |
/eco <give|take|set|reset> <player> [amount] |
chorus.economy.admin |
/paylog [player|*] |
chorus.economy.paylog |
/paytoggle |
chorus.economy.toggle |
ChorusCore is an economy in its own right. None of this needs another plugin. Balances live in the same database as everything else and are held in memory while the server runs, which is how a priced command can read one without a round trip.
How amounts are read#
Every amount anybody types is read the same way, wherever it is typed: /pay, /eco, a chest
shop price, a sign shop, a service sign, a warp price, the price in the kit editor.
| Typed | Read as |
|---|---|
5 |
5.00 |
5.50 |
5.50 |
5,50 |
5.50 |
$5 |
5.00 |
5€ |
5.00 |
5k |
5000.00 |
2m |
2000000.00 |
Short amounts. k, m, b and t right after the number multiply it, so /pay Steve 5k
and /eco give Alex 2m work, and so does every other place an amount is typed. 5 k (with a
space) and 5mil stay 5.
A currency sign before or after the number is ignored. A comma is a decimal point, not a
thousands separator, so a thousand is 1000 and never 1,000.
Refused: a negative amount, NaN, Infinity, and anything that is not a number.
Every amount is kept to cents — two decimals.
Where the money comes from#
# config.yml
economy:
enabled: true
provider: autoprovider |
What it means |
|---|---|
auto |
The built-in ledger, unless another economy plugin has registered with Vault, in which case that one wins and everybody agrees. |
self |
The built-in ledger, whatever else is installed. |
vault |
Another plugin only. With no Vault every price is ignored. |
off |
The same as enabled: false. |
With Vault installed, the built-in ledger is offered to every other plugin at a low priority. A shop or jobs plugin spends the same money these commands do, and a dedicated economy plugin still wins if you install one.
/chorus status says which one is actually in use.
What money looks like#
economy:
# Balance of a player who joins for the first time. More with
# chorus.economy.starting.<amount> (the highest wins).
starting-balance: 0.0
minimum-balance: 0.0
maximum-balance: 1000000000000.0
currency:
symbol: "$"
suffix: false
decimals: 2
thousands-separator: ','
decimal-separator: '.'
short-form: false
short-units: [ K, M, B, T ]
singular: coin
plural: coinssuffix: true writes 100$ instead of $100. singular and plural are for the lines that
read "5 coins" rather than "$5".
A balance is never taken below minimum-balance or above maximum-balance.
thousands-separator and decimal-separator choose how amounts are written: 1,234.50 by
default, 1.234,50 with the two swapped. short-form: true writes large amounts short
(1.5K, 2.25M, 1B), and short-units sets the letters.
Starting balance by permission. A new player gets starting-balance, or the highest
chorus.economy.starting.<amount> they hold if that is more. Only the first join counts, and
players who already had an account keep what they have.
These options only apply when ChorusCore keeps the balances itself; another economy plugin formats its own money.
Payments#
# modules/economy.yml
economy:
minimum-payment: 0.01
maximum-payment: 0.0
confirm-above: 0.0
pay-tax: 0.0| Key | What it does |
|---|---|
minimum-payment |
The smallest /pay accepts. Amounts are rounded to two decimals first. |
maximum-payment |
The largest a single /pay may move. 0 means no ceiling. |
confirm-above |
A payment of this much or more asks the sender to run the command again. 0 never asks. |
pay-tax |
A percent of every /pay taken as tax. 0 is none. |
pay-tax takes a percent of every /pay as tax. The sender pays the full amount and the other
player gets the rest: with pay-tax: 5, paying 100 gives the other player 95. The tax is
removed from the economy, not paid to any account. chorus.bypass.tax pays no tax. The payment
log records what the other player received.
Payments go to online players only. If the deposit fails after the money left the sender it is put straight back.
/paytoggle stops other players sending you money, and is remembered between sessions.
The payment log#
economy:
log:
enabled: true
keep-days: 30
page-size: 10Every /pay is written down, so a dispute about a trade has an answer. /paylog reads your
own; /paylog <player> and /paylog * read somebody else's and the whole server, and need
chorus.economy.paylog.others.
keep-days: 0 keeps entries for ever, which on a busy server means a table that only ever
grows. page-size maximum is 50.
/eco#
Creates and destroys money rather than moving it. Every use goes in the staff log.
/eco give Notch 500
/eco take Notch 100
/eco set Notch 1000
/eco reset NotchTaking more than somebody has empties the account rather than going negative. reset puts a
balance back to starting-balance.
It works on a player the server has never had online. A name the server does not recognise is looked up in the plugin's own record of who has played here.
/baltop#
economy:
top-size: 10
top-hide-empty: false
top-refresh-seconds: 30Ranks every account on the server, paged, and adds up what is in circulation. Maximum 50 a page; it ships with a 5-second cooldown. The header says which page you are on.
The ranking is worked out once and kept in memory for top-refresh-seconds (30 by default), so a row of players
running it does not turn into a row of queries. A balance that changed inside that window
shows up on the next one.
/baltop refreshThrows the cached ranking away, so the next /baltop is worked out from scratch. It needs
chorus.economy.admin — it is there for after an /eco correction, not for players.
top-hide-empty: trueleaves players with a balance of 0 out of/baltop.top-refresh-secondsis how long/baltopkeeps its ranking before working it out again./baltop refresh(staff) still forces it.- Players with
chorus.economy.baltop.hiddenare left out of/baltopand out of its total. This is remembered with their account, so it works while they are offline, once they have joined with the permission: a player who has not joined since getting it is not hidden yet. Give it to the staff group to keep staff out of the ranking.
On a server whose money belongs to another plugin through Vault there is no ranking here to
keep: /baltop falls back to ranking whoever is online, and /baltop refresh says so
instead of appearing to do nothing.
Prices on commands#
Any command can cost money — see Per-command rules.
commands:
home:
price: 25.0Charged on success by default; charge-on: use takes it first and gives it back if the
teleport is cancelled. With no economy at all, every price is ignored rather than refusing
the command. chorus.bypass.price never pays.
Turning it all off#
economy:
enabled: falseEvery price is ignored and /pay and /balance say the economy is switched off. The commands
are still registered, so a player who tries gets an explanation rather than "unknown command".
Config reference#
# modules/economy.yml
enabled: true
economy:
minimum-payment: 0.01
maximum-payment: 0.0
top-size: 10
top-hide-empty: false
top-refresh-seconds: 30
confirm-above: 0.0
pay-tax: 0.0
log:
enabled: true
keep-days: 30
page-size: 10
commands:
defaults: ...
pay: ...
balance: ...
baltop: ...
eco: ...
paylog: ...
paytoggle: ...Permissions#
| Permission | Effect |
|---|---|
chorus.economy.pay |
/pay |
chorus.economy.balance |
/balance |
chorus.economy.balance.others |
/balance <player> |
chorus.economy.baltop |
/baltop |
chorus.economy.admin |
/eco, and /baltop refresh |
chorus.economy.paylog |
/paylog on yourself |
chorus.economy.paylog.others |
/paylog <player> and /paylog * |
chorus.economy.toggle |
/paytoggle |
chorus.economy.baltop.hidden |
Leaves the player out of /baltop and out of its total |
chorus.economy.starting.<amount> |
A higher starting balance for new players; the highest wins |
chorus.bypass.price |
Never pays for a command, in money or in items |
chorus.bypass.tax |
Pays no tax on /pay |
