Elements: Vault
Hey! Elements: Vault is a free economy API for NeoForge 1.21.1. I made it because there wasn't a good Vault-style option for NeoForge 1.21.1, and I wanted economy, shop and currency mods to be able to talk to each other instead of each one doing its own thing.
Vault doesn't do anything on its own. It holds no money and adds no commands. An economy mod (like my own Elements: Economy) plugs into it as the provider, and any other mod can then use that one economy through Vault.
What mods can do with it
- Read balances, take money, pay money and move money between players
- Check first with "dry runs" before changing anything
- Plug in their own money system (digital, coins, another mod's currency)
- Connect their shop or auction house so it follows the server's currency
- Listen for events: transactions, balance changes, shop purchases, auction listings and sales, and currency switch-overs
For server owners
You only need Vault if a mod asks for it. Elements: Economy already has Vault built in, so you don't need to install it separately for that.
For mod developers
Add it with CurseMaven:
repositories {
maven {
url = "https://cursemaven.com"
content { includeGroup "curse.maven" }
}
}
dependencies {
compileOnly "curse.maven:elements-vault-1730724:9083690"
}
Then use it like this:
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()) first, since the service only exists while a provider is running.
License
Free to use in any modpack. Just credit Telmarine and don't sell it. Full terms are on GitHub.
Bug reports and ideas are always welcome!