kamus3883

make me a minecraft mod for fabric 26.1.2 that lets me make it daytime for me and it would also remove rain ect when switching to daytime. This is mainly for a multiplayer server so it would it would appear as daytime but it would still actually be ,nighttime and if it were raining, then it would actually be raining for others.

Kodari AI
KodariJun 26 at 8:20 pm 2

I’ll create a client-side Fabric mod that lets you see daytime and clear weather on multiplayer servers while the actual server state remains unchanged for others.

PersonalDaylight
A client-side Fabric mod that lets you toggle personal daytime on multiplayer servers. Press F6 to make the world render as daytime with clear weather just for you — other players continue seeing the actual server time and rain. Uses mixins to override time-of-day, rain, and thunder rendering client-side only. No server-side installation required.

All 9 files created. Here’s what the mod does:

How it works:

  • Press F6 to toggle personal daylight on/off (configurable in Controls menu)

  • When enabled, the client overrides 5 World methods via mixin — all applied only client-side (declared in mixins.json client array)

  • getTimeOfDay() → returns 1000L (dawn/morning) instead of server time

  • isRaining() / isThundering() → return false

  • getRainGradient() / getThunderGradient() → return 0.0f

  • Toggle state persists across sessions (saved to .minecraft/config/personaldaylight.json)

  • Other players on the server see the real server time and weather unaffected

To build: run gradlew build inside the project folder. Place the JAR from build/libs/ into your .minecraft/mods/ folder on the client.

Kodari can make mistakes. Review important code before using.
Files
PersonalDaylight
Code
9 239
PersonalDaylight/src/main/java/com/personaldaylight/PersonalDaylightMod.java
package com.personaldaylight;

import com.personaldaylight.config.ModConfig;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;
import org.lwjgl.glfw.GLFW;

public class PersonalDaylightMod implements ClientModInitializer {
    private static boolean enabled = false;

    public static boolean isEnabled() {
        return enabled;
    }

    public static void toggle() {
        enabled = !enabled;
        ModConfig.save(enabled);
    }

    @Override
    public void onInitializeClient() {
        enabled = ModConfig.load();

        KeyBinding toggleKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.personaldaylight.toggle",
                InputUtil.Type.KEYSYM,
                GLFW.GLFW_KEY_F6,
                "category.personaldaylight"
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (toggleKey.wasPressed()) {
                toggle();
                if (client.player != null) {
                    client.player.sendMessage(
                            Text.literal("§7[§ePersonalDaylight§7] " +
                                    (enabled ? "§aEnabled" : "§cDisabled")),
                            false
                    );
                }
            }
        });
    }
}