Load Existing Playtime

Load Existing Playtime

If you want to preserve the playtime you and your friends have accumulated before installing the datapack, you can do so by using the following command:

/scoreboard players set <player> playtime_ticks <value>

The datapack will then automatically count faster (20x) to catch up with the playtime you have set.

Speeding Up the Process

As this might be too slow for very high playtimes, so I would suggest calculating the time in hours and then adding the remainder in ticks.

  1. Calculate the playtime in hours: playtime_hours = playtime_ticks / 72000
    • This is because there are 72000 ticks in an hour.
    • It will probably result in a floating-point number.
    • You then need to round this number down as Minecraft scoreboards don’t support floating-point numbers.
    • Now add the rounded result to your playtime_hours scoreboard.
  2. Calculate the remainder in ticks: playtime_ticks = playtime_ticks % 72000
    • This will result in the remaining ticks that need to be added to the playtime_ticks scoreboard.
    • Add this value to the playtime_ticks scoreboard.

Where to Find Your Playtime

If you are not sure where to find your playtime, you can do so by following the steps below. The process is slightly different for singleplayer and multiplayer worlds, so make sure to follow the correct steps.

Singleplayer

  1. Open your world saves location.
    • On Linux your worlds are saved at ~/.minecraft/saves/.
    • On Windows they are located at %appdata%\.minecraft\saves\.
  2. Then navigate to the world folder you want to set the playtime for.
  3. Once you are in the world folder, navigate to the stats folder where you can find a file named <guid>.json.
  4. Open this file with a text editor and search for the minecraft:play_time entry.
  5. Copy this value and use the scoreboard command mentioned above to set your playtime.

Multiplayer

  1. Locate your server’s world folder.
  2. Navigate to the ‘stats’ folder where you will find files named <guid>.json for each player that has ever visited your server.
  3. Open the file of the player you want to set the playtime for with a text editor.
  4. Search for the minecraft:play_time entry.
  5. Copy this value and use the scoreboard command mentioned above to set your playtime.