Skip to main content

Well Rested

info

By default Well Rested provides bonuses to speed, strength, attack speed and block mining speed, increases the player's HP, and also adds gradual health regeneration. The extra health and regeneration don't diminish over time, unlike the other buffs. All of this is fully configurable, including attributes and potion effects from other mods.

The Well Rested level depends on the comfort of the sleeping area. Comfort is measured around the bed at the moment the player lies down, so walking away from the bedroom after waking up does not change the result.

After waking up, the player receives the Rested effect. The effect has up to 5 levels. Higher levels increase strength and duration.

Each level progresses through three phases, gradually weakening over time. Every phase lasts one third of the total duration.

PhaseStrength
Phase 1Strongest
Phase 2Medium
Phase 3Weakest
tip

With the default values higher Rested levels are always stronger overall. For example, Phase 3 of Level 5 is still stronger than Phase 1 of Level 1.

If a player goes to bed with the Well Rested buff, they will only receive a new buff upon waking if it is stronger than the buff they already have. For example, if a player currently has Well Rested at level 4, sleeping in a location that only provides Well Rested at level 1 will keep their level 4 buff. However, if the current buff is stronger but is about to expire, the player will receive a new one, even if it is weaker.


HUD​

While the effect is active, a small bar shows the remaining time, and a numeral shows the level.

You can hide it completely in the config screen (Interface section) or in the file:

"ui": {
"hideWellRestedHud": true
}

The HUD has three positions, chosen with wellRestedHudPosition inside ui, or with the Well Rested HUD position button in the config screen:

Bottom left corner. This is the default.

"wellRestedHudPosition": "left"

Well Rested in the bottom left corner

note

An unknown value falls back to left, and the corrected value is written back to the config file.

Changed in 1.6

The HUD no longer blinks during the last seconds of the effect. It stays steady until the effect ends.


Config​

The whole system can be switched off with a single flag:

"wellRested": {
"enabled": true
}

With enabled: false no effect is ever granted. Sleeping still shows the overlay and the summary, players just wake up without buffs.

warning

Well Rested levels are edited only in the config file. They are not part of the in-game config screen.

Every level has four fields:

FieldDescription
durationMinutesTotal duration of the effect at this level, from 1 to 1440 minutes
regenBonusHealth regeneration, see Regeneration below
attributesA list of attribute bonuses, each with its own value per phase
effectsA list of potion effects, each with its own level per phase

Attributes​

Each entry in attributes changes one attribute of the player:

{
"id": "minecraft:movement_speed",
"operation": "add_multiplied_base",
"phase1": 0.25,
"phase2": 0.15,
"phase3": 0.08
}
FieldDescription
idAttribute id. Any attribute registered in the game works, including attributes from other mods
operationHow the value is applied, see the table below
phase1, phase2, phase3The value for each phase. Use the same number in all three for a bonus that does not weaken
OperationWhat it doesExample
add_valueAdds the number directly to the attribute1.5 on attack_damage adds 1.5 damage to every hit
add_multiplied_baseAdds a share of the base value0.25 on movement_speed makes the player 25% faster
add_multiplied_totalMultiplies the final value, after all other modifiers0.1 makes the final value 10% bigger
note

The 1.20.1 operation names addition, multiply_base and multiply_total are accepted too, on every version. They mean the same as the three above.

All bonuses stack with potions and with modifiers from other mods. When a phase changes, the values are swapped in place. When the effect ends, every bonus the mod added is removed. When the effect is granted, the player's health is filled up to the new maximum.

Default attributes​

AttributeOperationWhat it gives
minecraft:movement_speedadd_multiplied_baseFaster walking
minecraft:attack_damageadd_valueFlat damage on every hit, like the Strength potion
minecraft:block_break_speedadd_multiplied_baseFaster mining
minecraft:attack_speedadd_multiplied_baseFaster weapon cooldown
minecraft:max_healthadd_valueExtra health, 2.0 is one heart. Same value in every phase

Default values​

AttributePhase 1Phase 2Phase 3
movement_speed0.250.150.08
attack_damage1.51.00.5
block_break_speed0.250.140.07
attack_speed0.070.040.02
max_health10.010.010.0

Duration 15 minutes, regenBonus 0.05.

The values are the same on every version. On 1.20.1 the block_break_speed row does not exist. The full JSON is on the config page.


Effects​

Each entry in effects gives the player a potion effect while Well Rested is active:

{
"id": "minecraft:night_vision",
"phase1": 0,
"phase2": 0,
"phase3": -1
}
FieldDescription
idEffect id. Any effect registered in the game works, including effects from other mods
phase1, phase2, phase3Effect level for each phase. 0 is level I, 1 is level II and so on, up to 255. -1 means no effect in that phase

The example above gives Night Vision during the first two phases and removes it for the last one.

Effects given by Well Rested are shown with their icon, but without particles. They are refreshed with the new level when the phase changes, and removed together with Well Rested.

By default every level has an empty list, "effects": [].


Customizing​

A few examples of what the lists make possible.

Add armor to level 5 by adding one entry to its attributes list:

{
"id": "minecraft:armor",
"operation": "add_value",
"phase1": 4.0,
"phase2": 2.0,
"phase3": 1.0
}

On 1.20.1 the id is minecraft:generic.armor.

tip

After editing the file, run /midnightthoughts reload config. Every new effect uses the new values right away. An effect that is already running picks up new attributes and effects at its next phase change, and new regeneration immediately.


Regeneration​

regenBonus restores the player's health every 5 seconds. The amount of healing is calculated as a percentage of the player's maximum health:

heal = maxHealth × regenBonus × 0.5

For example, with 20 HP (10 hearts) and regenBonus = 0.05, it restores 0.5 HP every 5 seconds.

note

Regeneration does not depend on the phase. By default the extra health doesn't either, because max_health has the same value in all three phases.


Granting it manually​

Operators can hand out or remove the effect without anyone sleeping:

/midnightthoughts wellrested grant @a 5
/midnightthoughts wellrested clear @a

Useful for event servers, testing a config change, or rewarding players after a boss fight. Full syntax on the commands page.

warning

grant refuses to run while "enabled": false and says so, rather than pretending to work.

Mod and modpack developers can do the same from code. See KubeJS and the Java API.