Easily implement leaderboards into your Minecraft Java Edition project!
If you don't like to read, you can watch a video tutorial here
# Add the following command to the commands you run when your creation starts
scoreboard players set @a MCCreations.Leaderboards.Start 1
# Add the following command to the commands you run when your creation ends
scoreboard players set @a MCCreations.Leaderboards.End 1
# ------------------------------------------------------------------------------
# You can also pause the timer
scoreboard players set @a MCCreations.Leaderboards.Pause 1
# Or reset it
scoreboard players set @a MCCreations.Leaderboard.Reset 1If you are submitting your content to MCCreations, simply check "Use Leaderboards" during the submission process and this pack will automatically be added to your creation. You still need to do the setup above, however.
If you plan on uploading your creation to other sites, or want to use a file hosting service like Mediafire instead of uploading directly to MCCreations, you need to perform a few steps to setup this datapack for your use.
- Download this Github Repository
- Unzip it (if you downloaded as a zip)
- Run
node setup.js. This requires you to have nodejs installed, which you can get here - Add the datapack to your creation
The datapack also features some extra toggle options that you can choose to turn on.
By default, leaderboards will use time to score players. However, if your creation has it's own scoring system you will need to do a few things differently
- During setup, set your score type as highest_score or lowest_score
- Don't use MCCreations.Leaderboards.Start. Instead, whenever players earn score add it to MCCreations.Leaderboards.Score
- When your creation finishes, run
scoreboard players set @s MCCreations.Leaderboards.End 1You can enable a timer display in the action bar by running
scoreboard players set @a MCCreations.Leaderboards.DisplayTime 1By default, only oped players have permission to make changes to the leaderboard, like stopping or starting it. To change this, run
scoreboard players set @a MCCreations.Leaderboards.EnableTriggers 1This will allow non-op players to use the following commands, which are equivalent to the commands above:
trigger MCCreations.Leaderboards.Start
trigger MCCreations.Leaderboards.Pause
trigger MCCreations.Leaderboards.End
trigger MCCreations.Leaderboards.DisplayTimeYou can configure the datapack to be reset on reload or relog using the command
scoreboard players set .var MCCreations.Leaderboards.ResetOnReload 1This will delete all leaderboard data and scores when the pack is reloaded
By default, the maximum amount of time the leaderboard can save is 5 hrs. The timer and display will continue working past 5 hrs, however, scores will not be publishable to MCCreations. If this is not enough time for your map, you can change the MAX_TIME const in the setup.js script. However, be wary that increasing this value will exponentially increase the amount of time to generate files, as well as increase strain on the game. Values higher than 5 hrs may lag your creation.