Guide
How to make a Minecraft economy plugin
Updated October 18, 2026
An economy plugin keeps a balance for every player and lets them pay each other, earn money and spend it in shops. The important part is not the commands but the Vault hook: it is what lets shops, jobs and auction plugins use your money. This guide covers the design, the storage and how to build and test it.
Start from this example and change the rules to yours.
Generate this with CodexeStep by step
1.Decide what the plugin is
Either it is the economy (it stores balances and registers itself as the Vault economy), or it uses an existing economy through Vault (a shop, bounties, a job plugin). Most servers need one of each, not two economies.
2.Pick the server and version
Write the server software and version, for example Paper 1.21.4. The plugin is built for that version's API and Java level.
3.List the commands and rules
/balance,/pay <player> <amount>,/baltop, and admin commands such as/eco give|take|set. Add the starting balance, the currency name, decimals and a minimum payment.4.Choose where balances are saved
SQLite for one server, MySQL if several servers must share the same balances. Money must survive restarts and crashes, so it is never kept only in memory.
5.Let Codexe write and build it
Describe the plugin and name Vault explicitly so it is added as a dependency. Codexe writes the Java code,
plugin.ymlandconfig.yml, compiles it and fixes build errors before the project is Ready.6.Test payments in game
Press Try it now and join the test server. Pay between two accounts, try amounts that are too large, negative or not numbers, then restart and check the balances are still there.
7.Install it
Put Vault and your .jar in the server's
plugins/folder and restart. Remove any other economy plugin, or decide which one Vault should use.
How Vault fits in
Vault is a bridge, not an economy. An economy plugin implements Vault's Economy interface and registers it with the server's services manager; other plugins ask for it with getServer().getServicesManager().getRegistration(Economy.class) and call methods such as getBalance, withdrawPlayer and depositPlayer.
So a shop plugin never needs to know which economy you run. In plugin.yml use depend: [Vault] when the plugin cannot work without it, or softdepend when Vault is optional. The Vault API is only needed to compile; Vault itself is installed on the server.
Decisions to write in the request
- Money format: currency name in singular and plural, symbol, how many decimals.
- Limits: starting balance, maximum balance, whether balances can go negative.
- Offline players: whether
/payand/ecowork on players who are not online. - Logging: a transaction log in the database or a file, so staff can check disputes.
- Earning money: killing mobs, playtime rewards, selling items, or only admin commands.
Where to save balances
| Storage | Good for | Watch out for |
|---|---|---|
| YAML file | Very small servers, easy to read | Slow with many players, easy to corrupt on a crash |
| SQLite | One server, no setup | Cannot be shared between servers |
| MySQL / MariaDB | Networks sharing one balance | Needs a database server and login in config.yml |
Example description
"A Paper 1.21.4 economy plugin called Coins that registers itself as the Vault economy. /balance [player], /pay <player> <amount> with a minimum of 1, /baltop with the top 10, and /eco give|take|set for players with coins.admin. New players start with 100 coins. Two decimals. Every payment logged with date, sender, receiver and amount. Balances saved in SQLite. Currency names and every message in config.yml."
Codexe uses SQLite by default when you do not ask for something else. If you ask for MySQL, the plugin is written with a storage-type setting, and the test server gives it a MySQL database of its own while you try it.
Questions
Do I need Vault?
Not for a standalone economy that nothing else uses. You need it as soon as other plugins (shops, jobs, auctions) must read or change balances, because that is the API they look for.
Can I run it next to EssentialsX?
EssentialsX has its own economy and registers it with Vault too. Run one economy at a time, or turn off the one you do not want, otherwise other plugins may use a different balance from the one your commands show.
Can several servers share the same balances?
Yes, with MySQL or MariaDB as storage and the same database in every server's config.yml. Ask for it in the request so the plugin reads balances from the database instead of caching them for too long.
How do I test it without a real server?
With Try it now: a private Paper server of your version starts with the compiled plugin, and plugins listed in depend and softdepend, such as Vault, are installed for it. The free plan has 3 test servers a day, 10 minutes each.
Make your server's economy
This prompt opens ready to send:
“A Paper 1.21.4 economy plugin called Coins that registers as the Vault economy: /balance, /pay with a minimum of 1, /baltop top 10, /eco give|take|set for coins.admin, starting balance 100, two decimals, every payment logged, balances in SQLite, currency names and messages in config.yml.”
Generate this with Codexe