'It works now, I swear!'
Requires the Fabric API.
This mod adds sleep voting, sleep recovery and no-sleep debuffs! Works server-side only as well!
Sleep voting
Sleep voting allows nights to be skipped when a certain percentage of the players are asleep. This can be set via a gamerule (percentRequiredToSleep
) per save!
Sleep recovery
Sleep recovery gives players regeneration for 15s when they have slept through the night. This can be enabled or disabled through the config file.
No-sleep debuffs
No-sleep debuffs are applied when a player has skipped some nights consecutively without sleeping. The effects get stronger the more nights the player is awake. This can be enabled or disabled, and the nights before the effect is applied can be configured through the config file as well.
The effects given are:
- Nausea (5s first night, 10s second night, so on)
- Slowness (50s, strength increases every other night)
- Mining fatigue (50s, strength increases every other night)
- Weakness (50s, strength increases every other night)
- Blindness (25s, only after the 2nd night of debuffs)
Messages
Messages are sent when a player sleeps, for skipping nights and for debuffs. These can all be configured as well. Each message can have placeholders that are replaced:
- The night skipped message does not take any placeholders.
- The players asleep message can take:
{asleep}
which is replaced with the number of players asleep{total}
which is replaced with the total number of players{percent}
which is replaced with the percentage of players that are asleep{required}
which is replaced with the number of players required to skip the night new in 0.2.0{percentRequired}
which is replaced with the percentage of players required to skip the night new in 0.2.0
- The debuff message can take
{nights}
which is replaced with the number of nights skipped.
The config file also has a formatting field that is used to format the messages. It is a list and can take the names of any of the standard colours and styles. The Minecraft wiki has a full list.
Config
The config file is found in the config
folder and is called bettersleeping_config.json
. This folder should be in the same place as your mods
folder (.minecraft
for Windows). If this file is deleted the mod will recreate it with the default settings at the next start-up.
Will there be a 1.16.5 update soon? This mod is amazing
In reply to oxymoron_11:
This most likely works for 1.16.5
The code for 1.16.4 and 1.16.5 is so similar that most mods are cross-compatible
Is it possible to give buffs for not sleeping and debuffs for sleeping? There's currently no reason not to sleep
In reply to jeffeinstein126:
Not currently, but I've been considering allowing much higher customization of the buffs and debuffs, so that would come with it. Before then I'll consider adding a flip in there to easily swap buffs and debuffs.
In reply to ExtraCrafTX:
That'd be cool. By high consolidation, do you mean allowing the effects to be what ever the server-owner wants (no hard coded effects)?
In reply to jeffeinstein126:
Yes, exactly. My plan is to allow the effects, their potency, duration, and their scaling to all be configurable.
In reply to ExtraCrafTX:
Perfecto!
In reply to ExtraCrafTX:
Waiting for this. Want it to be instant health instead of regeneration.
In reply to ExtraCrafTX:
I would love to be able to build an Inn with different types of buffs players can trade for in game. Having a custom buff option would be amazing!
Has anyone tried this for 1.16 to see if it works?
In reply to ProsperCraft:
Hey, the mod has just been updated for 1.16!
Hello!
We need an update to 1.16!
Absolutely!
In reply to Forge_User_72823797:
Oh yes please :)
In reply to Laegnur:
I've just published a 1.16 update!
Can I customize the effect?
And custom duration.
In reply to Baka__Neko:
Not atm, but I am considering adding this to the next update, which should be sometime soon hopefully.
In reply to ExtraCrafTX:
That sounds great.
no-sleep debuffs bro its called minecraft:phantom.exe
EDIT: Read other comments and I see the % is not in config but a game rule.
Forgive my noobness, but what's a gamerule?
And what exactly do I do to make it so that if one of us sleeps both of us sleeps? Thank you!
Edit 2: I think I need to allow cheats to edit use a gamerule. Will try tomorrow.