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 data/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 an asynchronous autosave task using statistic-saving-period, which defaults to 300 seconds. Each cycle saves arena data and player data, then refreshes every leaderboard. Player data is also saved when a round is cleared and during plugin shutdown.


The plugin refreshes all persistent integer leaderboards during autosave and after an active game is cleared. Entries with values of zero are omitted, remaining entries are sorted from highest to lowest, and leaderboard-size limits the cached positions.

PlaceholderAPI exposes the cached name, UUID, or value for a requested statistic and position. See the complete placeholder reference.