Skip to main content

Score History

Behind periods, rank arrows and rewards there is one thing: the score history. The plugin remembers what every player's value was, hour by hour, so it can answer questions such as "how much did Alex earn between Monday and now?" or "what rank was Steve yesterday?" at any time.

You never have to look at the history yourself. This page explains what is kept, so you can decide how much to keep.

What is kept​

At every refresh, the plugin notes each player's value. It keeps:

  • One value per hour (the last one of that hour), for the last 7 days.
  • One value per day (the last one of that day), after that, for 400 days.
  • Nothing older than that.

So a week has hour-exact history, and a year has day-exact history. Old values are thinned out on their own: you never have to clean anything up.

The two settings​

/lb admin → Configuration:

SettingDefaultWhat it decides
Hourly History7 daysHow long hourly values are kept. Periods in hours (Last 24 Hours) and rank arrows of a few hours need them. Up to the retention
History Retention400 daysHow far back any value is kept, from 1 day to 10 years. No period can reach further back
history:
hourly-days: 7
retention-days: 400

How to choose:

  • A yearly period needs at least 366 days of retention. A monthly one 31.
  • If you only use daily and weekly boards, 60 days is plenty and keeps the data small.
  • Longer hourly history makes rolling periods in hours exact further back. Most servers never need more than 7 days.

How big it gets​

Every player on every leaderboard has their own history, and it grows with how many players are active, how many leaderboards you track and how long you keep it: at the defaults, up to a few hundred values per player and leaderboard. With JSON storage that all goes into data.json. If the file gets large, lower the retention, or move to MySQL or MariaDB.

Where history starts​

History starts the moment a leaderboard is tracked. A player's first value counts as their starting point, so somebody who joins with 5,000 coins does not "earn" 5,000 in their first week.

When you update from 1.0.3 or older, each player's history starts from the score they had stored, so nobody suddenly gains their whole balance in the first week after the update.

Changing things later​

Because periods are worked out from the history whenever they are needed, you can add or change a period at any time and it applies to the past, as far back as the history goes. Lowering the retention throws away the older values at the next clean up, and periods that reached that far back only count what is left.