Skip to content

Easily implement leaderboards into your Minecraft Java Edition project whether it's on MCCreations or not!

Notifications You must be signed in to change notification settings

MCCreationsOS/Java-Leaderboards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCCreations Java Leaderboards

Easily implement leaderboards into your Minecraft Java Edition project!

Setup

If you don't like to read, you can watch a video tutorial here

Setting Up Your Creation

# 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 1

When Uploading Directly to MCCreations

If 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.

When Using File Hosting or Uploading to Other Sites

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.

  1. Download this Github Repository
  2. Unzip it (if you downloaded as a zip)
  3. Run node setup.js. This requires you to have nodejs installed, which you can get here
  4. Add the datapack to your creation

Additional Setup

The datapack also features some extra toggle options that you can choose to turn on.

Custom Scoring

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

  1. During setup, set your score type as highest_score or lowest_score
  2. Don't use MCCreations.Leaderboards.Start. Instead, whenever players earn score add it to MCCreations.Leaderboards.Score
  3. When your creation finishes, run
scoreboard players set @s MCCreations.Leaderboards.End 1

Time Display

You can enable a timer display in the action bar by running

scoreboard players set @a MCCreations.Leaderboards.DisplayTime 1

Allow Non-OPs to Control the Leaderboard

By 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 1

This 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.DisplayTime

Reset on Reload

You can configure the datapack to be reset on reload or relog using the command

scoreboard players set .var MCCreations.Leaderboards.ResetOnReload 1

This will delete all leaderboard data and scores when the pack is reloaded

Caveats

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.

About

Easily implement leaderboards into your Minecraft Java Edition project whether it's on MCCreations or not!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published