Skip to content

Statistics and Leaderboards

The Snake tracks six integer statistics for each player:

KeyMeaning
winNumber of won rounds.
loseLoss counter stored by the data model. The current game code does not increment it.
win_streakConsecutive wins, reset after a collision or border loss.
best_scoreHighest score reached in one round.
total_scoreSum of all finalized round scores.
games_playedNumber of finalized rounds.

  • Flat file: Stores values in stats.yml under each player’s UUID.
  • MySQL: Creates or updates a table with UUID, name, and one column for every persistent statistic.

MySQL loads and saves through a single background executor. Batch saves run in a transaction and the executor is given up to 10 seconds to finish during shutdown.


The plugin starts a five-minute asynchronous autosave task. Player data is also saved when a round is cleared and during plugin shutdown.


When PlaceholderAPI is enabled, the plugin creates an internal leaderboard manager and refreshes all persistent integer leaderboards during autosave. Entries with values of zero are omitted and the remaining entries are sorted from highest to lowest.

The current PlaceholderAPI expansion exposes player and arena placeholders only. It does not yet expose ranked leaderboard position placeholders.