Skip to main content

Periods

An all time leaderboard rewards whoever has played longest. After a few months the same names sit at the top and nobody else can catch up. Periods fix that: they rank what each player gained in a stretch of time, so every week, month or day is a fresh race that anyone can win.

Every leaderboard is ranked for every period at once. You do not set periods up per leaderboard: add a period once and all your leaderboards have it.

How a period score is worked out​

A period score is the value now, minus the value when the period started.

Say the leaderboard is vault_eco_balance and the period is This Week:

PlayerBalance on Monday 00:00Balance now (Thursday)This Week
Steve1,000,0001,020,00020,000
Alex5,00080,00075,000
Sam300300not ranked

Alex is #1 this week, even though Steve is far richer. Sam did not earn anything this week, so Sam is not on the weekly board at all. Only players whose value changed in the period are ranked.

A few more things follow from this:

  • A value that went down gives a negative score. A player who spent more than they earned this week has a negative weekly score.
  • A player seen for the first time during a period counts from their first value, not from zero. A new player who joins with 500 coins starts this week at 500.
  • Leaderboards that only go up (kills, blocks mined, play time) are the best fit for periods. Money works too, as "money earned".

The two kinds of period​

Calendar periods​

Start again at the beginning of every day, week, month or year, at midnight in the plugin's time zone. This Week ranks from Monday 00:00 until now, then at the next Monday 00:00 everyone is back at zero.

  • A week can start on any day: open the period and change Week Starts On.
  • Calendar periods are the ones that can pay rewards, since they end.

Rolling periods​

The last so many days or hours before now: Last 7 Days on Thursday 15:00 ranks from the previous Thursday 15:00. A rolling period never starts again, it moves forward every hour. It is good for "who is active lately" boards that never go blank, but it cannot pay rewards because it never ends.

The default periods​

KeyNameKind
dailyTodayCalendar, every day
weeklyThis WeekCalendar, every week from Monday
monthlyThis MonthCalendar, every month
24hLast 24 HoursRolling, 24 hours
7dLast 7 DaysRolling, 7 days
30dLast 30 DaysRolling, 30 days

The key is what placeholders and commands use (%nexalleaderboards_vault_eco_balance_weekly_1%, /lb top vault_eco_balance weekly). The name is what players see in menus, holograms and chat.

Adding, changing and removing periods​

All of it is in /lb admin → Periods:

  1. Add Period, then type a key in chat: lowercase letters and digits, such as season, 14d or yearly.
  2. The period starts as the last 7 days. On its screen, set:
    • Kind: calendar or rolling.
    • Starts Again (calendar): every day, week, month or year.
    • Week Starts On (a weekly calendar period).
    • Length (rolling): click for a day more or less, shift click for an hour.
    • Display Name: typed in chat, such as Season 3 or Last 14 Days.
  3. Every change is saved to config.yml and applies at once, to every leaderboard.

Remove Period (shift right click) takes it out of config.yml. Holograms and signs that show it go blank, and its placeholders give nothing. The history is not touched, so adding the period back with the same key brings its rankings back exactly as they were.

A step-by-step example: Add your own period.

The time zone​

Calendar periods start at midnight, but whose midnight? By default the server's. If your server is hosted in Germany and your players are in New York, "Today" would end at 6 in the evening for them. Set the zone in /lb admin → Periods → Time Zone and type a name such as America/New_York or Europe/Athens (server goes back to the server's own). It also decides when rewards are paid.

Periods reach into the past​

Periods are worked out from the score history, whenever they are asked for. That means:

  • A period you add today already has rankings, as far back as the history goes. Add a Last 14 Days period and it shows the last 14 days at once (if the plugin was tracking then).
  • Changing a period's length or kind applies to the past too.
  • A rolling period longer than the hourly history is exact to the day, not the hour.

Where periods show up​

WhereHow
The leaderboard menuThe clock button switches between All Time and every period
Chat/lb top <leaderboard> <period> [count]
Holograms, signs, heads, NPCsTheir Period button
Placeholders%nexalleaderboards_<leaderboard>_<period>_1%, _<period>_rank and so on
RewardsPaid when a calendar period ends