Set up payments
Let players pay each other with /pay, add a transfer tax, ask for confirmation on big amounts, and let players turn payments off.
Players pay each other with /pay <player> <amount> [currency]. This page sets the tax and the confirmation, and explains what /pay checks, so you know why a payment was refused. /economy pay and every currency's own pay (/shards pay <player> <amount>) run exactly the same code, so everything here applies to all three.
Before you start#
You need a stored currency, see Create a currency. Players need exyliaeconomy.pay, which everyone has by default, see Permissions.
Steps#
Open the currency
Run /economyadmin and left-click the currency.
Add a tax (optional)
Click Rules and set Transfer tax, percent (0 to 100; default 0). Set Least a player may send here too (default 1).
Ask before big payments (optional)
Click Payments, then Pay confirmation, and type the amount in Ask to confirm above: a /pay above it asks first (0, the default, never asks). Amounts are typed like the command's: 10k, 500.
Check transfers are on
Still in Payments, Transfers must be on. When it is off, /pay of that currency is refused.
Check that it works#
Pay a friend
/pay <player> 100 <currency>. You read "You paid 100 to Steve.", or with a tax "You paid 100 to Steve. Tax: 5", and the receiver reads "Steve paid you 100."
Try a big one
With a confirmation of 1000, /pay <player> 2000 <currency> answers "Send 2,000 to Steve? [✔ CONFIRM] 30s". Click [✔ CONFIRM].
Going further#
The transfer tax#
A stored currency's tax is a percentage charged to the payer on top of the amount:
| Tax | /pay Steve 100 costs the payer | Steve receives |
|---|---|---|
0 | 100 | 100 |
5 | 105 | 100 |
2.5 | 102.5 (102 in a whole-number currency) | 100 |
The tax is cut to the currency's decimals, in the payer's favour, and goes to nobody: it leaves the economy. The ledger records it as its own line, pay:tax. A transfer that fails after the tax was taken (the receiver's ceiling, typically) gives the tax back and says why.
To give a rank a lower tax, give it exyliaeconomy.tax.<n> (exyliaeconomy.tax.3 is 3 %). The lowest one a player holds wins, and it only ever lowers the currency's own tax: a currency taxed 2.5 % charges a tax.1 holder 1 % and a tax.5 holder 2.5 %.
Confirmation above an amount#
A payment above the amount answers with [✔ CONFIRM]. Clicking it runs /pay Steve 20000 dollars confirm; typing the same thing works too. The confirmation:
- lasts 30 seconds;
- is bound to the exact receiver, currency and amount; a
confirmfor anything else confirms nothing: "Nothing to confirm: it expired or changed."; - is used up by the payment it allows, and replaced by the payer's next question;
- is only asked when the payer could afford it, so nobody confirms a payment that is then refused.
/pay Steve 20000 confirm, with confirm straight after the amount, means the default currency.
Let players turn payments off#
/paytoggle stops a player receiving payments, and running it again turns them back on. It is kept in the database, so it holds on every server of the network and through restarts. Players with exyliaeconomy.paytoggle.bypass (operators by default) pay them regardless. It only stops /pay and the currency pay commands: admin commands, interest, banknotes and other plugins still pay them.
Telling the receiver#
| Where the receiver is | What they are told |
|---|---|
| On the payer's server | At once: "Steve paid you 100." |
| Offline | Nothing now. On their next join, anywhere on the network, three seconds after they arrive: "While you were away, Steve paid you 100.", or "… you received 300 from 3 players.", one line per currency. |
| Online on another server | Nothing. The money arrives there at once, but no line is sent. |
The offline notice is the Offline pay notice switch in Economy settings, on by default. It keeps its own table, exylia_pay_notices, so it works with the ledger turned off. Each notice is shown once, even if the player joins two servers in a row.
Exchange currencies#
/economy exchange <amount> <from> <to> (or /shards exchange <amount> <to>) swaps one currency for another at the source's rate. It needs Exchange on the source currency, a rate from it to the target, and the target currency's permission. The ledger records both sides as exchange:<from>><to>. See Create a currency for how the amounts are rounded.
Give everybody online some money#
/economyadmin giveall <currency> <amount> gives an amount to every player online on this server. It always asks first, "Give 100 to each of the 24 players online? [✔ CONFIRM]", and the click runs the same command with confirm. Each player gets a separate deposit with its own ledger line (admin:giveall). A player without the currency's permission, or whose ceiling refuses it, is skipped and counted: "Gave 100 to 23 players. Skipped: 1".
Admin changes#
/economyadmin give, take, set and reset work on any player the network knows. On a player who is not on this server the change is queued and lands where they are, or when they are next seen; the admin reads "Queued +100 for Steve. They are away; it lands when they are next seen." See Network.
| Command | On a player here | Queued for a player elsewhere |
|---|---|---|
give | Deposits, refused at the ceiling | Lands in full, cut at the ceiling |
take | Withdraws, refused when they hold less | Lands floored at zero |
set | Sets the balance; 0 is accepted, refused above the ceiling | Replaces the balance |
reset | Back to the starting balance, after a confirmation | Replaces the balance |
A player online here is told "You received …" or "… was taken from you."; set and reset say nothing to them.
What /pay checks, in order
It stops at the first refusal:
- The currency. It must exist, and the payer must have its permission if it names one. Without a third word the default currency is used.
- The amount. A positive amount as players type it:
100,2.5k,1m. Anything else is "That is not an amount." - The currency's rules. A stored currency must have Transfers on and the amount must be at least its minimum. Item and experience currencies have no rules here.
- The payer's balance is loaded. Right after joining a balance takes a moment to be claimed from the database: "Your balance is still loading."
- The receiver. Anybody the network knows, online, offline or on another server. Paying yourself is refused.
- The receiver accepts payments. Unless the payer has
exyliaeconomy.paytoggle.bypass, a receiver who used/paytogglerefuses: "… is not accepting payments right now." - The confirmation. Above the configured amount the payment asks first.
- The throttle. One payment a second from the same payer to the same receiver; anything faster is dropped without a word.
- The payer can afford it. The amount plus the tax.
- Other plugins.
EconomyPayEventfires and a listener may cancel it, see API.
Then the tax is taken, the amount is moved and both sides are told.
Something missing on this page? Tell us on Discord