Skip to main content

Show Leaderboards on Scoreboards and Tab

Every leaderboard has its own placeholders, so any plugin that supports PlaceholderAPI can show it: scoreboards, tab lists, chat, menus, holograms of other plugins. This page has ready lines to paste. The examples use vault_eco_balance; put your leaderboard's name in its place.

How a placeholder is built​

%nexalleaderboards_<leaderboard>[_<period>]_<what>[_<extra>...]%
PartExamplesMeaning
leaderboardvault_eco_balanceThe tracked placeholder, without %
periodweekly, monthly, 7dOptional: that period instead of all time
what1, 2, rank, scoreA rank's player, or the viewer's own rank or score
extraformatted, compact, changeHow to show it; several can follow each other

A top 3 on the scoreboard​

- "&6&lRichest players"
- "&e#1 &f%nexalleaderboards_vault_eco_balance_1% &7%nexalleaderboards_vault_eco_balance_1_formatted%"
- "&e#2 &f%nexalleaderboards_vault_eco_balance_2% &7%nexalleaderboards_vault_eco_balance_2_formatted%"
- "&e#3 &f%nexalleaderboards_vault_eco_balance_3% &7%nexalleaderboards_vault_eco_balance_3_formatted%"

_1 alone gives the name. _1_formatted gives the value in the leaderboard's number format. While nobody holds a rank yet, the name is - and the value 0.

The player's own place​

- "&7Your rank: &f#%nexalleaderboards_vault_eco_balance_rank%"
- "&7Your balance: &f%nexalleaderboards_vault_eco_balance_score_formatted%"

A player who is not ranked sees - for the rank.

This week's race​

Add the period after the leaderboard's name:

- "&6&lTop earner this week"
- "&f%nexalleaderboards_vault_eco_balance_weekly_1% &7+%nexalleaderboards_vault_eco_balance_weekly_1_formatted%"
- "&7You: &f#%nexalleaderboards_vault_eco_balance_weekly_rank% &7(+%nexalleaderboards_vault_eco_balance_weekly_score_formatted%)"

The period keys are the ones under Periods in /lb admin: daily, weekly, monthly, 24h, 7d and 30d by default.

Rank arrows​

Add _change to show how a rank moved since yesterday: ▲3, ▼1, or NEW.

- "&e#1 &f%nexalleaderboards_vault_eco_balance_1% %nexalleaderboards_vault_eco_balance_1_change%"
- "&7You: &f#%nexalleaderboards_vault_eco_balance_rank% %nexalleaderboards_vault_eco_balance_rank_change%"

Another format in one place​

A placeholder can ask for its own format, whatever the leaderboard's is:

ExtraGives
_number1,500,000
_compact1.5M, short enough for a tab list
_time2d 3h 15m; add _ticks, _seconds, _minutes or _hours for what the value counts in
_valueThe raw number, 1500000.0, for plugins that do maths with it
_reversedCounts from the other end: _1_reversed is the lowest value

They can be combined: %nexalleaderboards_vault_eco_balance_weekly_1_compact%.

Check it​

/papi parse me %nexalleaderboards_vault_eco_balance_1%

prints the name at #1. If it prints the placeholder itself, the leaderboard name is misspelled or PlaceholderAPI is not loaded. Values change at every refresh of the leaderboard, so a scoreboard can show an old value for up to one refresh interval.

Auto-tracking: with Auto-Track on Query on (the default), using a placeholder of a leaderboard that is not tracked yet starts tracking it, if it gives a number. A typo in a scoreboard line therefore never creates a leaderboard, but a real placeholder does: track your leaderboards on purpose, and turn auto-tracking off in Configuration if you prefer.

All the rules are on the Placeholders page.