Lets your Minecraft Fabric server snooze when idle, slashing CPU usage without missing a block!
Hibernate Fabric is a lightweight tool that automatically puts your Minecraft Fabric 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.
This project is built with the following technologies:
You will need a Minecraft Fabric server.
- Download
hibernate-fabric-x.x.x+mc1.x.x.jarfrom one of the places at the top of this README. - Copy the downloaded jar file to the
modsfolder of your Minecraft Fabric server.
Don't forget to set pause-when-empty-seconds to 0 in your server.properties file to disable the vanilla hibernation system.
To get a local copy up and running, follow these simple steps.
Ensure you have the following installed on your machine:
- Java Development Kit (JDK): Version 21 or higher.
- Gradle: Version 9.1 or higher.
- Minecraft: Version 1.21.9/10
- Clone the repository
git clone https://github.com/BJTMastermind/hibernate-fabric.git- Navigate to the project directory
cd hibernate-fabric- Build the project with Gradle
./gradlew clean buildYou can find the built mod at hibernate-fabric/build/libs/hibernate-fabric-x.x.x+mc1.x.x.jar.
The mod automatically creates a configuration file at config/hibernate-fabric.json on first run. Here are the available settings:
{
"startEnabled": true,
"ticksToSkip": 400,
"permissionLevel": 2,
"sleepTimeMs": 75,
...| 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 |
...
"enableMemoryOptimization": true,
"memoryCleanupIntervalSeconds": 30,
"memoryThresholdPercent": 80.0,
"forceGarbageCollection": true,
"gcIntervalSeconds": 30,
"saveBeforeHibernation": true,
"removeEntities": [
"minecraft:item",
"minecraft:firework_rocket",
"minecraft:arrow",
"minecraft:experience_orb"
],
"droppedItemMaxAgeSeconds": 300,
"logMemoryUsage": true,
...| Setting | Default | Description |
|---|---|---|
enableMemoryOptimization |
true |
Enable memory cleanup during hibernation |
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) |
logMemoryUsage |
true |
Log memory usage information to console |
...
"aggressiveCpuSaving": true,
"minSleepInterval": 1500,
"highLoadSleepMultiplier": 1.5,
"yieldInterval": 8,
...| 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) |
...
"restoreGameRulesAs": {
"doDaylightCycle": true,
"doWeatherCycle": true,
"randomTickSpeed": 3,
"doMobSpawning": true,
"doFireTick": true
}
}| Setting | Default | Description |
|---|---|---|
doDaylightCycle |
true |
The value to restore the gamerule doDaylightCycle as when coming out of hibernation |
doWeatherCycle |
true |
The value to restore the gamerule doWeatherCycle as when coming out of hibernation |
randomTickSpeed |
3 |
The value to restore the gamerule randomTickSpeed as when coming out of hibernation |
doMobSpawning |
true |
The value to restore the gamerule doMobSpawning as when coming out of hibernation |
doFireTick |
true |
The value to restore the gamerule doFireTick as when coming out of hibernation |
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you don't have any coding experience, testing other platforms and configurations is also very welcome!
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later).
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.

