Documentation
CoinsX Wiki
Complete reference for commands, permissions, PlaceholderAPI, the Web API, and a step-by-step tutorial to build your own leaderboard website.
Paper 1.21+ Java 21+ PlaceholderAPI Web API ajLeaderboards

Installation

Get CoinsX running on your server in under a minute.

Requirements: Paper 1.21+ and Java 21. Spigot is not officially supported.

Configuration

Main settings are in plugins/CoinsX/config.yml. Every option is commented inline.

config.yml

# Default currency when none is specified
default-currency: coins

database:
  type: sqlite          # sqlite | mysql
  mysql:
    host: localhost
    port: 3306
    database: coinsx
    username: root
    password: ''

web-api:
  enabled: true
  port: 8765
  secret-token: 'change_me_please'  # for POST endpoints
  cors-origin: '*'             # your website origin or *
  leaderboard-cache-seconds: 30

economy:
  default-starting-balance: 0.0
  max-balance: 0            # 0 = no limit
  allow-negative: false
  min-pay-amount: 1.0
  pay-tax: 0.0              # percentage, 0 = no tax

leaderboard:
  entries-per-page: 10
  refresh-interval: 60     # seconds

Currency Config (Currency/coins.yml)

name: '<gradient:#f5a623:#f9d05e>Coins</gradient>'
name-plain: Coins
symbol: ⛃
symbol-position: before    # before | after
decimal-places: 0
starting-balance: 0
compact-format: true       # 1500 → 1.5K
payable: true
show-in-leaderboard: true
placeholder-enabled: true

Commands

All commands support tab-completion. <required> · [optional]

Player Commands

CommandDescriptionAlias
/balance [currency] [player]Check your or another player's balance./bal
/coins <currency> balance [player]Check balance for a specific currency./coinsx
/coins <currency> pay <player> <amount>Transfer currency to another player.
/baltop [currency] [page]View the richest players on the leaderboard.

Admin Commands

CommandDescription
/cxa give <player> <currency> <amount>Add balance. Supports shorthand: 100k, 2.5m, 1b, 500t.
/cxa take <player> <currency> <amount>Remove balance from a player.
/cxa set <player> <currency> <amount>Set a player's balance exactly.
/cxa reset <player> <currency>Reset a player to their starting balance.
/cxa currenciesList all registered currencies.
/cxa createcurrency <id> <name> <symbol>Create a new currency in-game.
/cxa deletecurrency <id>Permanently delete a currency and all its data.
/cxa reloadReload config, lang, and currency files.
Note: /coinsadmin has the alias /cxa for faster admin usage. Amount supports shorthand: 100k = 100,000 · 2.5m = 2,500,000 · 1b = 1,000,000,000.

Permissions

All permissions follow the coinsx.* namespace. OP players inherit all permissions by default.

PermissionDescriptionDefault
coinsx.useBasic plugin usage.Everyone
coinsx.balanceCheck your own balance.Everyone
coinsx.balance.othersCheck other players' balances.OP
coinsx.baltopView the leaderboard via /baltop.Everyone
coinsx.paySend currency to other players.Everyone
coinsx.adminAccess to all admin commands.OP
coinsx.admin.giveGive currency to a player.OP
coinsx.admin.takeTake currency from a player.OP
coinsx.admin.setSet a player's exact balance.OP
coinsx.admin.resetReset a player's balance.OP
coinsx.admin.reloadReload the plugin.OP
coinsx.admin.createcurrencyCreate new currencies in-game.OP
coinsx.admin.deletecurrencyDelete currencies in-game.OP

PlaceholderAPI

Replace <currency> with your currency ID (e.g. coins, tokens). Replace <rank> with a number like 1, 2, 3

Player Balance

PlaceholderReturnsExample
%coinsx_balance_<currency>%Balance with commas, no symbol.1,500
%coinsx_balance_formatted_<currency>%Balance with symbol + commas.⛃1,500
%coinsx_balance_compact_<currency>%Compact format with symbol.⛃1.5K
%coinsx_balance_raw_<currency>%Raw double value, no formatting.1500.0

