

Struggle To Sleep
Not snuggle, STRUGGLE! You can only sleep if certain conditions are met.
Description
Sleep conditions
This mod establishes some rules for sleeping. You can't sleep if....
1. ...you are wet (wetness).
2. ...you are too cold (body temperature)
3. ...you are starving (satiety at 0)
4. ...hostile creatures are near (drifters, shivers, wolves, bears etc.)
Beds can break
The straw bed has a 25% chance to break after use, the aged wooden bed has a 10% chance, other beds can't break (by default).
Beds are VERY heavy/cumbersome to carry
All beds except the straw bed will slow you down significantly (-80% walk speed).
Better beds = warmer beds
A simple little mechanic that gives beds a warmthBonus attribute that is added to your body temperature for the cold-condition check.
I've patched the vanilla beds' attributesByType to provide the warmth bonus (straw bed +0℃, aged bed +1.5℃, bed +3℃, cozy bed +4℃, comfy bed (from <span style="color: #2880b9;">Comfy Beds</span>) provides +6℃)
Here's the patch for vanilla beds if you want to patch other beds.
"file": "game:blocktypes/wood/bed.json",
"op": "addmerge",
"path": "/attributesByType",
"value": {
"bed-wood-": {
"warmthBonus": 3.0
},
"bed-woodaged-": {
"warmthBonus": 1.5
},
"bed-village-": {
"warmthBonus": 4.0
},
"": {
"warmthBonus": 0
}
}
}</pre>
- Config file breakdown (StruggleToSleepConfig.json) -
Default values
"WetnessPreventsSleep": true, (set to 'false' to ignore wetness)
"ColdPreventsSleep": true, (set to 'false' to ignore cold)
"MobsPreventsSleep": true, (set to 'false' to ignore nearby hostiles)
"HungerPreventsSleep": true, (set to 'false' to ignore hunger)
"BedsCanBreak": true, (set to 'false' to disable bed-breaking)
"DisableSleeping": false, (set to 'true' to prevent sleeping altogether... I know, that's just crazy)
"MaxWetnessLevelToSleep": 0.1, (sleeping is prevented if your wetness level is above this value, range: 0 - 1)
"MinBodyTemperatureToSleep": 36.1, (sleeping is prevented if your body temperature is below this value)
"CarryBedSlowdown": -0.8, (-0.8 = -80% walk speed while carrying a bed, range -1 - 0, set this to 0 if you wanna carry beds as normal)
"HostileEntityCheckRadius": 16, (radius in blocks that is checked for hostile creatures)
"StrawBedBreakChance": 0.25, (chance for the straw bed to break, 0.25 = 25%)
"AgedBedBreakChance": 0.1, (chance for the aged wooden bed to break, 0.1 = 10%)
"OtherBedsBreakChance": 0.0, (chance for all other types of beds to break, 0 = 0%)
"HostileEntityCodes": [ ] --- This is a list of entity codes that will be considered hostile. You can add your own if you know the code.
Example - Make hares prevent sleeping: Goto Vintagestory\assets\survival\entities\animal\mammal\hare-adult.json, look for <span style="background-color: #9dddf9;">code: "hare"</span> (it's the very first line), put hare in the list. done.
"HostileEntityTags": [ ] --- The mod also checks creature's tags. Works the same as code, just put a tag in the list, look for the line <span style="background-color: #9dddf9;">tags: ["rust-creature", "habitat-land"]</span> (example) in the entity's json-file.
- Compatibility -
Ratings & reviews
Sign in to leave a rating or comment.

