Coins banner
Coins icon

Coins

In game currency that can be used for a shop, i want to be able to add items to this shop and modify the prices from the script in game menu so players can...

00
hytaleServer2026.1mod

Coins mod adds a persistent coin currency with a configurable server-side shop that can be edited in-game.

Key features

  • Coins are stored per-player and persisted automatically; balances never drop below zero.
  • Shop entries are fully runtime-editable and survive restarts (saved in the mod data folder).
  • Players can buy configured items with coins; failed deliveries refund the cost.
  • Admin-only controls for crediting coins, setting balances, and managing the shop catalog.

Commands

  • /coins balance [player] – view your balance or another player’s when provided.
  • /coins give <amount> [player] – admin: add coins to yourself or a specified player.
  • /coins set <amount> <player> – admin: set an exact balance for a player.
  • /coins shop or /coins shop list – list all shop entries with prices and quantities.
  • /coins shop add <key> <item> <price> [quantity] [name] – admin: add/update a listing (key is the handle used for buying).
  • /coins shop price <key> <price> – admin: update a listing price.
  • /coins shop remove <key> – admin: delete a listing.
  • /coins shop buy <key> – players purchase the item defined by that key using their coins.

Implementation notes

  • Data is kept in balances.properties and shop.properties inside the mod’s data directory.
  • Shop entries store the item id, price, quantity per purchase, and optional display name (base64 encoded for safety).
  • Purchases try to place items in any inventory slot; if the inventory rejects the stack the coins are refunded.
  • Permission node used for administration: coins.admin.

Known limitations / ideas

  • Uses the player’s UUID for balances; if the server removes the uuid link the entry will not match.
  • No GUI menu is included; shops are managed and used via commands so they can be wired into scripts/menus as needed.