Leaderboard (by Rank)

PlaceholderReturnsExample
%coinsx_top_name_<currency>_<rank>%Player name at that rank.Notch
%coinsx_top_uuid_<currency>_<rank>%Player UUID at that rank.069a79f4-…
%coinsx_top_balance_<currency>_<rank>%Balance at that rank with commas.50,000
%coinsx_top_formatted_<currency>_<rank>%Formatted balance with symbol.⛃50,000
%coinsx_top_compact_<currency>_<rank>%Compact balance at that rank.⛃50K

Player Rank & Stats

PlaceholderReturnsExample
%coinsx_rank_<currency>%The player's rank on the leaderboard.7
%coinsx_total_players_<currency>%Total registered players.342
%coinsx_currency_name_<currency>%Display name of the currency.Coins
%coinsx_currency_symbol_<currency>%Symbol of the currency.

Web API — Overview

CoinsX ships with a built-in HTTP server. No extra software needed — just open the port and start making requests.

Base URL: http://YOUR_SERVER_IP:PORT

The port is configurable in config.yml under web-api.port. Make sure that port is open and allocated in your server panel.
HTTPS tip: If your website uses HTTPS, browsers will block plain HTTP API calls. Use a PHP proxy (coinsx_proxy.php) on your web server to forward requests server-side — no mixed content issues.

Web API — Endpoints

All public GET endpoints require no authentication.

GET /api/currencies

Returns a list of all registered currencies.

{\n "success": true,\n "currencies": [\n {\n "id": "coins",\n "name": "Coins",\n "symbol": "⛃",\n "symbolPosition": "before",\n "decimalPlaces": 0,\n "payable": true,\n "showInLeaderboard": true\n }\n ]\n}

GET /api/leaderboard/{currency}

Returns the top 100 players for a currency. Supports pagination via query params.

Query ParamDefaultDescription
page1Page number.
per_page100Results per page (max 100).
{\n "success": true,\n "currency": "coins",\n "entries": [\n {\n "rank": 1,\n "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",\n "name": "Notch",\n "balance": 50000,\n "formatted": "⛃50,000",\n "formattedCompact": "⛃50K"\n }\n ]\n}

GET /api/player/{uuid}/{currency}

Returns the balance of a specific player by UUID.

{\n "success": true,\n "uuid": "069a79f4-...",\n "currency": "coins",\n "balance": 12500,\n "formatted": "⛃12,500",\n "formattedCompact": "⛃12.5K"\n}

GET /api/stats

Returns live server and economy stats.

{\n "success": true,\n "stats": {\n "onlinePlayers": 14,\n "maxPlayers": 100,\n "currencies": 2,\n "registeredPlayers": { "coins": 342, "tokens": 311 }\n }\n}

Web API — Protected Endpoints

These POST endpoints modify balances. They require a Bearer token set in your config.yml.

Security: Never expose your secret token publicly. Use these endpoints only from a trusted backend server, never from client-side JavaScript.

Request Format

POST /api/give
Authorization: Bearer your_secret_token
Content-Type: application/json

{
  "uuid": "069a79f4-44e9-4726-a5be-fca90e38aaf5",
  "name": "Notch",
  "currency": "coins",
  "amount": 500
}
EndpointAction
POST /api/giveAdd amount to the player's current balance.
POST /api/takeSubtract amount from the player's balance (floors at 0).
POST /api/setSet the player's balance to exactly amount.

Tutorial — Setup API Server

Before building your website, make sure CoinsX's Web API is reachable from outside your server.

Tutorial — Build a Leaderboard Page

A complete working leaderboard page using vanilla HTML + JavaScript + PHP proxy. No frameworks needed.

leaderboard.html// Call your PHP proxy instead of the MC server directly
const PROXY = 'backend/coinsx_proxy.php';

async function fetchJson(path) {
  const [cleanPath, qs] = path.split('?');
  let url = PROXY + '?path=' + encodeURIComponent(cleanPath);
  if (qs) url += '&' + qs;
  const r = await fetch(url);
  return r.json();
}

