Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
PLS READ THIS
How to use
Commands
do in game:/function highscore:leaderboard/copy.example
to get access to all of the commands that you can do.
Summoning
Please note that you can summon multiple leaderboards in the worlds even with the same score name. However thier stats wont transfer from one to the other.As of right now, there are two summoning commands
summon_10 (Always summon 10 slots to the leaderboard)
summon (allows you to customize the amount of slots in the leaderboard)
example for summon_10:
/function highscore:leaderboard/summon_10 {"score":"deaths",billboard:"center","toptolow":1,"format":"default"}
example for summon:
function highscore:leaderboard/summon {"score":"deaths",billboard:"center","toptolow":1,"format":"default","slots":5}
the macros and what they do
-
the format will control how the leaderboard will look (there are 2 options format1 (clean version) and default (a bit customized version) You can also add your own formats (see formats in order to learn how)) example: ,"format":"format1"
-
if you change the function to be "/function highscore:leaderboard/summon" then there is a another macro you gotta add "slots" and right after the amount of slots you want the leaderboard to have example: ,"slots":5
-
billboard, changes how the leaderboard faces the players see minecraft wiki, billboard NBT tag for display entities but basically "center" means always faces the player, "horizontal" faces the player in the vertical plane, "vertical" faces the player in the horizontal plane, "fixed" always faces the same direction example: ,"billboard":"fixed"
-
score, this determines what score this leaderboard is gonna grab from the player so if it will be kills, for example, it will grab how much kills the player has in the "kills" scoreboard objective. for example: ,"score":"kills"
-
toptolow, this determines if the leaderboard sort this via highest (top of the leaderboard to low (lowest on the leaderboard) or low to highest (same thing as the other but oppesite)
for example if you want to sort the scores via highest to low you gotta do: ,"toptolow":1 . and if you want it to sort via lowest to highest you gotta do: ,"toptolow":0 .
Kill leaderboards
there three commands to killing a leaderboard:1
/function highscore:leaderboard/kill.all
Kills all leaderboards in the world.
2
/function highscore:leaderboard/kill.nearest
Kills the nearest leaderboard to you
3
/function highscore:leaderboard/kill.score {"score":"deaths"}
Kills all leaderboards with the same score name
adding player's to the leaderboard
- in order to add a player:
/function highscore:add_player/start {"score":"deaths"}
You gotta run this function as the player and this will add the player to every single leaderboard that has the same "score" name (this also controls from what scoreboard objective it will grab from) so if its {"score":"deaths"} this will grab your scoreboard objective of "deaths" to leaderboard that have the same "score" name.
- in order to add fake players you can do:
/execute at @s as @n[tag=leaderboard.marker] at @s run function highscore:parts/orginize1/start {"name":"#nothing","score":"deaths","score_num":1}
the name will be the fake player's name so if you want to change the name to be brain you gotta change "name":"#nothing", to be "name":"brain",
score controls the score it aint needed (i think) but just make things clearer for example: ,"score": "kills" for the leaderboard kills
score num determines thier score, for example: ,"score_num": 1
*Please note that this will only add the score to the closest leadeboard if you want a certain leaderboard to run this then you gotta run the function below as it *also, if you want it to sort for lowest to highest then change the function name to
function highscore:parts/orginize2/start <macroes here>
- in order to make players automaticlly add thier own score you gotta do: you gotta run in your tick.mcfunction (or main.mcfunction or a repeating command block) as the players (@a) the next command:
execute unless score @s z.leaderboard.copy.<score name here> = @s <score name here> run function highscore:refresh_score/sync_init {"score":"<score name here>","score1":"z.leaderboard.<score name here>"}
this will refresh the player into every leaderboard with the same score name. and just replace <score name here> with your score's name.
*please note that in the function "highscore:player_tick", 4th line, there is one for deaths (if you are struggling to get your own working or just dont want deaths to refresh every tick).
*also this will only refresh once your score has been changed (to save on preformance).
in version 1.02 the command has been shortend to:
execute unless score @s z.leaderboard.copy.<score name here> = @s <score name here> run function highscore:refresh_score/sync_init {"score":"<score name here>"}
format
in the load.mcfunction function near the end you will see the commands that add to a storage called leaderboard:formats in order to add your own formats you can copy paste the example_format and change the name of sub storage (idk what its called)once, you made your format, in the summoning command change the format to be name of the sub storage of the new storage you made. for example if u made a new format called "format_here". then in the summoning command -> format do ,"format":"format_here"}
now about the format's settings,
if you have v1.02 installed then you will able to change if the leaderboard will show players with a score of 0 or not, 1 means it wont show players with a score of 0 and 0 means it will show with the key " remove_0s "
example: " remove_0s:0 "
text_color, will control the color, boldness and italic of the title (edited just like a json text). also i think if you add a new field "text" it will overwrite the original text
example: " text_color:',"color":"blue"}' " -> will make the title blue
spacing, controls the character before each number, so before the slot number you can change what it will be
example: " spacing: '{"text":"→ ","color":"white"}' "
numbers, this field has two things:
1 default, what json format the leaderboard's numbers slots will default to
example: " default:',"color":"white"}'\ "
2 overrides, will make exception json format for spesific slots in that list you add 2 items that has two keys: num, the slot number that it will make the exception for and text the json format exception it will do.
example: " {num:1,"text":',"color":"red","bold":true}'} "
each json format needs to end with " }' " and start with " , " (except for spacing which cant have a , in the beggining)
Clearing leaderboard
You gotta run those **AS THE LEADERBOARD MARKER** which has the tag "leaderboard.marker" "execute as @e[tag=leaderboard.marker,type=marker] run ..." then if you want to clear the entire leaderboard do <as the the marker>function highscore:clear/clear_all
or if you want to remove a specific slot do:
function highscore:clear/clear_id {"id":1}
while the id number will control the slot's id so if you changed it to be 2 then it will remove whoever in slot 2 and shift everything back together.
If you have version 1.02 installed then there is a new clearing command "clear_zero" which just removes all slots that have the score of 0
function highscore:clear/clear_zero
Limitations
The leaderboard api DOESN'T support multiple score numbers, so you can't make it show time like this: 00:00:00.00 (probobly add a way to do it in the future You cant realy tp the leaderboard, you gotta respawn it. The data of the leaderboard doesnt save if you summon a new one (with the same score) it wony copy to the other, so you gotta manually paste them to the other leaderboard (I'm sorry) only for the slots that are visible you dont need for every player. you can use this command to paste them (btw fake player and player in the leaderboard itself are the same thing so it can overwrite normal player's score)./execute at @s as @n[tag=leaderboard.marker] at @s run function highscore:parts/orginize1/start {"name":"#nothing","score":"deaths","score_num":1}
If you change the player's score or fake player score to be lower in a leaderboard that is sorting from highest to lowest it will stay on the same slot even though it has a lower then the player's score in the slot before.
Grab data from the leaderboard
if you want to get the full list of the leaderboard then do:data get entity @n[type=minecraft:marker,tag=leaderboard.marker] data.score_list
or if you want from a specific slot then do
data get entity @n[type=minecraft:marker,tag=leaderboard.marker] data.score_list[{id:3}]
then add a . and a key word of what u value u want to grab so for example if u want to get the score number of the highest player then do:
data get entity @n[type=minecraft:marker,tag=leaderboard.marker] data.score_list[{id:1}].score_num
Credits
-
mr_II - creator of this api.
-
Phoenic - contributed the code for removing 0s
hope this is enough, if you still need help feel free to contact me on discord @mr_ii and I'll try my best.