Per-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.Composite key MultiBalanceKey
Internally SimpleEconomy identifies each amount with the tuple:
- 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)
MySQL table vault_world_balances
If storage.use_mysql: true, Database.ensureSchema() automatically creates:
loadAllWorldBalances()→ returnsMap<worldName, Map<UUID, Double>>saveWorldBalances(...)→INSERT ... ON DUPLICATE KEY UPDATE balance=VALUES(balance)clearAllBalances()→ deletes bothvault_balancesandvault_world_balancesat once
Flow in /pay and /balance commands
Each handler reads player.getWorld().getName() and passes it to SimpleEconomy:
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).
Vault legacy API compatibility
The classic APInet.milkbowl.vault.economy.Economy defines two method families:
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.
