Playtime Leaderboard
This will guide you on how to create an unreliable playtime leaderboard for your server using the built-in
Statistic Value Provider and format the value using
Value Display.
Add the Holder
- SpigotMC
- FabricMC
Open the config.yml file and add the following holder:
holders:
playtime:
type: statistic
statistic: PLAY_ONE_MINUTE # Or PLAY_ONE_TICK if your server is running on 1.12 or below
Open the config.json file and add the following holder:
{
"holders": {
"playtime": {
"type": "statistic",
"statistic": "minecraft:play_time"
}
}
}
This will create a holder named playtime that shows the total playtime of a player in ticks.
But the value is in ticks, which is not human-readable. So, we need to format it. Add the following line:
- SpigotMC
- FabricMC
holders:
playtime:
type: statistic
statistic: PLAY_ONE_MINUTE
default-value-display: "time:pattern=HH:mm:ss&type=duration&unit=ticks"
{
"holders": {
"playtime": {
"type": "statistic",
"statistic": "minecraft:play_time",
"default-value-display": "time:pattern=HH:mm:ss&type=duration&unit=ticks"
}
}
}
We added the default-value-display setting to the holder to set the Default Value Display. The
time:pattern=HH:mm:ss&type=duration&unit=ticks will format the value to a human-readable time format.
Now when you save and restart the server, you should see the playtime leaderboard in the /gettop playtime command.

Display the Leaderboard
We will display it in a hologram
Here is an example of a hologram that displays the top 5 players in the leaderboard:
- SpigotMC
- FabricMC
&b&lPLAYTIME LEADERBOARD
&7#1 &f%topper_playtime;top_name;1% &7- &b%topper_playtime;top_value;1%
&7#2 &f%topper_playtime;top_name;2% &7- &b%topper_playtime;top_value;2%
&7#3 &f%topper_playtime;top_name;3% &7- &b%topper_playtime;top_value;3%
&7#4 &f%topper_playtime;top_name;4% &7- &b%topper_playtime;top_value;4%
&7#5 &f%topper_playtime;top_name;5% &7- &b%topper_playtime;top_value;5%
<aqua><bold>PLAYTIME LEADERBOARD
<gray>#1 <white>%topper:query playtime;top_name;1% <gray>- <aqua>%topper:query playtime;top_value;1%
<gray>#2 <white>%topper:query playtime;top_name;2% <gray>- <aqua>%topper:query playtime;top_value;2%
<gray>#3 <white>%topper:query playtime;top_name;3% <gray>- <aqua>%topper:query playtime;top_value;3%
<gray>#4 <white>%topper:query playtime;top_name;4% <gray>- <aqua>%topper:query playtime;top_value;4%
<gray>#5 <white>%topper:query playtime;top_name;5% <gray>- <aqua>%topper:query playtime;top_value;5%
