Content generated with AI — it may contain mistakes.

ExyliaLib/Customise (all Exylia plugins)Updated in v1.595.0

Set up the economy for your Exylia plugins

Choose which money your Exylia plugins charge and pay in: Vault, PlayerPoints or an ExyliaEconomy currency, with one file, economy.yml.

Page 10 of 543 min read

One file decides which money every Exylia plugin uses: shops, kits, rewards and anything with a price. Change it once and they all follow.

ExyliaLib is the library every Exylia plugin installs. This file is in its folder, plugins/ExyliaLib/economy.yml, and applies to all Exylia plugins. Exylia plugins never talk to an economy plugin themselves; they ask for "money" and this file decides who answers.

Before you start#

You need at least one economy on the server:

  • Vault with an economy plugin behind it (for example EssentialsX or ExyliaEconomy). This is the default.
  • PlayerPoints, if you want a points currency.
  • ExyliaEconomy, which gives you as many currencies as you like and can also act as the Vault economy. See ExyliaEconomy.

Choose the default currency#

Open the file

Open plugins/ExyliaLib/economy.yml. It is created at the first start with a comment above each key.

Set the default currency

plugins/ExyliaLib/economy.yml
yaml
default-currency: vault
fallback: []
balance-cache-millis: 500

Use vault for the server's Vault economy, points for PlayerPoints, or the id of a currency you made in ExyliaEconomy.

Reload

Run /exylialib reload (permission exylialib.admin). No restart is needed.

How prices are charged#

A price in an Exylia plugin (a kit cost, a shop item, a ticket) is charged in the default currency, unless the plugin's setting names another one by its id. When a plugin lets you name a currency on a price, type the id of the currency, such as points. Leave it empty to use the default.

The money is taken only when the player can afford it; otherwise nothing changes. Amounts can be written in short form in a command, such as 2.5k or 1m.

Changing currency does not move balances

Balances stay in the economy that holds them. If you switch from vault to points, players keep their Vault money but your plugins now charge points. Decide before you launch.

If the economy is missing: the fallback#

If the default currency's plugin is not on the server, you can list other currencies to try in order:

yaml
default-currency: vault
fallback:
  - points

The first one available answers. The switch is written to the log once so it never happens without anyone knowing. The fallback applies only to the default: a price that names a specific currency gets that currency or nothing, never the right number in the wrong currency.

With an empty fallback (the default) nothing else is tried. List what your server really has.

Balance cache#

balance-cache-millis: 500 says how long a balance read from the economy is reused, in milliseconds. It exists because scoreboards refresh every tick. You can write 500ms or 2s. Balances changed through an Exylia plugin refresh at once; the number only matters for changes made by other plugins. Leave it unless a balance on a scoreboard lags behind.

Check that it works#

Open a menu that shows a price, or use a command that charges, and compare your balance before and after. If a plugin says no economy is available, install Vault and an economy plugin, or set default-currency to a currency that exists, then run /exylialib reload.

Technical details

The built-in provider ids are vault and points; any plugin can register more, and ExyliaEconomy registers each currency under its own id. An economy plugin that enables after ExyliaLib is still found. When Vault is served by a registered currency, vault and that currency are the same money. The library keeps no balances itself. Developer view: Economy.

Something missing on this page? Tell us on Discord