Skip to content

Custom stats

Your plugins can add stats such as wins or best times with the ThoriumStats API that ships inside the Thorium plugin.

import ac.thorium.mc.api.ThoriumStats;
ThoriumStats.increment(player, "bedwars_wins", 1);
ThoriumStats.increment(player, "beds_broken", 1);
ThoriumStats.max(player, "parkour_best_seconds", 41.7);
  • increment adds to a running total.
  • max records a score; the site shows each player’s highest.
  • Keys use lower-case letters, digits and underscores, up to 32 characters. Calls with other keys are ignored and logged once.
  • Calls never throw and cost almost nothing. They are dropped while Advanced Analytics is off.

Add Thorium to softdepend in your plugin.yml so the class is available.

Once a key has been sent, it appears in the dashboard under Stats site > Groups and stats > Add stat > Custom counter (or Custom best score).

On Minestom the same class is available with Minestom’s Player.