From 45740adf936bbe1bd2787481c8acf6ea87de9c8d Mon Sep 17 00:00:00 2001 From: Local Build Date: Tue, 15 Sep 2026 17:12:30 +0000 Subject: [PATCH] fix: use world clock for HUD server time 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. --- .../java/meteordevelopment/meteorclient/utils/Utils.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/meteordevelopment/meteorclient/utils/Utils.java b/src/main/java/meteordevelopment/meteorclient/utils/Utils.java index 26c04dd5510..fd5b0fba566 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/Utils.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/Utils.java @@ -126,9 +126,10 @@ public static Vec3 getPlayerSpeed() { public static String getWorldTime() { if (mc.level == null) return "00:00"; - int ticks = (int) (mc.level.getGameTime() % 24000); - ticks += 6000; - if (ticks > 24000) ticks -= 24000; + // Since 26.1 the day/night cycle runs on World Clocks; getGameTime() is the world + // age and is unaffected by /time, so it must not be used for time of day. + long ticks = Math.floorMod(mc.level.getDefaultClockTime(), 24000L); + ticks = (ticks + 6000L) % 24000L; return String.format("%02d:%02d", ticks / 1000, (int) (ticks % 1000 / 1000.0 * 60)); }