async function loadLeaderboard() {
  const data = await fetchJson('/api/leaderboard/coins?per_page=10');
  const tbody = document.getElementById('lb');
  tbody.innerHTML = '';
  for (const entry of data.entries) {
    tbody.innerHTML += `<tr>
      <td>#${entry.rank}</td>
      <td>${entry.name}</td>
      <td>${entry.formattedCompact}</td>
    </tr>`;
  }
}
loadLeaderboard();
setInterval(loadLeaderboard, 30000); // refresh every 30s
Tip: Use entry.formattedCompact for compact display (⛃1.5K) and entry.formatted as a hover tooltip for the full value (⛃1,500).

Tutorial — Player Balance Lookup

Let players look up their own balance (or any player's) by UUID on your website.

balance.htmlasync function lookupBalance() {
  const uuid     = document.getElementById('uuid').value.trim();
  const currency = document.getElementById('currency').value.trim();
  if (!uuid || !currency) return;

  const data = await fetchJson(`/api/player/${uuid}/${currency}`);

  if (data.success) {
    document.getElementById('result').textContent =
      `${data.name ?? uuid}: ${data.formattedCompact} (${data.formatted})`;
  } else {
    document.getElementById('result').textContent = 'Player not found.';
  }
}

Tutorial — Admin Panel (Give/Take/Set)

Use the protected POST endpoints from a server-side backend — never call these from the browser directly as that would expose your secret token.

PHP Example

admin.php<?php
require_once 'coinsx_config.php';

function coinsx_give($uuid, $name, $currency, $amount) {
  $ch = curl_init(COINSX_URL . '/api/give');
  curl_setopt_array($ch, [
    CURLOPT_POST           => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER     => [
      'Content-Type: application/json',
      'Authorization: Bearer ' . COINSX_KEY
    ],
    CURLOPT_POSTFIELDS => json_encode([
      'uuid' => $uuid, 'name' => $name,
      'currency' => $currency, 'amount' => $amount
    ])
  ]);
  $r = json_decode(curl_exec($ch), true);
  curl_close($ch);
  return $r;
}

// Usage
$r = coinsx_give('069a79f4-...', 'Notch', 'coins', 500);
echo "New balance: " . $r['newBalance'];
?>

Java Developer API

Hook into CoinsX from your own plugins using the CoinsXAPI class.

MyPlugin.java// Get the API instance
CoinsXAPI api = CoinsX.getInstance().getAPI();

// Check balance
double balance = api.getBalance(player, "coins");

// Give coins
api.give(player, "coins", 500);

// Take coins (returns false if not enough)
boolean success = api.take(player, "coins", 100);

// Set exact balance
api.setBalance(player, "coins", 1000);

// Check if player has enough
boolean hasEnough = api.has(player, "coins", 250);

// Get top 10 leaderboard
List<LeaderboardEntry> top = api.getLeaderboardPage("coins", 1, 10);
for (LeaderboardEntry entry : top) {
    plugin.getLogger().info("#" + entry.getRank() + " " + entry.getName()
        + ": " + entry.getBalance());
}
Dependency: Add CoinsX as a softdepend in your plugin.yml: softdepend: [CoinsX]

Currency Config Reference

Each file in plugins/CoinsX/Currency/ defines one currency. The filename (without .yml) is the currency ID.

KeyTypeDescription
nameStringDisplay name. Supports MiniMessage formatting (gradients, hex colors).
name-plainStringPlain text name for places that don't support color.
symbolStringCurrency symbol (e.g. , $, T).
symbol-positionStringbefore or after the amount.
decimal-placesIntegerHow many decimal places to display. 0 for whole numbers.
starting-balanceDoubleBalance new players start with.
compact-formatBooleanEnable compact display: 15001.5K, 20000002M.
payableBooleanWhether players can /coins pay this currency.
show-in-leaderboardBooleanWhether this currency appears in /baltop and the web leaderboard.
placeholder-enabledBooleanWhether PlaceholderAPI placeholders work for this currency.