-
Notifications
You must be signed in to change notification settings - Fork 6
multiworld world balances
By default Vault 2.x uses a global balance per player across all worlds. If you need isolated economies (e.g.: a SkyBlock server with separate resource world and islands world), enable per-world separation.
world_balances:
separate_worlds:
- world_nether
- minesWorlds that appear in this list get their own balance row; the rest share the global balance.
Internally SimpleEconomy identifies each amount with the tuple:
(uuid, worldName, currencyId)
- If
worldName == nullβ global balance (default behavior) - If
worldNameis a world listed inseparate_worldsβ isolated balance - If
worldNameis not listed β redirected to global even if the handler received a world name (to maintain compatibility with plugins that always pass the world)
If storage.use_mysql: true, Database.ensureSchema() automatically creates:
CREATE TABLE IF NOT EXISTS vault_world_balances (
world_name VARCHAR(64) NOT NULL,
uuid CHAR(36) NOT NULL,
balance DECIMAL(19,4) NOT NULL DEFAULT 0,
PRIMARY KEY (world_name, uuid)
);Batch operations:
-
loadAllWorldBalances()β returnsMap<worldName, Map<UUID, Double>> -
saveWorldBalances(...)βINSERT ... ON DUPLICATE KEY UPDATE balance=VALUES(balance) -
clearAllBalances()β deletes bothvault_balancesandvault_world_balancesat once
Each handler reads player.getWorld().getName() and passes it to SimpleEconomy:
String worldName = player.getWorld() != null ? player.getWorld().getName() : null;
if (economy instanceof SimpleEconomy) {
economy.createPlayerAccount(player, worldName);
double bal = economy.getBalance(player, worldName);
}The offline payment PlayerResolver also accepts a world; when the payment is delivered with deliverFor() it is deposited in the global balance (since the player does not yet have a world assigned until they move).
The classic API net.milkbowl.vault.economy.Economy defines two method families:
| Legacy signature | Vault 2.x returns |
|---|---|
getBalance(OfflinePlayer) |
Always global balance (null world) |
getBalance(OfflinePlayer, String worldName) |
Resolves separate_worlds β global or isolated |
withdrawPlayer(OfflinePlayer, amt) |
Global |
withdrawPlayer(p, world, amt) |
Resolves separate_worlds |
This is intentional: old plugins that don't know about multi-world (such as ShopGUIPlus, Jobs) continue working with the default currency balance and the global world.
Vault Economy v2.1.0 Β· Compatible with Spigot 1.8.8 β 1.21.x
π¦ Modrinth Β·
π¬ Discord Β·
Java 17 (legacy) Β· Java 21 (modern)
Documentation generated on 2026-09-03 Β· Vault Project Team
- π Home
- π First Install
- π§βπ« Getting Started
- β Basic FAQ
- π Formats and Localization
- π± Multi-currency
- π’ Abbreviation (k / M / B / T)
- π Complete Command List
- π‘οΈ Complete Permission List
- βοΈ config.yml Reference
- π Supported Languages
- π Modrinth Updates
- π° Player-to-Player Payments
- π¦ Bank System
- π΅ Physical Notes
- πΈ Loans
- π Transaction History
- π Top Players
- βΈοΈ Offline Payments
- π³ Charges / Payment Requests
- π Discord Webhook
- π οΈ Installation Errors
- π« Players Can't Pay
- 𧨠Balances Wiped on Restart
- π Bank Doesn't Pay Interest
- π§Ύ Invalid / Expired Notes
- π©Ί Complete Step-by-Step Troubleshooting
- πΊοΈ Separate Balances Per World
- π Migration from EssentialsX
- π PlaceholderAPI (25+ placeholders)
- π€ SkinsRestorer Β· GUI Heads
- π LuckPerms
- ποΈ MySQL / HikariCP
-
Java API
- π¬ Getting Started
- π‘ Events and Transactions
- π SimpleEconomy Hooks
- π Skript
- π§° Contribute Β· Dual Maven Build
- π Changelog v2.1.0
- π Support