
Hibernate MC
让你的 Minecraft Fabric 或 NeoForge 服务器在空闲时“小憩”,在不漏掉任何方块的前提下大幅降低 CPU 占用!
📖 简介
Hibernate MC 是一款轻量级工具,当没有玩家在线时,它会自动让 Minecraft Fabric 或 NeoForge 服务器进入休眠状态。通过在空闲时段减少 CPU 占用,它有助于节省服务器资源、降低电费支出,并使你的服务器更加环保。这是一种简单的方法,可以在不需要时避免浪费电力,同时保持 Minecraft 世界的顺畅运行。
Hibernate MC 也可用于单人游戏。在单人游戏中使用效果与服务器端类似,但“休眠游戏规则”和“休眠模式”本身无法生效,因为这些功能依赖于没有玩家在线的状态,而在单人游戏中这种情况不可能发生。
📦 依赖项
对于 Fabric:
对于 NeoForge:
无
🎮 安装与游玩
安装 Hibernate MC 非常简单:
- 在此处 下载适用于你加载器和 Minecraft 版本的最新版本。
- 将下载的 jar 文件放入
mods文件夹中。 - 启动 Minecraft 并体验该模组。
如果在服务器上安装,请记得在 server.properties 文件中将 pause-when-empty-seconds 设置为 0,以禁用原版的休眠系统。
📜 支持政策
本项目支持模组最初开发所针对的 Minecraft 版本,以及随后的两个主要 Minecraft 版本。早于初始支持版本的版本不提供支持。
一旦某个 Minecraft 版本超出三个活跃版本的活跃支持窗口,它将进入仅修复 Bug 支持阶段,直到下一个主要版本发布期间。在此期间,仅解决与项目直接相关的严重或破坏游戏的问题。新功能、增强功能和非关键更改不会移植回处于此阶段的版本。
一旦版本退出仅修复 Bug 支持阶段,它将变为不受支持。不受支持的版本将不再接收任何更新、修复或兼容性变更。
| Minecraft 版本 | 支持状态 |
|---|---|
26.3 |
受支持 |
26.2 |
受支持 |
26.1 |
受支持 |
1.21.11 |
仅修复 Bug |
1.21.9 |
不受支持 |
📝 配置
配置文件位于 .minecraft 文件夹根目录或你的服务器文件夹中的 /config/hibernate_mc.json。
⚙️ 选项
查看选项
基本设置
| 设置项 | 默认值 | 描述 |
|---|---|---|
startEnabled |
true |
服务器启动且无玩家在线时是否自动激活休眠 |
ticksToSkip |
400 |
在休眠期间应用睡眠前需要跳过的刻数 |
permissionLevel |
2 |
使用休眠命令所需的权限等级(0=所有玩家,4=所有者) |
sleepTimeMs |
75 |
在刻处理周期之间睡眠的毫秒数 |
内存优化
| 设置项 | 默认值 | 描述 |
|---|---|---|
enableMemoryOptimization |
true |
启用休眠期间的内存清理 |
removeEntitiesOnUnload |
true |
当其所在区块卸载时移除非持久性实体 |
memoryCleanupIntervalSeconds |
30 |
运行内存清理例程的频率 |
memoryThresholdPercent |
80.0 |
触发清理的内存使用百分比阈值 |
forceGarbageCollection |
true |
在休眠期间强制进行 Java 垃圾回收 |
gcIntervalSeconds |
30 |
两次垃圾回收运行之间的最小时间间隔 |
saveBeforeHibernation |
true |
进入休眠前保存世界数据 |
removeEntities |
item, firework_rocket, arrow, experience_orb |
休眠期间要移除的实体列表(忽略具有自定义名称的实体) |
droppedItemMaxAgeSeconds |
300 |
物品被移除前的最大存在秒数(5分钟) |
logMemoryInfo |
false |
将内存使用和垃圾回收器信息记录到控制台 |
CPU 优化
| 设置项 | 默认值 | 描述 |
|---|---|---|
aggressiveCpuSaving |
true |
启用更积极的 CPU 节省措施 |
minSleepInterval |
1500 |
睡眠周期之间的最小时间间隔(毫秒) |
highLoadSleepMultiplier |
1.5 |
系统负载高时的睡眠时间倍增器 |
yieldInterval |
8 |
向其他线程让出 CPU 的频率(每 N 个刻) |
服务器唤醒时的游戏规则值
| 设置项 | 默认值 | 描述 |
|---|---|---|
advance_time |
true |
从休眠状态恢复时,将游戏规则 advance_time 设置的值 |
advance_weather |
true |
从休眠状态恢复时,将游戏规则 advance_weather 设置的值 |
random_tick_speed |
3 |
从休眠状态恢复时,将游戏规则 random_tick_speed 设置的值 |
spawn_mobs |
true |
从休眠状态恢复时,将游戏规则 spawn_mobs 设置的值 |
fire_spread_radius_around_player |
128 |
从休眠状态恢复时,将游戏规则 fire_spread_radius_around_player 设置的值 |
服务器休眠时的游戏规则值
| 设置项 | 默认值 | 描述 |
|---|---|---|
advance_time |
false |
进入休眠状态时,将游戏规则 advance_time 设置的值 |
advance_weather |
false |
进入休眠状态时,将游戏规则 advance_weather 设置的值 |
random_tick_speed |
0 |
进入休眠状态时,将游戏规则 random_tick_speed 设置的值 |
spawn_mobs |
false |
进入休眠状态时,将游戏规则 spawn_mobs 设置的值 |
fire_spread_radius_around_player |
0 |
进入休眠状态时,将游戏规则 fire_spread_radius_around_player 设置的值 |
👨💻 开发
你是开发者并想为该模组进行开发吗?
点击开始。
要搭建本地副本并运行,请遵循以下步骤。
🧰 前置条件
确保你的机器上安装了以下内容:
🛠️ 构建
- 克隆仓库
git clone https://codeberg.org/VoxelBill/hibernate-mc.git
- 导航至项目目录
cd hibernate-mc
- 使用 Gradle 构建项目
./gradlew clean build
你可以在 hibernate-mc/<loader>/build/libs/hibernate_mc-<loader>-x.x.x+mc2x.x.jar 找到构建好的模组。
⚖️ 许可证
本软件基于 GNU 宽通用公共许可证 v3.0 only (LGPL-3.0-only) 发布。
本项目是 Hibernateforge 的一个分支,后者基于 欧洲联盟公共许可证 v1.2 (EUPL-1.2) 发布。 重新许可已根据 EUPL 的兼容性条款(第 5 条)完成。
有关更多信息,请参阅 LICENSE 文件。

