- check_circle Functions
Published Apr 4th, 2023, 4/4/23 10:45 am
- 1,925 views, 9 today
- 153 downloads, 0 today
1
I already made a datapack to display the real date in minecraft , so why not also the time.
This time a lot simpler because its uses nothing external.
It will display your time if you play in singe player.
If you play on a server, it will show the internal server time. This may be different to yours, depending on where you are located and where the server is located.
What make it better than others?
The idea is not original from me, so yes there are already other datapacks doing the same thing. But this datapack is more Lightweight than the ones I found.
Long form:
The datapacks I found uses a 32 MB big loot table and look for every possible commandblock output (this is where the time comes from) and then give the correct score. This Datapack separate the string before looking through, so I only have to check for 144 possible results. So I come to a file size of about 13 KB. (And I don't even use loot tables yet)
Functions
Display as actionbar title:
The datapack make it possible to display the time in the actionbar title. To toggle that you can use
get time as string:
If you don't need the time necessary as a score or int, you should use the string. It will be saved in the data storage "rltime:time" there are three objects. "hour", "minute" and "second" each contains the string of the hour, minute or second.
get time as scoreboard score
If you need it as a score, you can get it from the "rltime" scoreboard. There are three players. "%hour", "%minute" and "%second" each has the hour, minute or second as score.
Uninstall datapack
This time a lot simpler because its uses nothing external.
It will display your time if you play in singe player.
If you play on a server, it will show the internal server time. This may be different to yours, depending on where you are located and where the server is located.
What make it better than others?
The idea is not original from me, so yes there are already other datapacks doing the same thing. But this datapack is more Lightweight than the ones I found.
Long form:
The datapacks I found uses a 32 MB big loot table and look for every possible commandblock output (this is where the time comes from) and then give the correct score. This Datapack separate the string before looking through, so I only have to check for 144 possible results. So I come to a file size of about 13 KB. (And I don't even use loot tables yet)
Functions
Display as actionbar title:
The datapack make it possible to display the time in the actionbar title. To toggle that you can use
/trigger displayActionbar
get time as string:
If you don't need the time necessary as a score or int, you should use the string. It will be saved in the data storage "rltime:time" there are three objects. "hour", "minute" and "second" each contains the string of the hour, minute or second.
/data get storage rltime:time <hour or minute or second>
get time as scoreboard score
If you need it as a score, you can get it from the "rltime" scoreboard. There are three players. "%hour", "%minute" and "%second" each has the hour, minute or second as score.
/scoreboard players get <%hour or %minute or %second> rltime
To reduce unnecessary performance issues, you need to update it manually with /function rltime:toscoreboard/<all or hour or minute or second>
Uninstall datapack
/function rltime:uninstall
this will remove everything the datapack did.Compatibility | Minecraft 1.19 |
Tags |
5902816
119
Create an account or sign in to comment.
So I'm gonna run your data pack, I just adjusted the values in the hour.mcfunction to correct and run a scheduled task to get a display of the time :)
I saw you can remove a line in there btw, the one that check for 24.