Minecraft Data Packs / Game Mechanic

Real Time Link - Links IRL time to Minecraft

  • check_circle Advancements
  • check_circle Functions
  • check_circle Recipes
  • 6,792 views, 4 today
  • 687 downloads, 0 today
  • 131
  • 104
  • 49
Required Resource Pack
Silabear's Avatar Silabear
Site Moderator
Level 67 : High Grandmaster Bear
807
Real Time Link


This datapack links the time in your Minecraft world to your real time (if on multiplayer, the time in the server's timezone), down to the nearest minute. It is relatively optimised, using the latest features in 1.19.4 to allow parsing strings.

As opposed to other similar datapacks, this one minimises how often it does weird technical things, making it quite optimised, but there’s room for me to improve on it. You won't notice the time going by, as it updates super smoothly :D

It also adds a new item - the Digital Clock, which shows the current time in HH:MM.

IMPORTANT NOTES
This datapack only works in versions 1.19.4 and above!
This datapack only works if command blocks are enabled.
The resource pack is optional - you only need to use it if you want to use the Digital Clock item

Digital Clock
The Digital Clock shows your current time/the time of the server. It is accurate (to the time of the server) to within two seconds.
You can craft it with the recipe shown, or use the function /function give:clock

The digital clock requires the resource pack to use it, but it is not required for the real time linking, or any other features.

Time Zone Offset
If your server that the datapack is installed on is hosted in a timezone which is, say, 4 hours behind your time zone, then you can offset the time. To do this, run /scoreboard players set .TZ_OFFSET rtime offsetwhere offset is a number from -11 to 14. If the server is 4 hours behind, you would want to offset the time to be 4 hours ahead of the server, so you would set it to 4.
  • This only affects the real-time link, not the digital clock item
Thanks! Don't forget to press the diamond button :P

BearEdit | a WorldEdit datapack Minecraft Data Pack


How it works
1. I run an invalid command in a command block. The LastOutput NBT of the command block always contains the current time.
2. Using the new string parsing features in 1.19.4, I get the hour and minute from the command block and store it as two strings.
3. Every minute, I
- Get the hour, and set the current in-game time to (1000 * hour) (yep, it’s hardcoded for 24 possible values)
- Get the minute, and add on (16.6666 * minute) to the newly set in-game time.

Known Bugs (read before complaining in comments please)
- phantoms do be weird

Want a Minecraft server, with a 25% discount? Click Here!
Real Time Link - Links IRL time to Minecraft Minecraft Data Pack
CompatibilityMinecraft 1.19
Tags

3 Update Logs

1.2 : by Silabear 05/02/2023 1:51:41 pmMay 2nd, 2023

Added time zone offset option.

(this will be the last update for a while dw)
LOAD MORE LOGS

Create an account or sign in to comment.

2
04/16/2024 12:36 pm
Level 6 : Apprentice Explorer
rain_candy
rain_candy's Avatar
woooaaah i was just wondering if this existed and it does :0 amazing work !!!
3
01/19/2024 12:15 pm
Level 35 : Artisan Procrastinator
PotatoWolfie
PotatoWolfie's Avatar
3AM gaming with this.... the power is too powerful.

I MUST POSSESS IT.
3
01/03/2024 5:41 pm
Level 35 : Artisan Nerd
-sweater-
-sweater-'s Avatar
:o cool
3
12/08/2023 12:38 pm
Level 29 : Expert Lemon
LimeSpeedCrystal
LimeSpeedCrystal's Avatar
hour idk what of waiting for night to come so that I can get a zombie for an iron farm easily
3
12/08/2023 12:38 pm
Level 67 : High Grandmaster Bear
Silabear
Silabear's Avatar
lul
3
07/13/2023 3:47 pm
Level 1 : New Miner
User3567302G
User3567302G's Avatar
absolute gigachad 5 head way of getting irl time and really clean coding, thank you very much! Btw if you break the block below of the clock the display stays flowing in the air, a item frame drops (model) and a glowing item frame drops.
3
05/04/2023 12:18 pmhistory
Level 1 : New Miner
togiez
togiez's Avatar
What happens if you sleep whilst using the datapack? also is this compatible with realms?

If you can sleep, and it skips night, is there a way to disable this?
5
05/04/2023 12:23 pm
Level 67 : High Grandmaster Bear
Silabear
Silabear's Avatar
If you sleep while using the datapack, it doesn’t skip the night. 101% of people need to be sleeping, which is of course not possible.

I haven’t tested this on realms (because I don’t have a realm to test this on). If you end up testing it, lemme know if it works or not.
3
05/05/2023 12:17 pmhistory
Level 1 : New Miner
togiez
togiez's Avatar
Ended up purchasing the realm early. Turns out the 24 hour system works, but differently, Currently I'm in the UK and it was 17:14, but on the realm, it said it was 16:14.

Anyway to change the time manually? if not that's alright, its only one hour behind which is close enough to be honest.
Ill check again in a couple hours time to see if it turns night around evening.
4
05/05/2023 1:56 pm
Level 67 : High Grandmaster Bear
Silabear
Silabear's Avatar
Yep! You can offset the time zone. Since the time is one hour behind you (it’s in GMT/UTC whereas you’re in BST/UTC+1), run the command /scoreboard players set .TZ_OFFSET rtime 1 to offset the 24 hour linking by +1 hour.

Thanks for the information! I guess realms run in UTC. Useful to know :D
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome