Skip to content

fix night/day - #400

Merged
John-Paul-R merged 1 commit into
John-Paul-R:26.xfrom
arnokeesman:fix/time-commands
Aug 31, 2026
Merged

fix night/day#400
John-Paul-R merged 1 commit into
John-Paul-R:26.xfrom
arnokeesman:fix/time-commands

Conversation

@arnokeesman

Copy link
Copy Markdown
Contributor

guess finding a Long with a similar enough name wasn't good enough while updating

@John-Paul-R

Copy link
Copy Markdown
Owner

Whoopsies. New interface is nice though!

@John-Paul-R
John-Paul-R merged commit ea7337d into John-Paul-R:26.x Aug 31, 2026
1 check passed
@John-Paul-R

Copy link
Copy Markdown
Owner

Todo: double check time set day behavior

@arnokeesman

arnokeesman commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

net.minecraft.server.commands.TimeCommand#setTimeToTimeMarker (https://mcsrc.dev/2/26.2/net/minecraft/server/commands/TimeCommand#L194-202)

    private static int setTimeToTimeMarker(final CommandSourceStack source, final Holder<WorldClock> clock, final ResourceKey<ClockTimeMarker> timeMarkerId) throws CommandSyntaxException {
        ServerClockManager clockManager = source.getServer().clockManager();
        if (!clockManager.moveToTimeMarker(clock, timeMarkerId)) {
            throw ERROR_NO_TIME_MARKER_FOUND.create(clock.getRegisteredName(), timeMarkerId);
        } else {
            source.sendSuccess(() -> Component.translatable("commands.time.set.time_marker", new Object[]{clock.getRegisteredName(), timeMarkerId.identifier().toString()}), true);
            return wrapTime(clockManager.getTotalTicks(clock));
        }
    }

I mostly stole the code from vanilla sleeping as this command exists to advance time, not reset it to the first day, like /time set did, in the past at least
seeing this new /time code, and checking ingame, this now also advanced time, lets just delete these commands

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.

2 participants