Content generated with AI — it may contain mistakes.

ExyliaEconomy/GuidesUpdated in v1.4.0

Pay interest

Pay players a percentage of their balance every hour, day or any interval you choose, with a cap, and decide whether offline players earn it too.

Page 7 of 253 min read

Players earn a percentage of a stored currency's balance at a fixed interval, so keeping money is rewarded. Nothing is paid until a currency has a rate; a new currency has none.

Before you start#

You need a stored currency, see Create a currency. Item, experience and display-only currencies earn nothing. Players need exyliaeconomy.interest, which everyone has by default.

Steps#

Open the currency

Run /economyadmin, left-click the currency, then click Interest.

Set the rate

Type Rate, percent, from 0 to 100: the share of the balance paid at each payout. 0 pays nothing.

Set the interval

Type Interval, such as 30m, 1h or 1d (default 1h). At least one minute; anything shorter is raised to it.

Cap it (optional)

Most per payout is the most one payout can give, typed like an amount (500, 2k). 0 is no cap.

Each currency has its own settings, so dollars can pay hourly and shards never. A server that came from the old interest block of config.yml finds it already copied onto its currencies, see Migration.

Check that it works#

Try a short interval

Set the interval to 1m and the rate to 10, with some balance and exyliaeconomy.interest.

Wait for the minute

Within about a minute after the next boundary you read "Interest +12.50 · next in 59m ⌚" and the balance rises. The ledger line is interest, see Ledger. Set the interval back afterwards.

Going further#

When a payout happens#

Time is cut into slots of the interval, counted from the Unix epoch, so a 1h currency pays at the top of every hour and a 1d currency at midnight UTC, whatever time the server started. The plugin looks every 30 seconds, so a payout lands within half a minute of the boundary.

A slot is never paid on the start that finds it: the first payout is at the first boundary after the server comes up. A boundary that passed while the server was down is not paid later.

What a payout is#

The balance at that moment times the rate, cut to the currency's decimals and capped at Most per payout. A balance of zero earns nothing, and an amount that rounds to nothing is not paid. A deposit the ceiling refuses is not paid, and that slot is not tried again.

To pay silently, empty interest-paid in plugins/ExyliaEconomy/lang/en/messages.yml, see messages and languages.

Pay offline players too#

Interest while offline is off by default: only players online are paid. With it on, every server also sweeps the currency's whole balance table and pays every player who is not online there, queued for whoever holds them.

Interest while offline pays everybody

A permission cannot be checked for somebody offline, so with this on every stored balance earns, exyliaeconomy.interest or not. Taking the permission from a group only stops their payouts while they are online. Leave it off unless that is what you want.

Who earns it#

With offline interest off, every player online on each server who has exyliaeconomy.interest, may use the currency (when it names a permission) and has their balance loaded.

Why nobody is paid twice

Each payout is claimed in the database first, per player and slot, in exylia_economy_claims. Only one claim can win:

  • a player connected to two servers of a shared currency at once is paid once;
  • a restart in the middle of a slot never pays that slot again;
  • with offline interest on, every server sweeping the same table pays each balance once, and a server that crashes halfway leaves the rest to the others.

A currency kept per server or per group is one balance per server or group, so each of those pays its own. Claims are deleted two days after their slot.

Something missing on this page? Tell us on Discord