← Plugins · HyPrison Core

Developers & API

Integrate your Hytale server plugins with HyPrison Core: economy (balance, withdraw, deposit), placeholders for scoreboards and UIs, and services for ranks, mines, plots, warps, and more.

Getting the plugin

Obtain the HyPrison Core plugin instance via the Hytale server/engine plugin API (e.g. by plugin ID or name). The plugin exposes HyPrisonCorePlugin.get() for use once you have a reference. Call API methods from the main/server thread unless your engine allows otherwise.

Feature toggles

HyPrison Core systems can be turned off in config.json. Before using a service, check that the feature is enabled:

All default to true. Set to false to disable a system or use another plugin for that feature. Use plugin.isEconomyEnabled(), plugin.isMinesEnabled(), etc. before calling the corresponding service.

Economy API

When EnableEconomy is true, use HyPrison Core’s economy for balances and transactions (e.g. shop purchase = withdraw, refund = deposit).

  1. Check plugin.isEconomyEnabled().
  2. Get the service: EconomyService economy = plugin.getEconomyService();
MethodUse case
getBalance(UUID playerUuid)Show balance or check if player can afford a price.
hasAtLeast(UUID playerUuid, long amount)Quick check before charging (returns true if balance ≥ amount).
withdraw(UUID playerUuid, long amount, String reason)Charge the player (e.g. shop purchase). Returns false if insufficient balance.
deposit(UUID playerUuid, long amount, String reason)Give money (e.g. refund, reward).
setBalance(UUID playerUuid, long balance, String reason)Set balance directly (admin/setup).
transfer(UUID sender, UUID target, long amount)Transfer between two players.
topBalances(int limit)Get top balances (e.g. for custom baltop).
formatCurrency(long amount)Format amount for display (e.g. "$1,234").

Notes: Use the player’s UUID from the Hytale API for all calls. Use a short reason string for withdraw/deposit (e.g. "Shop: Diamond Sword"); it may be stored in transaction logs.

Placeholder API

Other plugins (e.g. scoreboard or custom UI plugins) can resolve HyPrison Core placeholders in strings. Get PlaceholderService placeholders = plugin.getPlaceholderService(); then:

Placeholder syntax: {name}. Names are case-insensitive.

PlaceholderDescriptionExample
playernamePlayer display nameSteve
balanceFormatted money balance$1,234
tokensFormatted token balance500
rankRank display (prefix text)[A] or [B] Steve
prestigePrestige id with P prefixP0, P1
totalblocksTotal blocks mined12,345
nextrankcostCost to rank up (formatted)$2,600
sellmultiplierSell multiplier for rank1.5
totalplaytimePlaytime1h 23m 45s
pickaxelevelPickaxe level5
pickaxexpCurrent XP toward next level1200
pickaxeprogressProgress to next level (0–100)70
pickaxeprogressbarProgress bar + percent███████░░░ 70%
fortunelevel, fortunemultiplierFortune upgrade3, 1.15
sellupgrademultiplierSell booster multiplier1.2
autosellAuto-sell on/offON or OFF
mineCurrent mine name (Player only)Coal Mine
progressMine progress % or — (Player only)67.5 or —
resetinBlocks until reset or countdown (Player only)5000 blocks or 02:30
mineavgAverage sell value in mine (Player only)$12

Leaderboard placeholders: {lb_balance_name_1}{lb_balance_name_20} and {lb_balance_value_1}{lb_balance_value_20} (and similarly for tokens, prestige, rank, blocks).

Other services

You can read and use data via the plugin’s services. There is no formal contract for mutating crates, plots, warps, etc. from other plugins; those are primarily controlled by config and in-game commands. Economy and placeholders are the main integration points for shops and scoreboards.

Code examples

Short snippets are below. For more copy-paste examples (shop purchase, reward, baltop, transfer, scoreboard with mine context, rank cost, mine composition, feature checks), see API examples.

Economy: shop purchase

HyPrisonCorePlugin plugin = HyPrisonCorePlugin.get();
if (plugin == null || !plugin.isEconomyEnabled()) return;
EconomyService economy = plugin.getEconomyService();
long price = 500;
if (!economy.hasAtLeast(playerUuid, price)) {
    // Not enough money
    return;
}
if (economy.withdraw(playerUuid, price, "Shop: MyItem")) {
    // Give item to player
}

Placeholder: scoreboard line

PlaceholderService ph = plugin.getPlaceholderService();
String template = "Balance: {balance} | Rank: {rank} | Tokens: {tokens}";
String resolved = ph.resolve(player.getUuid(), template);
// Or, for mine-aware (mine, progress, resetin, mineavg):
// String resolved = ph.resolve(player, template);
setScoreboardLine(resolved);

Rank: prefix and sell multiplier

RankService rankService = plugin.getRankService();
String prefix = rankService.getPrefixText(playerUuid);
String rankId = rankService.getRankId(playerUuid);
double sellMultiplier = rankService.getSellMultiplier(playerUuid);

Mine: at player position and list accessible mines

MineService mineService = plugin.getMineService();
Optional<MineDefinition> mineAt = mineService.resolveMineAtPlayer(player);
List<String> names = mineService.getMineNames(
    rankService.getRankId(playerUuid),
    rankService.getPrestigeId(playerUuid)
);

Packages

HyPrisonCorePlugincom.hyprisoncore.HyPrisonCorePlugin · EconomyServicecom.hyprisoncore.economy.EconomyService · PlaceholderServicecom.hyprisoncore.placeholder.PlaceholderService · RankServicecom.hyprisoncore.rank.RankService · MineServicecom.hyprisoncore.mine.MineService · MineDefinitioncom.hyprisoncore.config.MineDefinition

HyPrison Core by DrSmoker / Highwater Studios LLC. Premium license — one key per server. For licensing: Discord — drsmokerttv.