
StayNight - Eternal Night Mod
Overview StayNight is a lightweight Minecraft mod that permanently fixes the time in your world at midnight (18000 ticks), creating an atmosphere of eternal night. The perfect solution for horror maps, vampire role-playing games, or for players who prefer the mysterious atmosphere of darkness. The mod seamlessly overrides time mechanics on both the client and server sides, maintaining eternal night.
Key Features
🌙 True Eternal Night
- All worlds remain at 18000 ticks (midnight) regardless of time commands, sleep attempts, or natural cycles
- Works in both single-player and multiplayer modes
🛡️ Complete Time Control
- Intercepts time setting logic in:
- World data (PrimaryLevelData, DerivedLevelData)
- Client/server level handlers (ClientLevel, ServerLevel)
- Network time synchronization packets (ClientboundSetTimePacket)
- Blocks all attempts to change the time of day
⚡ Zero Configuration Starts working immediately after installation - requires no configuration or commands!
🧩 Compatibility Compatible with most mods that do not directly alter time mechanics.
Technical Implementation
The mod uses bytecode manipulation to:
-
Override Time Setters
@ModifyVariable(method = "setDayTime", at = @At("HEAD"), argsOnly = true) private long stayNight(long dayTime) { return 18000L; // Always force midnight }
-
Hijack Time Getters
@Inject(method = "getDayTime", at = @At("HEAD"), cancellable = true) private void stayNight(CallbackInfoReturnable<Long> cir) { cir.setReturnValue(18000L); // Always report midnight }
-
Patch Network Synchronization Manipulates ClientboundSetTimePacket to prevent servers from overriding the eternal night.
Use Cases
- Horror and adventure maps requiring permanent darkness
- Servers for vampire and fantasy role-playing games
- Atmospheric builds showcasing night lighting
- Gameplay challenges without day-night cycles