Skip to content

Leaderboards

Jan Kluka edited this page Oct 23, 2026 · 1 revision

Leaderboards

Since 2026.3.12.0

Leaderboards rank your players without any extra plugin: a /top menu, hologram boards you place in the world, and placeholders for scoreboards, tab and any hologram plugin.

Everything lives in leaderboards.yml. Leaderboards are a module, so they switch off like any other with modules.leaderboards in config.yml.


Boards

Board id Ranks players by
currency_<name> Balance of that currency - one board per currency in currencies.yml (currency_money, currency_tokens, ...). currency_credits is off by default
blocks Blocks mined
ranks Rank (shown with the rank prefix)
prestiges Prestige
rebirths Rebirths
autominer AutoMiner time left
gangs Gang value (ranks gangs, not players)

Add-ons can register more boards through the API; they appear in the menu, as holograms and as placeholders automatically.

Under boards: you can rename a board (display-name), change its menu icon (icon) or switch it off (enabled: false). The order of that list is the order of the menu. A board not listed there uses its default name and a paper icon.

Boards are recalculated in the background every refresh-seconds (60 by default) and keep the top snapshot-size positions (100 by default). Nothing runs while players mine. Values come from the database, so a player's newest progress shows up after the next player-data save and refresh.


The menu

/top (also /leaderboards, /lb - change them under commands:) opens a menu with every board, its top 3 and the player's own position. Clicking a board opens the full ranking with player heads and a "your position" item.

  • /top <board> opens one board directly, e.g. /top currency_tokens.
  • /top <board> <player> or /top <player> opens it for another player - handy for NPCs. This needs xprison.menu.other (see Commands & Permissions).

Both menus are fully configurable under gui.menu and gui.board: title, rows, filler, the slots the boards / positions fill, item names and lore, and the page buttons.


Hologram boards

Needs DecentHolograms. Without it the menu and placeholders still work and the console prints one warning.

Command Description
/xprison leaderboard create <id> <board> [lines] Place a board above you. id is your own name for it (a-z, 0-9, _, -); lines defaults to 10
/xprison leaderboard move <id> Move a placed board to you
/xprison leaderboard delete <id> Remove a placed board
/xprison leaderboard list Show every board id and every placed hologram
/xprison leaderboard refresh Recalculate every board now

Placed boards are saved in plugins/X-Prison/leaderboards/holograms.yml and update on their own after every refresh. Their look is set under hologram: - header and footer lines plus the line template for each position (%position%, %name%, %value%; %board% and %refresh% work in the header and footer).


Placeholders

Placeholder Description
%xprison_lb_<board>_<position>_name% Who holds that position, e.g. %xprison_lb_currency_tokens_1_name%
%xprison_lb_<board>_<position>_value% The formatted value, e.g. 1.5M
%xprison_lb_<board>_<position>_value_raw% The plain number, e.g. 1500000
%xprison_lb_<board>_position% The viewing player's own position (#3), or empty-value if they are not ranked

An empty position shows empty-name / empty-value from leaderboards.yml.


Permissions

Permission Default Description
xprison.leaderboards everyone Open /top

The /xprison leaderboard commands need xprison.admin, like every /xprison subcommand.


Developer API

XPrisonLeaderboardsAPI leaderboards = XPrisonAPI.getInstance().getLeaderboardsApi();

leaderboards.registerSource(new LeaderboardSource() {
    public String getId() { return "pets_level"; }
    public String getDisplayName() { return "<gold>Highest Pet Level"; }
    public List<LeaderboardEntry> fetch(int limit) {   // called off the main thread
        return myDatabase.topPetLevels(limit);
    }
});

LeaderboardEntry first = leaderboards.getEntry("currency_tokens", 1);
OptionalInt position = leaderboards.getPosition("blocks", player.getUniqueId());

Every read is served from the cached snapshot, so it is safe on the main thread. See Developer API.

The default file: leaderboards.yml.

XPrison Logo

General

Modules

Default Configs

Enchant Configs — Passive

Enchant Configs — Currency Rewards

Enchant Configs — Key & Item Rewards

Enchant Configs — Area of Effect

Enchant Configs — Multipliers

Enchant Configs — Templates

Enchant Configs — Addons

Addons

Support

For Developers

Others

Clone this wiki locally