Skip to content

fix: use world clock for HUD time display on 26.1+ - #6666

Open
Promptt001 wants to merge 1 commit into
MeteorDevelopment:masterfrom
Promptt001:fix/world-clock-time-hud
Open

Promptt001 wants to merge 1 commit into
MeteorDevelopment:masterfrom
Promptt001:fix/world-clock-time-hud

Conversation

@Promptt001

@Promptt001 Promptt001 commented Sep 15, 2026

Copy link
Copy Markdown

Summary

Fixes #6667.

Since Minecraft 26.1, the day/night cycle and /time operate on data-driven World Clocks, while Level#getGameTime() is the world/simulation age and is explicitly unaffected by /time changes. Utils#getWorldTime() was formatting the world-age counter as time of day, so the HUD {time} value (e.g. Info HUD "Server time") behaved like an independent clock that never reacted to /time set.

Changes

  • Utils#getWorldTime() now reads the dimension's default World Clock (Level#getDefaultClockTime()) — the same clock /time targets when no explicit clock is given — instead of Level#getGameTime().
  • Normalization rewritten with Math.floorMod + modulo wrap, which also fixes the old if (ticks > 24000) ticks -= 24000; edge case at exactly 24000 ticks and is safe for negative clock values.
  • One method, one file, no unrelated changes.

Testing

  • Compiles cleanly against Minecraft 26.2 (project Gradle wrapper, JDK 25, Fabric Loader 0.19.3, Fabric API 0.154.2+26.2).
  • Validated in-game on a Paper 26.2 server (Meteor 26.2 Move to brigadier for commands #23): the HUD now immediately follows /time set day|noon|night|midnight and matches the visible day/night cycle, clock items, and daylight detectors, where the pre-patch build did not.

Design note

Level#getDefaultClockTime() is dimension-aware: a dimension whose default clock is not a standard 24,000-tick day (custom datapack clocks) may not render meaningfully as HH:MM. If "Overworld time everywhere" is the intended semantic, Level#getOverworldClockTime() is the alternative — happy to switch if maintainers prefer that.

Minecraft 26.1 moved day/night time to World Clocks. The existing
getWorldTime implementation formats Level#getGameTime, which is world
age and is unaffected by /time changes.

Use the dimension's default World Clock instead so the HUD follows the
actual day/night cycle.
@crosby-moe

Copy link
Copy Markdown
Collaborator

fyi your git config is set up wrong

@Promptt001

Promptt001 commented Sep 16, 2026

Copy link
Copy Markdown
Author

fyi your git config is set up wrong

did i leak something or are you talking about me leaving user.name and user.email unset?

@Merennor

Copy link
Copy Markdown

did i leak something or are you talking about me leaving user.name and user.email unset?

author "Local Build" committed 17 hours ago
^ is missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HUD time display ({time} / server time) uses gameTime (world age) instead of World Clock on 26.1+

3 participants