Documentation menu

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:

ScopeExample
Currenciesnetwork-widecoins - earn anywhere, spend anywhere
Statisticsper game modewins in SkyWars ≠ wins in Bedwars
Namespacesper game modeyour 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