Compatibility
Minecraft: Java Edition
Platforms
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
LeaderBoard Datapack
A Datapack to place LeaderBoards Ranking players of your server on a given scoreboard objective.
How to use
Add a LeaderBoard
All fields with syntax <field> must be replaced by the needed content. '|' means a choice between 2 values
/function leaderboard:commands/add_leaderboard {score:<Scoreboard_objective_name>,max_players:<Max>,display_name:"<Display_Name>",time_mode:<0|1>,reverse_order:<0|1>,no_zero:<0|1>}
The time_mode option will display the score as a time with hours, minutes, seconds and 1/20th of a second (ticks). It requires the given score to be a time in ticks.
The reverse_order option will reverse the order of the players in the LeaderBoard. Puts the lowest score first.
The no_zero option will remove players with either no score or a score that equals 0 from the LeaderBoard. This is especially useful in reverse mode to avoid having new players at the top of the LeaderBoard by default.
Remove a LeaderBoard
This will remove the nearest LeaderBoard using the given score.
/function leaderboard:commands/remove_leaderboard {score:<Scoreboard_objective_name>}
Edit a LeaderBoard
This will edit the nearest leaderBoard.
/function leaderboard:commands/edit_leaderboard {score:<Scoreboard_objective_name>,max_players:<Max>,display_name:<"Display_Name">,time_mode:<0|1>,reverse_order:<0|1>,no_zero:<0|1>}
Examples
/function leaderboard:commands/add_leaderboard {score:death,max_players:4,display_name:"Number of deaths",time_mode:0,reverse_order:0,no_zero:0}
/function leaderboard:commands/add_leaderboard {score:death,max_players:5,display_name:"Number of deaths",time_mode:0,reverse_order:1,no_zero:0}
/function leaderboard:commands/add_leaderboard {score:timer,max_players:8,display_name:"Jump Time",time_mode:1,reverse_order:1,no_zero:1}
/function leaderboard:commands/remove_leaderboard {score:death}
Uninstall
/function leaderboard:commands/uninstall
(Only keeps the storage leaderboard:namelist in case you want to re-enable it)