Currencies
One wallet per player, shared across every game on your network. Earn coins in SkyWars, spend them in the lobby.
Currencies are the one thing on a player that is not split by game. Coins earned in SkyWars are the same coins spendable in the lobby shop - one wallet, network-wide, the whole point of a shared economy.
This is the deliberate exception to game-mode scoping:
| Scope | Example | |
|---|---|---|
| Currencies | network-wide | coins - earn anywhere, spend anywhere |
| Statistics | per game mode | wins in SkyWars ≠ wins in Bedwars |
| Namespaces | per game mode | your private store, per game |
Reading balances
Every profile load already carries the
balances - one CurrencyBalance (currencyName, balance) per currency the
player holds. No second call:
Shop.java
// Balances ride along on every profile load - no extra call.
hive.player()
.fetchPlayerData(player.uuid(), player.name(), "lobby", GameType.HYTALE)
.thenAccept(data -> {
long coins = data.getCurrencies().stream()
.filter(c -> c.getCurrencyName().equals("coins"))
.mapToLong(CurrencyBalance::getBalance)
.findFirst().orElse(0);
openShop(player, coins);
}); Defining currencies
Currency types are defined per network from the dashboard, not in code. Add
coins, gems, a seasonal event token - every server on the network sees the
same set instantly, so a new game can spend an existing currency the day it ships.
Next
- Statistics - per-game counters and leaderboards.
- Namespaces - your game’s private JSON store.