Elements: Vault
A shared economy API for NeoForge 1.21.1. Vault holds no money itself. An economy mod registers itself as the provider, and any other mod can use it to read balances, take or pay money, and hook in its own shops or currency.
For server owners
You only need Vault when another mod asks for it. Put it in your server's mods folder next to that mod. It has no config files and no commands.
Only currencies that come with a mod count as currencies. Vanilla items only count after the server owner lists them in the economy mod's config and an admin confirms.
For mod developers
EconomyAPI: the entry point.EconomyAPI.get()returns the running economy, or empty when no provider is running.EconomyService: balances, top balances, dry runs, withdraw, deposit, set, transfer, conversion between currencies and coin items. Async versions for offline players.Account: named accounts besides a player's default one, such as a team bank or a shop's till, for currencies wheresupportsAccountsis true. Create, delete, list, and move money between them.Currency: one kind of money, with its name, symbol, decimals and formatting. Digital, item or external.CurrencyBackend: plug in your own money system.ShopBridge: plug in a shop or auction mod.- Events on the game bus: transactions, balance changes, currency switches, shop purchases and auction listings and sales.
EconomyAPI.get().ifPresent(eco -> {
Money price = eco.primaryCurrency().of(250);
Result r = eco.withdraw(player.getUUID(), price, Cause.plugin("mymod"));
});
Always check EconomyAPI.isAvailable() (or use EconomyAPI.get()) before calling anything, since the service only exists while a provider is running.
Adding it to your project
Vault is on CurseForge, so you can pull it with CurseMaven:
repositories {
maven {
url = "https://cursemaven.com"
content { includeGroup "curse.maven" }
}
}
dependencies {
compileOnly "curse.maven:elements-vault-1730724:9860520"
}
License
Free to use in any modpack. Credit Telmarine. No resale.

