作者:rebot | 分类:模组
Minecraft 版本: 1.21.5 1.21.6 1.21.7 1.21.8
平台: datapack
标签: library utility
(Sep 27, 2025) I found few major problems with TimeLib that make it unreliable for certain usecases. Please read through these carefully and assess for yourself whether you want to use TimeLib. Once a way is found or added by Mojang to fix these issues, I will keep supporting TimeLib again. As of me writing this, TimeLib v2.3.1 is the latest release.\
\
TimeLib is NOT permanently discontinued, it will come back once all is sorted out!\
I will post updates to the situation here, as well as the MinecraftCommands Discord server (in #resources).
Because of these issues, for TimeLib to keep working as expected, the user would need to manually confirm / adjust the date every time the world reloads. That breaks the point of TimeLib, which is why I need time to think / wait until Mojang makes it possible to mitigate these issues.
PausedTicks score that contains the number of ticks that the game has been paused/frozen for only works if at least one player is online from start to finish. If everyone leaves (doesn't have to be at the same time) while the game is frozen, or nobody was online in the first place, the stored value in PausedTicks is not reliableI will fix these issues once I get to them. In the meantime, I put them here so you're aware of them. While these are not all known issues, these are the major ones.
A Minecraft Data Pack library that lets you get the real life date & time ingame. For inquiries, please contact @silicatYT on Discord.\
\
Download: Modrinth\
Report bugs: GitHub
/tick freeze or singleplayer)TimeLib automatically keeps track of the date & time for you. For that to work, you first need to configure the settings to your personal taste. To access the settings, click the message that appears in chat after reloading, or manually run /function timelib:util/settings.
Command Block Offset: This is required to offset the time difference between the UTC timezone and your system time. If daylight savings change, this setting needs to be adjusted to ensure that the date calculation works properly.Timezone Offset: Use this to change the displayed time.The values for Year, Month, Day, Week Day, Hour, Minute, Second & the Unix Timestamp are all stored inside the player #TimeLib, with each value having its own scoreboard objective:
TimeLib.Year, TimeLib.Month, TimeLib.Day, TimeLib.WeekDay, TimeLib.Hour, TimeLib.Minute, TimeLib.Second & TimeLib.UnixTimeAdditionally, string versions (with leading 0s) of the date and daytime are stored in the timelib:date and timelib:daytime storages.
#timelib:date_changed: Function tag that gets executed whenever the date changes#timelib:daytime_changed: Function tag that gets executed whenever the daytime changes#timelib:game_unpaused: Function tag that gets executed whenever the game unpauses#TimeLib TimeLib.PausedTicks scoreboard holds the number of ticks the game has been paused forThe tickrate updates once per second and can be read from the TimeLib.Tickrate scoreboard objective.
Note: The output date & time are in the UTC timezone, as daylight savings time cannot be properly accounted for.
#TimeLib.Input TimeLib.UnixTime score as the input./function timelib:util/unix_timestamp_to_date.#TimeLib.Output TimeLib.? scores, as well as the timelib:output data storage.minecraft.custom:minecraft:total_world_time scoreboard objective, which increments every tick even while the game is paused.Additional logic is used to ensure optimal results, good performance and accuracy.
From CMDred:
29999999 29999999 in the overworld, there may be collision.#TimeLib load.status: 1 if TimeLib is installed, otherwise unset#TimeLib.Version load.status: Release-specific number/function timelib:uninstall, then replace your current TimeLib version with the new one, then /reload to install the new version/function timelib:uninstallAs per the MIT License, you are allowed to redistribute, modify and use TimeLib as long as we are credited for the original work.
请登录后举报
暂无评论,抢个沙发吧~