Show a leaderboard
Let players see the richest of each currency with /baltop, the money in circulation, and keep staff off the board.
Every stored currency can have a ranking of its richest players, opened with /baltop, a currency's own top command or the wallet. A currency with the leaderboard off, or one this plugin does not store, answers "… has no leaderboard." rather than an empty board.
Before you start#
You need a stored currency, see Create a currency. The leaderboard is on for a new currency. Players need exyliaeconomy.top, given to everyone by default, see Permissions.
Steps#
Choose the currencies
Run /economyadmin, left-click a currency, then click Integrations. Top switches its leaderboard on or off.
Leave staff off (optional)
Give the staff group exyliaeconomy.top.exempt in your permissions plugin. Nobody has it by default, operators included.
Check that it works#
Open the default board
Run /baltop. A screen opens with heads, positions and amounts, and the money in circulation in a corner.
Open another currency
Run /shards top, /economy top <currency> or right-click a currency in /wallet.
Going further#
The commands#
| Command | What it shows |
|---|---|
/baltop [page] (/balancetop, /moneytop) | The default currency. |
/economy top [currency] [page] | Any currency. /eco top 2 is page 2 of the default one. |
/shards top [page] | That currency. |
Right-click a currency in /wallet | That currency. |
A player gets the board as a screen, 90 places deep. The page argument is for the console, which gets ten lines per page under a header and the money in circulation:
TOP Dollars page 1
▎ In circulation » $1,204,300.00
#1 Steve » $250,000.00
#2 Alex » $180,500.00How fresh the board is#
The board is read from the database and kept for a minute, because a leaderboard on a scoreboard is asked for every tick. While it refreshes, the old board keeps being served. The first look after a start waits for the read instead of opening empty. The cache holds the first 100 places; the screen shows 90. Each server keeps its own copy, so two servers can disagree for up to a minute after a large payment.
The money supply#
Every balance of the currency added up, hidden players included, is the money in circulation. It is read with the board, so it is as fresh as the board:
- the console's
/baltopprints it under the header; - the screen shows it in a corner;
%exyliaeconomy_economy_total_<currency>%returns it, see Placeholders.
When ExyliaAnalytics is installed, each stored currency's supply and how many players hold any of it are handed to it a minute after the start and every ten minutes after that, see Integrations.
Leaving players off#
exyliaeconomy.top.exempt leaves a player off every leaderboard without taking a place: the board ranks the next player into it. A permission cannot be checked for somebody offline and the board ranks everybody, so the exemption is stored in the database when the player joins. Granting or removing it applies from their next join, and on the board within a minute after that. An exempt player's money still counts in the supply, and %exyliaeconomy_economy_rank_<currency>% answers — for them.
Change the board screen
The screen is menus/user/top.yml under the plugin's language folder. It shows the supply in slot 45 as %top_total%. The file is written once and then yours: a file written by a version without the money supply keeps its old layout, so add the total item or delete the file to get the new one. Menus work as described in menus.
Something missing on this page? Tell us on Discord