Developer API

Public API surface for economy, shops, and playtime integrations.

HyEssentialsX Developer API
Lightweight, stable entry points for plugin authors.

HyEssentialsX exposes a small, focused API so other plugins can safely read or update economy balances, playtime, and shop data. The API is optional and will be null if HyEssentialsX is not loaded.

Getting Started
  • Declare a compileOnly dependency on HyEssentialsX.
  • Resolve the API from HyEssentialsXApiProvider.get().
  • Always null-check before use.
import xyz.thelegacyvoyage.hyessentialsx.api.HyEssentialsXApi;
import xyz.thelegacyvoyage.hyessentialsx.api.HyEssentialsXApiProvider;

HyEssentialsXApi api = HyEssentialsXApiProvider.get();
if (api == null) {
    // HyEssentialsX not loaded
    return;
}

long balance = api.economy().getBalance(playerUuid);
API Modules

All APIs are synchronous and backed by the internal HyEssentialsX managers.

Economy API
  • isEnabled()
  • getCurrencySymbol()
  • formatAmount(long)
  • getBalance(UUID)
  • setBalance(UUID, long)
  • deposit(UUID, long)
  • withdraw(UUID, long)
Playtime API
  • getPlaytimeSeconds(UUID)
  • setPlaytimeSeconds(UUID, long)
  • addPlaytimeSeconds(UUID, long)
  • resetPlaytime(UUID)
Shop API
  • listShops()
  • listAdminShops()
  • listPlayerShops()
  • getShop(String)
  • createAdminShop(String)
  • createPlayerShop(String, UUID)
  • saveShop(ShopModel)
  • deleteShop(String)
Threading Notes

Call the API from the server thread (same context as commands and most events). Avoid using the API from async threads that touch world state.