Treasury
No reviews yet
An bridge layer to provide economy and points implementations
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
Treasury
A simple economy & points API for Minecraft mods.
Inspired by the Bukkit Vault plugin.
It is not an economy implementation.
Instead, like Vault, other mods provide economy/points implementations, and Treasury acts as a bridge layer.
We need a good logo lmao, my art sucks —— the author
What can it do?
- Hold server economy (multi-currency supported)
- Access points / premium currency
- Allow mods to interact economy system without depending on specific implementations
How it works
Treasury defines two main provider types:
EconomyProviderfor normal currencyPointsProviderfor points (most for premium currency)
Other mods register their implementation, and other developers who use the API can get them. See more below.
Registry
Economy
- Stored in
EconomyServiceRegistry - Supports multiple providers
- One provider is selected as primary
Selection rules:
- Using
primaryEconomywhich defined in config if specified - Otherwise, use the first registered provider
Points
- Stored in
PointsServiceRegistry - Only one provider allowed
Registering another provider will throw an exception.
Register Providers
Economy
Treasury.economy().register(new ExampleEconomyProvider());
Points
Treasury.points().register(new ExamplePointsProvider());
Notes:
- Only one points provider allowed
- Please register during mod initialization
Fabric Entrypoints
Treasury supports register providers via Fabric entrypoints:
treasury-economytreasury-points
Example:
{
"entrypoints": {
"treasury-economy": [
"com.example.mod.ExampleEconomyProvider"
],
"treasury-points": [
"com.example.mod.ExamplePointsProvider"
]
}
}
Usage
Economy
if (Treasury.economy().hasPrimary()) {
EconomyProvider economy = Treasury.economy().getPrimary();
double balance = economy.getBalance(playerUuid);
}
Points
if (Treasury.points().isRegistered()) {
PointsProvider points = Treasury.points().get();
int balance = points.getBalance(playerUuid);
}
Commands
/treasury info/treasury balance <player>
Required permission level: 2
Requirements
- Fabric: Minecraft
1.20.1+, any Fabric version, Fabric API is not required - NeoForge: Minecraft
1.20.4+, any NeoForge version - Java:
17or higher
Don't ask for Forge!
Build
./gradlew build
Import
dependencies {
compileOnly("io.github.lijinhong11:treasury:VERSION")
}
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources