Healing when you sleep based on how long (in MC hours) you slept. Not sleeping for a long time means you can't get the Well Rested buff, but sleep too much and you'll wake up groggy! Healthy Sleep is designed for mods that accelerate time when you sleep, however they are not required.
Works on Minecraft 1.21-1.21.3
Demo recorded using Better Days by wendall911 to accelerate time while sleeping.
Features
Sleep Healing
Sleeping for 4 MC hours will heal 2 hearts. Sleeping for 6 MC hours will heal 4 hearts. Getting a full 8 MC hours of sleep will heal 8 hearts. Sleep Healing is independent of your Sleep Score.
Sleep Score
Every player is assigned a "Sleep Score" based on how long in MC hours they've slept. Your Sleep Score decays when you're awake and goes up when you sleep to a maximum of 14 MC hours worth.
Well Rested and Alarm Clocks
When you're notified that "I'm pretty tired..." it means if you sleep a full night you will receive the Well Rested buff! (Luck 5min, Speed + Haste 2.5min) But be careful if you miss your Alarm Clock and oversleep, you wont get the buff and you'll have to wait until you're tired to be eligible to get the buff again.
Can't Sleep and Oversleeping
You can't spend all day in bed! If your Sleep Score is maxed out, you'll wake up groggy and lose out on buffs. And if your Sleep Score is maxed out, you won't be able to sleep! (Feature intended to work with mods that allow sleeping during the day)
Server-Sided
This datapack can be run server-side and does not need to be on the client unless it's to be used in singleplayer. The mod versions are auto-packages of the datapack to be used in mod loaders like Fabric.
Compatibility
Time Acceleration (Full)
Healthy Sleep is designed to work with mods that accelerate time when players sleep like:
Time Skipping (Partial)
Healthy Sleep will mostly function when time is skipped upon sleeping. The Alarm Clock won't work and Oversleeping may trigger excessively when using sleep behavior like these:
- Vanilla Minecraft
- Fast Sleep by sniffercraft34
- Time Acceleration mods with modifiers set too fast
Changing Day Length (NOT COMPATIBLE)
Healthy Sleep requires that the minecraft day be 24000 ticks long. Speeding up how quickly that passes is fine, reducing it is not, therefore some mods that change day length may work, some might not depending on their implementation. (I would guess Better Days works, but I haven't tested it)
Future of Healthy Sleep
Features
- Exhaustion - Going too long without sleeping will induce debuffs until you sleep long enough to clear them.
- User Configuration - Might add in-game configuration commands
Updates
- "Will you update/backport this to new/old versions?"
Only if I need it, which means probably no. You're welcome to unzip the pack and try it yourself! Nearly every command has comments explaining their function, making it easy to modify.
- "Can you add X feature?"
I made this for my private RP server, so I'll likely only take the time to add features if it benefits that. Again, you're welcome to try adding it yourself!
- "I found a bug! Where do I report it?"
To the Exterminator.
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+