Integrate through plugin services, not storage files.
HyEssentialsX can store data in SQLite, JSON, MySQL/MariaDB, or MongoDB. External integrations should use exposed managers, APIs, commands, or supported integration providers instead of reading or writing storage files directly.
Economy Integration
- Use the HyEssentialsX economy API or VaultUnlocked economy provider when available.
- Preserve configured decimal places and money formatting.
- Do not write balances directly to JSON or SQL tables.
- Use admin economy commands only for operator/staff workflows, not automated integrations.
Placeholder Integration
- Scoreboard and hologram systems support plugin placeholders where enabled.
- HyEssentialsX chat formatting resolves nicknames, real names, LuckPerms or HyperPerms prefix/suffix/primary-group values, dynamic LuckPerms meta keys, and local group prefix/suffix fallbacks.
- PlaceholderAPI can expose HyEssentialsX nickname, plain nickname, display name, real-name, LuckPerms, and HyperPerms placeholders to other configured text surfaces.
- Keep high-frequency placeholders lightweight, especially in holograms and scoreboards.
Storage Rules
- The selected backend in
storage.typeowns persistent plugin data. - Data shared across backends should be accessed through StorageManager/model-backed APIs.
- Manual local files are only appropriate for config or explicitly local plugin assets.
UI-Aware Systems
- Several workflows are intentionally UI-first: auction house listing, shop editing, stats, leaderboards, economy admin, playtime, scoreboard, and holograms.
- Commands often open pages rather than dumping large data into chat.
- Keep event names and UI data keys stable when extending custom UI pages.
Shops and Auction House
- Admin shops, player shops, and auction house data should be managed through the plugin systems.
- Player shop stock can be linked to containers; integrations should not assume infinite stock.
- Auction listing limits may come from config and permission nodes.
Stats and Progression
- Stats, playtime, and rankups are persistent and can affect rewards.
- Leaderboard and baltop exclusions are permission-based.
- Use manager/API access when reading progression data for another plugin.
Integration Checklist
Respect Permissions
Check the same permission nodes the command/UI path checks. Do not bypass staff-only flows accidentally.
Respect Config
Feature toggles can disable entire systems. Integrations should fail cleanly when a feature is off.
Respect Storage
Use plugin services so the same integration works with SQLite, JSON, MySQL/MariaDB, and MongoDB.
Get the public API safely
The public API is xyz.thelegacyvoyage.hyessentialsx.api.HyEssentialsXApi, obtained through HyEssentialsXApiProvider.get(). Declare the plugin dependency and resolve the provider after HyEssentialsX initializes. It can be absent during startup or shutdown.
import xyz.thelegacyvoyage.hyessentialsx.api.HyEssentialsXApi;
import xyz.thelegacyvoyage.hyessentialsx.api.HyEssentialsXApiProvider;
HyEssentialsXApi api = HyEssentialsXApiProvider.get();
if (api != null && api.economy().isEnabled()) {
long balance = api.economy().getBalance(playerUuid);
String displayBalance = api.economy().formatAmount(balance);
// Use the formatted value in your own UI or message.
}
Available services
economy(): inspect currency and balances, format amounts, set or deposit funds, and withdraw with a boolean success result.playtime(): read, set, add, or reset playtime in seconds.shops(): list admin/player shops, look up a shop, create a shop, save it, or delete it.
Amounts are stored in the plugin's minor-unit representation. Respect the configured decimal places, use formatAmount(long) for display, and check withdraw(...) before delivering a purchase. Do not assume every currency has two decimal places.