Hibernate MC
Lets your Minecraft Fabric or NeoForge server snooze when idle, slashing CPU usage without missing a block!
📖 About
Hibernate MC is a lightweight tool that automatically puts your Minecraft Fabric or NeoForge server to sleep when no players are online. By reducing CPU usage during idle times, it helps save server resources, lowers your electricity bill, and makes your server more eco-friendly. It's a simple way to keep your Minecraft world running smoothly without wasting power when it's not needed.
Hibernate MC can also be used in singleplayer. When used in singleplayer, everything works just like it does on a server, except for the hibernation gamerules feature and "hibernation mode" itself, as they only function when no players are online, which can't happen in singleplayer.
📦 Dependencies
For Fabric:
For NeoForge:
N/A
🎮 Install & Play
Installing Hibernate MC is easy:
- Download the latest version for your loader and Minecraft version here.
- Put the downloaded jar file in to your
modsfolder. - Launch Minecraft and play with the mod.
If installing on a server, don't forget to set pause-when-empty-seconds to 0 in your server.properties file to disable the vanilla hibernation system.
📜 Support Policy
The project supports the Minecraft version for which the mod is initially developed for, along with the next two major Minecraft versions. Versions released prior to the initial supported version are not supported.
Once a Minecraft version falls outside the three-version active support window, it enters Bug-Fixes-Only support for the duration of the following major version. During this period, only critical or game-breaking issues directly related to the project will be addressed. New features, enhancements, and non-critical changes will not be backported to versions in this stage.
Once a version leaves Bug-Fixes-Only support, it becomes Unsupported. Unsupported versions will receive no further updates, fixes, or compatibility changes.
| Minecraft version | Supported status |
|---|---|
26.3 |
Supported |
26.2 |
Supported |
26.1 |
Supported |
1.21.11 |
Bugs Only |
1.21.9 |
Unsupported |
📝 Config
The config file can be found at /config/hibernate_mc.json from the root of the .minecraft folder or your server folder.
⚙️ Options
See options
Basic Settings
| Setting | Default | Description |
|---|---|---|
startEnabled |
true |
Whether hibernation activates automatically when server starts with no players |
ticksToSkip |
400 |
Number of ticks to process before applying sleep during hibernation |
permissionLevel |
2 |
Required permission level to use hibernation commands (0=all, 4=owner) |
sleepTimeMs |
75 |
Milliseconds to sleep between tick processing cycles |
Memory Optimization
| Setting | Default | Description |
|---|---|---|
enableMemoryOptimization |
true |
Enable memory cleanup during hibernation |
removeEntitiesOnUnload |
true |
Remove non-persistent entities when the chunks they're in unload |
memoryCleanupIntervalSeconds |
30 |
How often to run memory cleanup routines |
memoryThresholdPercent |
80.0 |
Memory usage percentage that triggers cleanup |
forceGarbageCollection |
true |
Force Java garbage collection during hibernation |
gcIntervalSeconds |
30 |
Minimum time between garbage collection runs |
saveBeforeHibernation |
true |
Save world data before entering hibernation |
removeEntities |
item, firework_rocket, arrow, experience_orb |
List of entities to remove during hibernation (ignores entities with custom names) |
droppedItemMaxAgeSeconds |
300 |
Age in seconds after which items are removed (5 minutes) |
logMemoryInfo |
false |
Log memory usage and garbage collector information to console |
CPU Optimization
| Setting | Default | Description |
|---|---|---|
aggressiveCpuSaving |
true |
Enable more aggressive CPU saving measures |
minSleepInterval |
1500 |
Minimum time in milliseconds between sleep cycles |
highLoadSleepMultiplier |
1.5 |
Multiplier for sleep time when system load is high |
yieldInterval |
8 |
How often to yield CPU to other threads (every N ticks) |
Gamerule Values When The Servers Awake
| Setting | Default | Description |
|---|---|---|
advance_time |
true |
The value to set the gamerule advance_time to when coming out of hibernation |
advance_weather |
true |
The value to set the gamerule advance_weather to when coming out of hibernation |
random_tick_speed |
3 |
The value to set the gamerule random_tick_speed to when coming out of hibernation |
spawn_mobs |
true |
The value to set the gamerule spawn_mobs to when coming out of hibernation |
fire_spread_radius_around_player |
128 |
The value to set the gamerule fire_spread_radius_around_player to when coming out of hibernation |
Gamerule Values When The Servers Hibernating
| Setting | Default | Description |
|---|---|---|
advance_time |
false |
The value to set the gamerule advance_time to when going into hibernation |
advance_weather |
false |
The value to set the gamerule advance_weather to when going into hibernation |
random_tick_speed |
0 |
The value to set the gamerule random_tick_speed to when going into hibernation |
spawn_mobs |
false |
The value to set the gamerule spawn_mobs to when going into hibernation |
fire_spread_radius_around_player |
0 |
The value to set the gamerule fire_spread_radius_around_player to when going into hibernation |
👨💻 Developing
Are you a developer and want to develop for this mod?
Click to get started.
To get a local copy up and running, follow these simple steps.
🧰 Prerequisites
Ensure you have the following installed on your machine:
- Java Development Kit (JDK): Version 25 or higher.
- Gradle: Version 9.7.1 or higher.
- Minecraft: Version 26.3
🛠️ Build
- Clone the repository
git clone https://codeberg.org/VoxelBill/hibernate-mc.git
- Navigate to the project directory
cd hibernate-mc
- Build the project with Gradle
./gradlew clean build
You can find the built mod at hibernate-mc/<loader>/build/libs/hibernate_mc-<loader>-x.x.x+mc2x.x.jar.
⚖️ License
Distributed under the GNU Lesser General Public License v3.0 only (LGPL-3.0-only).
This project is a fork of Hibernateforge which was distributed under the European Union Public License v1.2 (EUPL-1.2). Relicensing has been done in accordance with the compatibility clause of the EUPL (Article 5).
See LICENSE for more information.
下载 Hibernate MC
下载 Hibernate MC
下载 Hibernate MC
下载 Hibernate MC
下载 Hibernate MC
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Hibernate MC
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Hibernate MC
下载 Hibernate MC
下载 Hibernate MC
下载 Hibernate MC
更改:
- 使内存优化系统始终运行,而不仅仅是在休眠期间运行,这也允许它在单人游戏中运行。
- 将实体移除(在区块卸载时)系统与
enableMemoryOptimization配置选项分离出来,成为独立的removeEntitiesOnUnload配置选项。更多信息请参见 README。 - 清理了一些代码。
更改内容:
- 将 Hibernate Fabric 迁移至多加载器模组架构,以正式支持 NeoForge!(#15)
- 将模组名称从 Hibernate Fabric 更改为 Hibernate MC,因为 Fabric 已不再是唯一支持的加载器。
- 增加了额外检查,防止仅在多人游戏系统中尝试在单人游戏中运行。
- 修复了
/hibernate status命令中的Memory Optimization(内存优化)状态在单人游戏中显示为ACTIVE(活跃),尽管其实际上并未生效的问题。 - 清理部分代码。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
评论 0
登录后参与评分
还没有评论,来抢沙发吧