☽ Overnight
让你的夜晚变得有意义。
一款 Minecraft Fabric 模组和数据包,能在玩家睡觉时加速作物、树木和动物的生长。
? 描述
Overnight 让在 Minecraft 中睡觉真正变得有意义。你不再只是跳过夜晚,而是在休息期间,你的作物、树苗和小动物会继续生长——仿佛时间真的流逝了。
工作原理
- 植物与树木:当玩家睡觉时,
randomTickSpeed(随机刻速度)会暂时乘以你配置的速率(默认为 100倍),导致所有作物、树苗、甘蔗、仙人掌、竹子、下界疣和其他植被在短暂的睡眠窗口内迅速生长。
- 动物:小动物的
Age(年龄)标签会在睡眠期间的每个刻被加速,使它们更快地成长为成年动物(默认为 100倍,但默认情况下已禁用)。
- 防火安全:在睡眠加速期间,
doFireTick(火焰刻)会自动禁用,并在玩家醒来时恢复,以防止意外的火势蔓延。
- 干净的回退:如果服务器在睡眠过程中重新加载(
/reload),原始的游戏规则会自动恢复。
受植物生长影响的范围
所有使用随机刻的植物,包括:
| 类别 |
示例 |
| 作物 |
小麦、胡萝卜、马铃薯、甜菜根、西瓜/南瓜藤蔓 |
| 树木 |
所有树苗类型(橡树、白桦、云杉、丛林、金合欢、深色橡木、樱花、红树林、苍白橡木) |
| 高大植物 |
甘蔗、仙人掌、竹子、海带、藤蔓、滴水叶尖 |
| 其他 |
下界疣、可可豆、甜浆果、紫颂植物、蘑菇 |
受动物生长影响的范围
#overnight:growable_animals 标签中的所有可繁殖的小动物:
牛、哞菇、绵羊、猪、鸡、马、驴、骡、骆驼、兔子、狐狸、海龟、熊猫、北极熊、狼、猫、豹猫、山羊、美西螈、骆驼、嗅探兽、蜜蜂、猪灵、炽足兽、村民
你可以通过创建自己的 data/overnight/tags/entity_types/growable_animals.json 覆盖文件来自定义此列表。
? 安装
Fabric 模组
- 确保你已为 Minecraft
1.21.4(快照 26.1.2 版本)安装了 Fabric 加载器 和 Fabric API。
- 从 Modrinth 下载
.jar 文件。
- 将文件放入你的
.minecraft/mods/ 目录(用于单人游戏)或 <服务器目录>/mods/(用于服务器)。
- 启动游戏。
数据包
- 下载数据包的
.zip 文件。
- 单人游戏:将
.zip 文件放入以下路径:
.minecraft/saves/<你的世界>/datapacks/
- 服务器:将
.zip 文件放入以下路径:
<服务器目录>/world/datapacks/
- 在控制台或游戏中运行
/reload(或者重启世界/服务器)。
⚙️ 配置
Fabric 模组命令
该 Fabric 模组提供了一个专用的 /overnight 命令(需要 OP/管理员等级 2 权限):
| 命令 |
描述 |
/overnight status |
查看当前的配置状态和倍率 |
/overnight toggle plants |
切换植物与树木生长加速功能 |
/overnight toggle mobs |
切换动物生长加速功能 |
/overnight rate plants <value> |
设置植物生长速率倍率(例如:/overnight rate plants 200) |
/overnight rate mobs <value> |
设置动物生长速率倍率(例如:/overnight rate mobs 50) |
数据包命令
该数据包版本使用 /function 命令,并提供了交互式聊天菜单:
| 命令 |
描述 |
/function overnight:config/menu |
打开交互式配置菜单 |
/function overnight:config/toggle_plants |
切换植物与树木生长加速 |
/function overnight:config/toggle_mobs |
切换动物生长加速 |
/function overnight:config/set_plant_rate {rate:N} |
设置植物生长倍率(例如 {rate:200}) |
/function overnight:config/set_mob_rate {rate:N} |
设置动物生长倍率(例如 {rate:50}) |
默认设置
| 设置项 |
默认值 |
描述 |
| 植物与树木 |
开启 |
在睡眠期间加速作物/树苗生长 |
| 动物生长 |
关闭 |
在睡眠期间加速幼年动物生长 |
| 植物速率 |
100x |
应用于植物生长的倍率 / randomTickSpeed |
| 动物速率 |
100x |
应用于幼年动物年龄增长的倍率 |
速率指南
| 速率 |
效果 |
推荐用于 |
| 50x |
适度的生长加速 |
希望获得轻微增益的生存纯粹主义者 |
| 100x |
每次睡眠后获得约一整夜的生长量 |
默认值——适合大多数玩家,平衡性最佳 |
| 200x |
显著加速 |
希望看到明显夜间进度的玩家 |
| 500x |
极端加速 |
创造模式/测试用途(可能导致短暂卡顿) |
? 技术详情
架构
- 睡眠检测:每刻通过一个高效的选择器轮询
SleepTimer NBT
- 状态机:使用记分板标志跟踪睡眠转换(开始 → 刻 → 停止)
- 植物加速:在约 100 刻的睡眠窗口内乘以
randomTickSpeed
- 动物加速:在睡眠期间每刻通过记分板操作读取/修改幼崽的
Age NBT
- 安全性:保存并恢复
randomTickSpeed 和 doFireTick 游戏规则,并提供默认回退值
性能
- Tick 函数仅包含一个
execute store 命令和 3 个条件判断(开销可忽略不计)
- 生物成长逻辑仅处理同时满足
#overnight:growable_animals 标签与 is_baby 谓词条件的实体
- 所有加速效果仅在短暂的睡眠窗口期间运行(单人游戏中约为 5 秒)
多人游戏
- 当任意玩家开始睡眠时加速即激活(不受
playersSleepingPercentage 参数影响)
- 当最后一名正在睡眠的玩家醒来时加速停止
- 兼容原版睡眠百分比规则及单玩家睡眠数据包的模组
Overnight-Datapack/
├── pack.mcmeta # 数据包元数据(格式 101)
├── pack.png # 数据包图标
├── LICENSE # CC BY-NC-ND 4.0
├── README.md
└── data/
├── minecraft/tags/function/
│ ├── load.json # Hook:加载/重载时运行
│ └── tick.json # Hook:每游戏刻运行
└── overnight/
├── tags/entity_type/
│ └── growable_animals.json # 要加速的小动物类型
├── predicate/
│ └── is_baby.json # 高效的小实体检测
└── function/
├── load.mcfunction # 初始化记分板与默认值
├── tick.mcfunction # 睡眠状态检测循环
├── sleep_start.mcfunction # 保存游戏规则,应用加速效果
├── sleep_tick.mcfunction # 每刻刷新生长逻辑
├── sleep_mob_tick.mcfunction # 小动物年龄操作
├── sleep_stop.mcfunction # 恢复原始游戏规则
├── apply_plant_speed.mcfunction # 计算并设置刻速
├── set_tick_speed.mcfunction # 宏:游戏规则设置器
└── config/
├── menu.mcfunction # 交互式聊天配置 UI
├── toggle_plants.mcfunction # 切换植物生长
├── toggle_mobs.mcfunction # 切换动物生长
├── set_plant_rate.mcfunction # 宏:设置植物倍增率
└── set_mob_rate.mcfunction # 宏:设置动物倍增率
---
## ? 鸣谢
**由 [@TomerGamerTV](https://github.com/TomerGamerTV) 创建**
---
## ? 许可证
本项目依据 **[知识共享署名-非商业性使用-禁止演绎 4.0 国际许可协议](https://creativecommons.org/licenses/by-nc-nd/4.0/)**(CC BY-NC-ND 4.0)进行授权。
您可以自由分享此数据包,但需注明出处;不得用于商业用途,也不得分发修改后的版本。
☽ Overnight
Make your nights count.
A Minecraft Fabric mod and Datapack that accelerates crop, tree, and animal growth while players sleep.
? Description
Overnight makes sleeping in Minecraft actually meaningful. Instead of just skipping the night, your crops, saplings, and baby animals continue growing while you rest — as if time truly passed.
How It Works
- Plants & Trees: When a player sleeps, the
randomTickSpeed is temporarily multiplied by your configured rate (default 100x), causing all crops, saplings, sugar cane, cactus, bamboo, nether wart, and other vegetation to grow rapidly during the brief sleep window.
- Animals: Baby animals have their
Age tag accelerated each tick during sleep, making them grow toward adulthood faster (default 100x, but disabled by default).
- Fire Safety:
doFireTick is automatically disabled during sleep acceleration and restored when players wake up, preventing unwanted fire spread.
- Clean Recovery: If the server reloads mid-sleep (
/reload), original gamerules are automatically restored.
What's Affected by Plant Growth?
All vegetation that uses random ticks, including:
| Category |
Examples |
| Crops |
Wheat, Carrots, Potatoes, Beetroots, Melon/Pumpkin Stems |
| Trees |
All Sapling types (Oak, Birch, Spruce, Jungle, Acacia, Dark Oak, Cherry, Mangrove, Pale Oak) |
| Tall Plants |
Sugar Cane, Cactus, Bamboo, Kelp, Vines, Dripleaf |
| Other |
Nether Wart, Cocoa Beans, Sweet Berries, Chorus Plants, Mushrooms |
What's Affected by Animal Growth?
All breedable baby animals in the #overnight:growable_animals tag:
Cow, Mooshroom, Sheep, Pig, Chicken, Horse, Donkey, Mule, Llama, Rabbit, Fox, Turtle, Panda, Polar Bear, Wolf, Cat, Ocelot, Goat, Axolotl, Camel, Sniffer, Bee, Hoglin, Strider, Villager
You can customize this list by creating your own data/overnight/tags/entity_types/growable_animals.json override.
? Installation
Fabric Mod
- Ensure you have the Fabric Loader and Fabric API installed for Minecraft
1.21.4 (snapshot 26.1.2 equivalent).
- Download the
.jar file from Modrinth.
- Place the file into your
.minecraft/mods/ directory (for singleplayer) or <server directory>/mods/ (for servers).
- Launch the game.
Datapack
- Download the datapack
.zip file.
- Singleplayer: Place the
.zip file into:
.minecraft/saves/<Your World>/datapacks/
- Server: Place the
.zip file into:
<server directory>/world/datapacks/
- Run
/reload in the console or in-game (or restart the world/server).
⚙️ Configuration
Fabric Mod Commands
The Fabric mod provides a dedicated /overnight command (requires OP/moderator level 2 permission):
| Command |
Description |
/overnight status |
View the current configuration status and rates |
/overnight toggle plants |
Toggle plant & tree growth acceleration |
/overnight toggle mobs |
Toggle animal growth acceleration |
/overnight rate plants <value> |
Set plant growth rate multiplier (e.g. /overnight rate plants 200) |
/overnight rate mobs <value> |
Set animal growth rate multiplier (e.g. /overnight rate mobs 50) |
Datapack Commands
The Datapack version uses /function commands and features an interactive chat menu:
| Command |
Description |
/function overnight:config/menu |
Open the interactive config menu |
/function overnight:config/toggle_plants |
Toggle plant & tree growth acceleration |
/function overnight:config/toggle_mobs |
Toggle animal growth acceleration |
/function overnight:config/set_plant_rate {rate:N} |
Set plant growth multiplier (e.g. {rate:200}) |
/function overnight:config/set_mob_rate {rate:N} |
Set animal growth multiplier (e.g. {rate:50}) |
Default Settings
| Setting |
Default |
Description |
| Plants & Trees |
ON |
Accelerate crop/sapling growth during sleep |
| Animal Growth |
OFF |
Accelerate baby animal growth during sleep |
| Plant Rate |
100x |
Multiplier applied to plant growth / randomTickSpeed |
| Animal Rate |
100x |
Multiplier applied to baby animal age progression |
Rate Guide
| Rate |
Effect |
Recommended For |
| 50x |
Moderate growth boost |
Survival purists who want a subtle benefit |
| 100x |
~80% of a full night's growth per sleep |
Default — balanced for most players |
| 200x |
Significant acceleration |
Players who want noticeable overnight progress |
| 500x |
Extreme acceleration |
Creative/testing (may cause brief lag) |
? Technical Details
Architecture
- Sleep detection: Polls
SleepTimer NBT every tick using a single efficient selector
- State machine: Tracks sleeping transitions (start → tick → stop) with scoreboard flags
- Plant acceleration: Multiplies
randomTickSpeed during the ~100-tick sleep window
- Animal acceleration: Reads/modifies baby
Age NBT via scoreboard operations each tick during sleep
- Safety: Saves and restores
randomTickSpeed and doFireTick gamerules, with fallback defaults
Performance
- Tick function is a single
execute store + 3 conditional checks (negligible overhead)
- Mob growth only processes entities matching
#overnight:growable_animals tag AND is_baby predicate
- All acceleration only runs during the brief sleep window (~5 seconds in singleplayer)
Multiplayer
- Acceleration activates as soon as any player sleeps (regardless of
playersSleepingPercentage)
- Deactivates when the last sleeping player wakes up
- Works with vanilla sleep percentage rules and one-player-sleep datapacks
? Project Structure
Overnight-Datapack/
├── pack.mcmeta # Pack metadata (format 101)
├── pack.png # Datapack icon
├── LICENSE # CC BY-NC-ND 4.0
├── README.md
└── data/
├── minecraft/tags/function/
│ ├── load.json # Hook: runs on load/reload
│ └── tick.json # Hook: runs every game tick
└── overnight/
├── tags/entity_type/
│ └── growable_animals.json # Baby animal types to accelerate
├── predicate/
│ └── is_baby.json # Efficient baby entity check
└── function/
├── load.mcfunction # Initialize scoreboards & defaults
├── tick.mcfunction # Sleep state detection loop
├── sleep_start.mcfunction # Save gamerules, apply acceleration
├── sleep_tick.mcfunction # Per-tick mob growth dispatch
├── sleep_mob_tick.mcfunction # Baby animal age manipulation
├── sleep_stop.mcfunction # Restore original gamerules
├── apply_plant_speed.mcfunction # Calculate & set tick speed
├── set_tick_speed.mcfunction # Macro: gamerule setter
└── config/
├── menu.mcfunction # Interactive chat config UI
├── toggle_plants.mcfunction # Toggle plant growth
├── toggle_mobs.mcfunction # Toggle animal growth
├── set_plant_rate.mcfunction # Macro: set plant multiplier
└── set_mob_rate.mcfunction # Macro: set animal multiplier
? Credits
Created by @TomerGamerTV
? License
This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0).
You are free to share this datapack with proper attribution, but you may not use it commercially or distribute modified versions.
评论 0
登录后参与评分
还没有评论,来抢沙发吧