xiaozhi better sleep

Quick rating

Community listing page, reviews here may not be monitored by the author.

xiaozhi better sleep

No reviews yet

A server-side Minecraft mod for NeoForge that lets you customize the "sleep to skip the night" mechanic on multiplayer servers.

Mod Loaders
Minecraft

About

Description

XiaoZhi ServerSleep (xiaozhiserversleep)

A server-side Minecraft mod for NeoForge that lets you customize the "sleep to skip the night" mechanic on multiplayer servers.

What it does

  • Sleep ratio — the percentage of eligible players that must be asleep to skip the night. Default 50%; allowed values are multiples of 10 (10–100).
  • Two skip modes:
    • instant — jump straight to morning (vanilla-like).
    • accelerate — smoothly fast-forward time to morning (a visible timelapse) instead of teleporting; the speed is adjustable.
  • Eligibility counting — only counts overworld, non-spectator players, and only those who have genuinely fallen asleep (in bed long enough, matching vanilla's "closed eyes" delay).
  • Server-only — no client-side content; clients without it can still join.
  • Chinese command feedback, with tab-completion for the mode values.

Commands (requires OP level 3)

Command Description
/sleep or /sleep help Show help
/sleep ratio [10–100 multiple] View / set sleep ratio
/sleep mode [instant|accelerate] View / set skip mode
/sleep speed [multiplier] View / set acceleration speed
/sleep status Show current settings

Configuration

Server config file (auto-generated in the config/ folder):

[sleep]
    sleepPercentage = 50      # sleep ratio (multiple of 10)
    skipMode = "INSTANT"      # INSTANT or ACCELERATE
    accelerateSpeed = 5       # time ticks advanced per server tick (lower = smoother)

Command changes are written back to this file and persist across restarts.

Technical notes

  • Uses a Mixin into ServerLevel to neutralize vanilla's automatic skip-and-wake logic, then runs its own per-tick handler (ServerSleepManager) applying the configurable ratio and selected mode.
  • Runs only on the overworld.
  • The mod's version and jar name are single-sourced from gradle.properties (mod_id / mod_version / minecraft_version), producing jars like: <modid>-<modVersion>-neoforge-<gameVersion>.jar
  • Built with ModDevGradle; includes a mirror init-script so it builds even where maven.neoforged.net is blocked (e.g., mainland China).