☀️ 自定义昼夜模组 ?
完全掌控 Minecraft 的昼夜循环 —— 无需安装客户端模组。
一款轻量级的 仅服务端 Fabric 模组,允许你自定义主世界中白天和黑夜的具体持续时间。无论是想在阳光下进行马拉松式的建造,还是体验短暂而激烈的夜晚——这款模组都能让你轻松实现。
✨ 功能特性
- 两种自定义方式 — 使用速度倍率 或 设置基于刻(ticks)的确切时长
- 交互式聊天菜单 — 在聊天中点击按钮即可实时调整设置,无需客户端模组
- 实时时长预览 — 菜单会以人类可读的时间格式显示调整后的白天、黑夜及完整周期的长度
- 配置热重载 — 即时更改设置,无需重启服务器
- 保存与恢复默认值 — 将更改持久化到磁盘,或一键重置所有内容
- 安全限制 — 数值会被限制在安全范围内,以防止服务器崩溃
- 游戏内命令 — 通过聊天检查状态、重载配置、设置数值以及切换日志记录
- 带版本戳的日志 — 所有控制台和聊天消息均包含模组名称和版本号
- 兼容原版客户端 — 玩家无需安装任何额外内容
- 零世界数据变更 — 随时添加或移除,安全可靠
? 快速上手
- 将模组
.jar 文件放入服务器的 mods/ 文件夹中(需要 Fabric Loader 和 Fabric API)。
- 启动服务器 —— 会自动生成一个默认配置文件。
- 在游戏中运行
/customdaynight —— 交互式设置菜单 会打印在聊天栏中。按 T 打开聊天窗口,然后点击任意按钮并按 Enter 应用。
- 或者,直接编辑
config/customdaynightmod.properties(见下文)。
- 在菜单中点击 [Save](然后按 Enter)以将更改持久化到磁盘。
⚙️ 配置说明
文件: config/customdaynightmod.properties
# 速度倍率 (1.0 = 正常速度, 0.5 = 半速 / 时间加倍)
day_multiplier=1.0
night_multiplier=1.0
# 绝对时长(单位:刻),当值 > 0 时会覆盖倍率设置
absolute_day_length=0
absolute_night_length=0
# 向日夜转换时向服务器控制台输出日志
log_phase_changes=true
快速参考: 1 Minecraft 刻 = 50 毫秒 · 20 刻 = 1 秒 · 12,000 刻 = 10 真实分钟(白天和黑夜的默认长度)。
工作原理
| 设置项 |
作用 |
day_multiplier / night_multiplier |
缩放时间流逝的速度。值为 0.5 会使该阶段持续两倍长;2.0 则使其快两倍。 |
absolute_day_length / absolute_night_length |
将阶段持续时间设置为精确的刻数(ticks)。当设为大于 0 的值时,此项优先级高于倍增器。 |
log_phase_changes |
当为 true 时,每次世界在白天与黑夜之间转换时,都会在服务器控制台中打印一条消息。 |
⚠️ 安全限制
为防止服务器不稳定,所有值都会自动限制在安全范围内:
| 设置项 |
最小值 |
最大值 |
备注 |
day_multiplier / night_multiplier |
0.01 |
100.0 |
防止时间冻结或极端加速 |
absolute_day_length / absolute_night_length |
20 ticks (1 s) |
2,400,000 ticks (~33 h 20 m) |
设为 0 可禁用(改用倍增器) |
如果通过命令或配置文件输入了超出允许范围的值,它会被静默截断,并在聊天栏中显示警告信息。
? 示例
示例 1:延长白天以供建造者使用(白天 50 分钟 / 夜晚 10 分钟)
absolute_day_length=60000
absolute_night_length=12000
☀️ 白天持续 50 分钟(60,000 ticks)——有充足的时间进行建造。
? 夜晚持续 10 分钟(12,000 ticks)——标准时长。
示例 2:仅放慢白天速度(白天 20 分钟 / 夜晚 10 分钟)
day_multiplier=0.5
night_multiplier=1.0
| 阶段 |
默认值 |
使用此配置后 |
| ☀️ 白天 |
10 min |
20 min(速度减半 → 时长加倍) |
| ? 夜晚 |
10 min |
10 min(保持不变) |
提示: 你可以混合搭配使用——例如,使用 absolute_day_length 来设定精确的白天时长,同时使用 night_multiplier 来缩放夜晚时长。
? 命令
所有命令都需要 操作权限等级 4(完整管理员权限)。
交互式菜单
| 命令 |
描述 |
/customdaynight |
打开交互式设置菜单(等同于 /customdaynight menu) |
/customdaynight menu |
打开交互式设置菜单 |
菜单会显示所有当前设置,分为速度倍增器和固定长度(覆盖)两组。每一行都有预填目标命令到聊天栏的 [−] 和 [+] 按钮,以及一个预填空白值供输入的 [✎] 按钮。操作按钮 [Save]、[Reload] 和 [Defaults] 也是同样的工作方式。点击按钮后按 Enter 即可应用。
更倾向于使用分钟而非刻数? 请使用 /customdaynight duration day <minutes> 或 /customdaynight duration night <minutes> —— 支持小数(例如 12.5)。
为什么不能一键完成? 原版客户端在每次点击 run_command 时都会弹出“确认命令执行”对话框,且需要操作者权限。预先填充聊天栏可以避免该弹窗,让操作流程更流畅:点击 → 回车。
悬停于任意值上即可查看其含义及允许的范围。当固定长度设置为 0 时,会显示为关闭,此时由上方的乘数控制该阶段。
底部的持续时间摘要显示了有效的白天、黑夜和完整周期的时长(例如 ☀ 白天: 10m 0s · ☽ 黑夜: 10m 0s · ⏱ 完整周期: 20m 0s)。
提示: 按 T 打开聊天栏,点击任意按钮,然后按 Enter。
配置命令
| 命令 |
描述 |
/customdaynight duration day <minutes> |
设置白天阶段的长度(以实时分钟为单位)(接受小数,例如 12.5)。底层使用固定长度。 |
/customdaynight duration night <minutes> |
设置黑夜阶段的长度(以实时分钟为单位)。 |
/customdaynight set dayMultiplier <value> |
设置白天速度倍率 |
/customdaynight set nightMultiplier <value> |
设置黑夜速度倍率 |
/customdaynight set absoluteDayLength <value> |
设置绝对白天长度(以刻为单位)(0 表示禁用) |
/customdaynight set absoluteNightLength <value> |
设置绝对黑夜长度(以刻为单位)(0 表示禁用) |
实用命令
| 命令 |
描述 |
/customdaynight reload |
从磁盘重新加载配置文件(丢弃未保存的更改) |
/customdaynight save |
将当前内存中的设置保存到配置文件 |
/customdaynight defaults |
将所有设置重置为默认值(不保存到磁盘) |
/customdaynight status |
显示当前设置菜单 |
/customdaynight togglePhaseLogging |
切换白天/黑夜过渡消息的显示或隐藏 |
? 链接
? 许可证
本项目根据 MIT 许可证 授权。
☀️ Custom Day/Night Mod ?
Take full control of Minecraft's day/night cycle — no client mod needed.
A lightweight, server-side only Fabric mod for Minecraft that lets you customize exactly how long day and night last in the Overworld. Whether you want marathon building sessions under the sun or short, intense nights — this mod makes it effortless.
✨ Features
- Two ways to customize — use speed multipliers or set exact tick-based durations
- Interactive chat menu — click buttons in chat to adjust settings live, no client mod required
- Live duration preview — the menu shows the resulting day, night, and full cycle lengths in human-readable time
- Hot-reload config — change settings on the fly without restarting the server
- Save & restore defaults — persist changes to disk or reset everything with one click
- Safety limits — values are clamped to safe ranges to prevent server crashes
- In-game commands — check status, reload config, set values, and toggle logging from the chat
- Version-stamped logging — all console and chat messages include the mod name and version
- Vanilla-client friendly — players don't need to install anything
- Zero world data changes — safe to add or remove at any time
? Getting Started
- Drop the mod
.jar into your server's mods/ folder (requires Fabric Loader and Fabric API).
- Start the server — a default config file will be created automatically.
- Run
/customdaynight in-game — the interactive settings menu prints in chat. Press T to open chat, then click any button and press Enter to apply.
- Alternatively, edit
config/customdaynightmod.properties directly (see below).
- Click [Save] in the menu (then Enter) to persist changes to disk.
⚙️ Configuration
File: config/customdaynightmod.properties
# Speed multipliers (1.0 = normal speed, 0.5 = half speed / twice as long)
day_multiplier=1.0
night_multiplier=1.0
# Absolute lengths in ticks (overrides multipliers when > 0)
absolute_day_length=0
absolute_night_length=0
# Log day/night transitions to the server console
log_phase_changes=true
Quick reference: 1 Minecraft tick = 50 ms · 20 ticks = 1 second · 12,000 ticks = 10 real-time minutes (the default length of both day and night).
How it works
| Setting |
What it does |
day_multiplier / night_multiplier |
Scales the speed of time progression. A value of 0.5 makes that phase last twice as long; 2.0 makes it twice as fast. |
absolute_day_length / absolute_night_length |
Sets the phase duration to an exact number of ticks. When set to a value greater than 0, this takes priority over the multiplier. |
log_phase_changes |
When true, prints a message to the server console each time the world transitions between day and night. |
⚠️ Safety Limits
To prevent server instability, all values are automatically clamped to safe ranges:
| Setting |
Min |
Max |
Notes |
day_multiplier / night_multiplier |
0.01 |
100.0 |
Prevents time freeze or extreme speed |
absolute_day_length / absolute_night_length |
20 ticks (1 s) |
2,400,000 ticks (~33 h 20 m) |
Set to 0 to disable (use multiplier instead) |
If a value outside the allowed range is entered via command or config file, it is silently clamped and a warning is shown in chat.
? Examples
Example 1: Extended day for builders (50 min day / 10 min night)
absolute_day_length=60000
absolute_night_length=12000
☀️ Day lasts 50 minutes (60,000 ticks) — plenty of time to build.
? Night lasts 10 minutes (12,000 ticks) — standard length.
Example 2: Slow down daytime only (20 min day / 10 min night)
day_multiplier=0.5
night_multiplier=1.0
| Phase |
Default |
With this config |
| ☀️ Day |
10 min |
20 min (half speed → twice as long) |
| ? Night |
10 min |
10 min (unchanged) |
Tip: You can mix and match — for example, use absolute_day_length for a precise daytime duration while using night_multiplier to scale the night.
? Commands
All commands require operator permission level 4 (full ops).
Interactive Menu
| Command |
Description |
/customdaynight |
Open the interactive settings menu (same as /customdaynight menu) |
/customdaynight menu |
Open the interactive settings menu |
The menu displays all current settings, grouped into Speed multipliers and Fixed lengths (override). Each row has clickable [−] and [+] buttons that pre-fill the target command in your chat bar, plus a [✎] button that pre-fills a blank value for typing. Action buttons [Save], [Reload], and [Defaults] work the same way. Click a button, then press Enter to apply.
Prefer minutes over ticks? Use /customdaynight duration day <minutes> or /customdaynight duration night <minutes> — accepts decimals (e.g. 12.5).
Why not one-click? Vanilla clients show a "Confirm Command Execution" dialog on every run_command click that requires operator permissions. Pre-filling the chat bar avoids that popup and keeps the workflow snappy: click → Enter.
Hover any value to see what it means and its allowed range. Fixed lengths display OFF when set to 0, meaning the multiplier above controls that phase instead.
A duration summary at the bottom shows the effective day, night, and full cycle lengths (e.g. ☀ Day: 10m 0s · ☽ Night: 10m 0s · ⏱ Full Cycle: 20m 0s).
Tip: Press T to open chat, click any button, then press Enter.
Configuration Commands
| Command |
Description |
/customdaynight duration day <minutes> |
Set the day phase length in real-time minutes (accepts decimals, e.g. 12.5). Uses fixed length under the hood. |
/customdaynight duration night <minutes> |
Set the night phase length in real-time minutes. |
/customdaynight set dayMultiplier <value> |
Set the day speed multiplier |
/customdaynight set nightMultiplier <value> |
Set the night speed multiplier |
/customdaynight set absoluteDayLength <value> |
Set the absolute day length in ticks (0 to disable) |
/customdaynight set absoluteNightLength <value> |
Set the absolute night length in ticks (0 to disable) |
Utility Commands
| Command |
Description |
/customdaynight reload |
Reload the config file from disk (discards unsaved changes) |
/customdaynight save |
Save the current in-memory settings to the config file |
/customdaynight defaults |
Reset all settings to default values (does not save to disk) |
/customdaynight status |
Display the current settings menu |
/customdaynight togglePhaseLogging |
Toggle day/night transition messages on or off |
? Links
? License
This project is licensed under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