Elements: Vault
A free economy API for NeoForge 1.21.1 so mods can share one currency for balances, shops and auction houses.
介绍
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.
Server only. Players don’t need it installed.
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.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:9141832"
}
License
Free to use in any modpack. Credit Telmarine. No resale.
常见问题
Elements: Vault 支持哪些 Minecraft 版本?
Elements: Vault 支持 Minecraft Java 版 1.21.1,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。
Elements: Vault 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。
Telmarine 的其他作品
查看全部 →Elements: Economy
A server-side economy for NeoForge 1.21.1 that links your currency to player shops, server shops and an auction house.
Codex: Title Scrolls
A Quality of Life mod that adds titles to players names in chat.
Elements: Nexus
This is a server management mod that couples Tab, NeoEssentials, plus the ability to migrate data from other server management mods into it's system smoothly.
Codex: Armor Stands
Server-side armor stand editor for NeoForge 1.21.1. Pose, rotate, move, scale and style armor stands with a tool and chest menus. Includes 40 preset poses, copy and paste, and claim-aware protection.
评论
登录后评论和评分