Comfort system
The mod introduces a comfort system that affects sleep quality. When a player goes to bed, their rest level after waking depends on the comfort level around the bed.
Comfort is influenced by nearby elements such as furniture, plants in pots, glass, carpets, and lanterns. Some blocks increase comfort, while others decrease it.
The whole system is configured in one block:
"comfort": {
"enabled": true,
"scanRadius": 5,
"weights": {
"lighting": 1,
"carpet": 1,
"furniture": 1,
"decoration": 1,
"structure": 1,
"macabre": -1,
"hostile": -1,
"dark": -1
},
"nightmareThreshold": -1,
"sleepBlockThreshold": -2,
"nightmareEnabled": true,
"sleepBlockEnabled": true
}
| Parameter | Default | Description |
|---|---|---|
enabled | true | Set to false to switch the comfort system off entirely |
scanRadius | 5 | How many blocks around the bed are scanned, 0–8 |
weights | see below | How much each category contributes |
nightmareThreshold | -1 | Comfort at or below this triggers nightmares |
sleepBlockThreshold | -2 | Comfort at or below this prevents sleep entirely |
nightmareEnabled | true | Set to false to never trigger nightmares |
sleepBlockEnabled | true | Set to false to always allow sleeping, however grim the room |
A bigger scanRadius means a larger area is checked, which makes high comfort easier to reach — a lantern three rooms away still counts. Lowering it to 2 or 3 forces players to build a genuinely cosy bedroom rather than a cosy house.
Comfort tags
You can extend the comfort system using data packs by adding blocks to special tags.
Place your tag files in:
data/midnightthoughts/tags/block/
Each file must contain a JSON list of blocks:
{
"replace": false,
"values": [
"minecraft:example_block"
]
}
Setting "replace": false ensures that new blocks are added without overriding the default ones. Tags in Minecraft are used to group blocks together through datapacks and mods.
How comfort is scored
Each category is checked once. Either at least one matching block was found within the scan radius, or none was — a room with twenty lanterns scores exactly the same as a room with one.
Every category that was found adds its weight from the config. The sum is the comfort level.
| Tag | Config weight | Default |
|---|---|---|
comfort_lighting | weights.lighting | +1 |
comfort_carpet | weights.carpet | +1 |
comfort_furniture | weights.furniture | +1 |
comfort_decoration | weights.decoration | +1 |
comfort_structure | weights.structure | +1 |
comfort_negative_macabre | weights.macabre | -1 |
comfort_negative_hostile | weights.hostile | -1 |
comfort_negative_dark | weights.dark | -1 |
With the default weights that gives a range from -3 to +5. The positive result becomes the Well Rested level, so all five positive categories present means level 5.
Weights are the main balancing lever. Making structure worth 2 rewards enclosed bedrooms; making dark worth -3 turns an unlit room into an automatic nightmare no matter what furniture is in it. Any weight can be negative or positive, from -100 to 100.
Nightmares and blocked sleep
Two thresholds are checked against the final comfort level:
| Condition | Result |
|---|---|
comfort ≤ sleepBlockThreshold | The player cannot sleep at all and is told why |
comfort ≤ nightmareThreshold | The player sleeps, but gets a nightmare |
| otherwise | A normal night |
With the defaults (-1 and -2) that works out as:
| Comfort | Outcome |
|---|---|
| +1 and above | Normal sleep, Rested effect at that level |
| 0 | Normal sleep, no Rested effect |
| -1 | Nightmare |
| -2 and below | Cannot sleep |
The sleep block is checked first. If comfort is low enough to hit both thresholds, the player simply cannot go to bed — there is no nightmare, because there is no sleep.
Both behaviours can be turned off independently. "nightmareEnabled": false keeps the comfort scoring but never shows nightmares; "sleepBlockEnabled": false lets players sleep anywhere while still getting nightmares in bad places.
Checking comfort in-game
Rather than guessing which category is missing, ask the mod:
/midnightthoughts comfort
It prints every category, whether it was found, the weight it contributed, the total, and how that total compares to both thresholds. Operators can also check another player with /midnightthoughts comfort <name>. See commands.
Full block list
- 1.21.1+
- 1.20.1
- Lighting
- Carpet
- Furniture
- Decoration
- Structure
- Negative: Dark
- Negative: Hostile
- Negative: Macabre
{
"replace": false,
"values": [
"minecraft:torch",
"minecraft:wall_torch",
"minecraft:soul_torch",
"minecraft:soul_wall_torch",
"minecraft:lantern",
"minecraft:soul_lantern",
"minecraft:glowstone",
"minecraft:sea_lantern",
"minecraft:redstone_lamp",
"minecraft:shroomlight",
"minecraft:end_rod",
"minecraft:candle",
"minecraft:white_candle",
"minecraft:orange_candle",
"minecraft:magenta_candle",
"minecraft:light_blue_candle",
"minecraft:yellow_candle",
"minecraft:lime_candle",
"minecraft:pink_candle",
"minecraft:gray_candle",
"minecraft:light_gray_candle",
"minecraft:cyan_candle",
"minecraft:purple_candle",
"minecraft:blue_candle",
"minecraft:brown_candle",
"minecraft:green_candle",
"minecraft:red_candle",
"minecraft:black_candle"
]
}
{
"replace": false,
"values": [
"minecraft:white_carpet",
"minecraft:orange_carpet",
"minecraft:magenta_carpet",
"minecraft:light_blue_carpet",
"minecraft:yellow_carpet",
"minecraft:lime_carpet",
"minecraft:pink_carpet",
"minecraft:gray_carpet",
"minecraft:light_gray_carpet",
"minecraft:cyan_carpet",
"minecraft:purple_carpet",
"minecraft:blue_carpet",
"minecraft:brown_carpet",
"minecraft:green_carpet",
"minecraft:red_carpet",
"minecraft:black_carpet",
"minecraft:moss_carpet"
]
}
{
"replace": false,
"values": [
"minecraft:bookshelf",
"minecraft:chest",
"minecraft:trapped_chest",
"minecraft:crafting_table",
"minecraft:furnace",
"minecraft:blast_furnace",
"minecraft:smoker",
"minecraft:enchanting_table",
"minecraft:anvil",
"minecraft:chipped_anvil",
"minecraft:damaged_anvil",
"minecraft:lectern",
"minecraft:barrel",
"minecraft:cartography_table",
"minecraft:fletching_table",
"minecraft:grindstone",
"minecraft:loom",
"minecraft:smithing_table",
"minecraft:stonecutter",
"minecraft:brewing_stand",
"minecraft:cauldron",
"minecraft:water_cauldron",
"minecraft:lava_cauldron",
"minecraft:powder_snow_cauldron",
"minecraft:jukebox",
"minecraft:bell",
"minecraft:decorated_pot"
]
}
{
"replace": false,
"values": [
"minecraft:flower_pot",
"minecraft:potted_oak_sapling",
"minecraft:potted_spruce_sapling",
"minecraft:potted_birch_sapling",
"minecraft:potted_jungle_sapling",
"minecraft:potted_acacia_sapling",
"minecraft:potted_cherry_sapling",
"minecraft:potted_dark_oak_sapling",
"minecraft:potted_mangrove_propagule",
"minecraft:potted_fern",
"minecraft:potted_dandelion",
"minecraft:potted_poppy",
"minecraft:potted_blue_orchid",
"minecraft:potted_allium",
"minecraft:potted_azure_bluet",
"minecraft:potted_red_tulip",
"minecraft:potted_orange_tulip",
"minecraft:potted_white_tulip",
"minecraft:potted_pink_tulip",
"minecraft:potted_oxeye_daisy",
"minecraft:potted_cornflower",
"minecraft:potted_lily_of_the_valley",
"minecraft:potted_wither_rose",
"minecraft:potted_red_mushroom",
"minecraft:potted_brown_mushroom",
"minecraft:potted_dead_bush",
"minecraft:potted_cactus",
"minecraft:potted_bamboo",
"minecraft:potted_azalea_bush",
"minecraft:potted_flowering_azalea_bush",
"minecraft:potted_crimson_fungus",
"minecraft:potted_warped_fungus",
"minecraft:potted_crimson_roots",
"minecraft:potted_warped_roots",
"minecraft:potted_torchflower"
]
}
{
"replace": false,
"values": [
"minecraft:glass",
"minecraft:glass_pane",
"minecraft:white_stained_glass",
"minecraft:orange_stained_glass",
"minecraft:magenta_stained_glass",
"minecraft:light_blue_stained_glass",
"minecraft:yellow_stained_glass",
"minecraft:lime_stained_glass",
"minecraft:pink_stained_glass",
"minecraft:gray_stained_glass",
"minecraft:light_gray_stained_glass",
"minecraft:cyan_stained_glass",
"minecraft:purple_stained_glass",
"minecraft:blue_stained_glass",
"minecraft:brown_stained_glass",
"minecraft:green_stained_glass",
"minecraft:red_stained_glass",
"minecraft:black_stained_glass",
"minecraft:white_stained_glass_pane",
"minecraft:orange_stained_glass_pane",
"minecraft:magenta_stained_glass_pane",
"minecraft:light_blue_stained_glass_pane",
"minecraft:yellow_stained_glass_pane",
"minecraft:lime_stained_glass_pane",
"minecraft:pink_stained_glass_pane",
"minecraft:gray_stained_glass_pane",
"minecraft:light_gray_stained_glass_pane",
"minecraft:cyan_stained_glass_pane",
"minecraft:purple_stained_glass_pane",
"minecraft:blue_stained_glass_pane",
"minecraft:brown_stained_glass_pane",
"minecraft:green_stained_glass_pane",
"minecraft:red_stained_glass_pane",
"minecraft:black_stained_glass_pane",
"minecraft:tinted_glass",
"minecraft:oak_door",
"minecraft:spruce_door",
"minecraft:birch_door",
"minecraft:jungle_door",
"minecraft:acacia_door",
"minecraft:dark_oak_door",
"minecraft:mangrove_door",
"minecraft:cherry_door",
"minecraft:bamboo_door",
"minecraft:crimson_door",
"minecraft:warped_door",
"minecraft:iron_door",
"minecraft:copper_door",
"minecraft:exposed_copper_door",
"minecraft:weathered_copper_door",
"minecraft:oxidized_copper_door",
"minecraft:waxed_copper_door",
"minecraft:waxed_exposed_copper_door",
"minecraft:waxed_weathered_copper_door",
"minecraft:waxed_oxidized_copper_door",
"minecraft:oak_trapdoor",
"minecraft:spruce_trapdoor",
"minecraft:birch_trapdoor",
"minecraft:jungle_trapdoor",
"minecraft:acacia_trapdoor",
"minecraft:dark_oak_trapdoor",
"minecraft:mangrove_trapdoor",
"minecraft:cherry_trapdoor",
"minecraft:bamboo_trapdoor",
"minecraft:crimson_trapdoor",
"minecraft:warped_trapdoor",
"minecraft:iron_trapdoor",
"minecraft:copper_trapdoor",
"minecraft:exposed_copper_trapdoor",
"minecraft:weathered_copper_trapdoor",
"minecraft:oxidized_copper_trapdoor",
"minecraft:waxed_copper_trapdoor",
"minecraft:waxed_exposed_copper_trapdoor",
"minecraft:waxed_weathered_copper_trapdoor",
"minecraft:waxed_oxidized_copper_trapdoor"
]
}
{
"replace": false,
"values": [
"minecraft:sculk",
"minecraft:sculk_sensor",
"minecraft:sculk_shrieker",
"minecraft:sculk_catalyst",
"minecraft:ancient_debris",
"minecraft:obsidian",
"minecraft:crying_obsidian",
"minecraft:reinforced_deepslate",
"minecraft:deepslate",
"minecraft:cobbled_deepslate",
"minecraft:tuff"
]
}
{
"replace": false,
"values": [
"minecraft:spawner",
"minecraft:soul_sand",
"minecraft:soul_soil",
"minecraft:nether_bricks",
"minecraft:red_nether_bricks",
"minecraft:nether_brick_fence",
"minecraft:magma_block",
"minecraft:netherrack",
"minecraft:crimson_nylium",
"minecraft:warped_nylium",
"minecraft:trial_spawner",
"minecraft:vault"
]
}
{
"replace": false,
"values": [
"minecraft:skeleton_skull",
"minecraft:skeleton_wall_skull",
"minecraft:wither_skeleton_skull",
"minecraft:wither_skeleton_wall_skull",
"minecraft:zombie_head",
"minecraft:zombie_wall_head",
"minecraft:creeper_head",
"minecraft:creeper_wall_head",
"minecraft:dragon_head",
"minecraft:dragon_wall_head",
"minecraft:piglin_head",
"minecraft:piglin_wall_head",
"minecraft:player_head",
"minecraft:player_wall_head",
"minecraft:bone_block",
"minecraft:wither_rose",
"minecraft:potted_wither_rose",
"minecraft:cobweb",
"minecraft:gravel",
"minecraft:mud"
]
}
- Lighting
- Carpet
- Furniture
- Decoration
- Structure
- Negative: Dark
- Negative: Hostile
- Negative: Macabre
{
"replace": false,
"values": [
"minecraft:torch",
"minecraft:wall_torch",
"minecraft:soul_torch",
"minecraft:soul_wall_torch",
"minecraft:lantern",
"minecraft:soul_lantern",
"minecraft:glowstone",
"minecraft:sea_lantern",
"minecraft:redstone_lamp",
"minecraft:shroomlight",
"minecraft:end_rod",
"minecraft:candle",
"minecraft:white_candle",
"minecraft:orange_candle",
"minecraft:magenta_candle",
"minecraft:light_blue_candle",
"minecraft:yellow_candle",
"minecraft:lime_candle",
"minecraft:pink_candle",
"minecraft:gray_candle",
"minecraft:light_gray_candle",
"minecraft:cyan_candle",
"minecraft:purple_candle",
"minecraft:blue_candle",
"minecraft:brown_candle",
"minecraft:green_candle",
"minecraft:red_candle",
"minecraft:black_candle"
]
}
{
"replace": false,
"values": [
"minecraft:white_carpet",
"minecraft:orange_carpet",
"minecraft:magenta_carpet",
"minecraft:light_blue_carpet",
"minecraft:yellow_carpet",
"minecraft:lime_carpet",
"minecraft:pink_carpet",
"minecraft:gray_carpet",
"minecraft:light_gray_carpet",
"minecraft:cyan_carpet",
"minecraft:purple_carpet",
"minecraft:blue_carpet",
"minecraft:brown_carpet",
"minecraft:green_carpet",
"minecraft:red_carpet",
"minecraft:black_carpet",
"minecraft:moss_carpet"
]
}
{
"replace": false,
"values": [
"minecraft:bookshelf",
"minecraft:chest",
"minecraft:trapped_chest",
"minecraft:crafting_table",
"minecraft:furnace",
"minecraft:blast_furnace",
"minecraft:smoker",
"minecraft:enchanting_table",
"minecraft:anvil",
"minecraft:chipped_anvil",
"minecraft:damaged_anvil",
"minecraft:lectern",
"minecraft:barrel",
"minecraft:cartography_table",
"minecraft:fletching_table",
"minecraft:grindstone",
"minecraft:loom",
"minecraft:smithing_table",
"minecraft:stonecutter",
"minecraft:brewing_stand",
"minecraft:cauldron",
"minecraft:water_cauldron",
"minecraft:lava_cauldron",
"minecraft:powder_snow_cauldron",
"minecraft:jukebox",
"minecraft:bell",
"minecraft:decorated_pot"
]
}
{
"replace": false,
"values": [
"minecraft:flower_pot",
"minecraft:potted_oak_sapling",
"minecraft:potted_spruce_sapling",
"minecraft:potted_birch_sapling",
"minecraft:potted_jungle_sapling",
"minecraft:potted_acacia_sapling",
"minecraft:potted_cherry_sapling",
"minecraft:potted_dark_oak_sapling",
"minecraft:potted_mangrove_propagule",
"minecraft:potted_fern",
"minecraft:potted_dandelion",
"minecraft:potted_poppy",
"minecraft:potted_blue_orchid",
"minecraft:potted_allium",
"minecraft:potted_azure_bluet",
"minecraft:potted_red_tulip",
"minecraft:potted_orange_tulip",
"minecraft:potted_white_tulip",
"minecraft:potted_pink_tulip",
"minecraft:potted_oxeye_daisy",
"minecraft:potted_cornflower",
"minecraft:potted_lily_of_the_valley",
"minecraft:potted_wither_rose",
"minecraft:potted_red_mushroom",
"minecraft:potted_brown_mushroom",
"minecraft:potted_dead_bush",
"minecraft:potted_cactus",
"minecraft:potted_bamboo",
"minecraft:potted_azalea_bush",
"minecraft:potted_flowering_azalea_bush",
"minecraft:potted_crimson_fungus",
"minecraft:potted_warped_fungus",
"minecraft:potted_crimson_roots",
"minecraft:potted_warped_roots",
"minecraft:potted_torchflower"
]
}
{
"replace": false,
"values": [
"minecraft:glass",
"minecraft:glass_pane",
"minecraft:white_stained_glass",
"minecraft:orange_stained_glass",
"minecraft:magenta_stained_glass",
"minecraft:light_blue_stained_glass",
"minecraft:yellow_stained_glass",
"minecraft:lime_stained_glass",
"minecraft:pink_stained_glass",
"minecraft:gray_stained_glass",
"minecraft:light_gray_stained_glass",
"minecraft:cyan_stained_glass",
"minecraft:purple_stained_glass",
"minecraft:blue_stained_glass",
"minecraft:brown_stained_glass",
"minecraft:green_stained_glass",
"minecraft:red_stained_glass",
"minecraft:black_stained_glass",
"minecraft:white_stained_glass_pane",
"minecraft:orange_stained_glass_pane",
"minecraft:magenta_stained_glass_pane",
"minecraft:light_blue_stained_glass_pane",
"minecraft:yellow_stained_glass_pane",
"minecraft:lime_stained_glass_pane",
"minecraft:pink_stained_glass_pane",
"minecraft:gray_stained_glass_pane",
"minecraft:light_gray_stained_glass_pane",
"minecraft:cyan_stained_glass_pane",
"minecraft:purple_stained_glass_pane",
"minecraft:blue_stained_glass_pane",
"minecraft:brown_stained_glass_pane",
"minecraft:green_stained_glass_pane",
"minecraft:red_stained_glass_pane",
"minecraft:black_stained_glass_pane",
"minecraft:tinted_glass",
"minecraft:oak_door",
"minecraft:spruce_door",
"minecraft:birch_door",
"minecraft:jungle_door",
"minecraft:acacia_door",
"minecraft:dark_oak_door",
"minecraft:mangrove_door",
"minecraft:cherry_door",
"minecraft:bamboo_door",
"minecraft:crimson_door",
"minecraft:warped_door",
"minecraft:iron_door",
"minecraft:oak_trapdoor",
"minecraft:spruce_trapdoor",
"minecraft:birch_trapdoor",
"minecraft:jungle_trapdoor",
"minecraft:acacia_trapdoor",
"minecraft:dark_oak_trapdoor",
"minecraft:mangrove_trapdoor",
"minecraft:cherry_trapdoor",
"minecraft:bamboo_trapdoor",
"minecraft:crimson_trapdoor",
"minecraft:warped_trapdoor",
"minecraft:iron_trapdoor"
]
}
{
"replace": false,
"values": [
"minecraft:sculk",
"minecraft:sculk_sensor",
"minecraft:sculk_shrieker",
"minecraft:sculk_catalyst",
"minecraft:ancient_debris",
"minecraft:obsidian",
"minecraft:crying_obsidian",
"minecraft:reinforced_deepslate",
"minecraft:deepslate",
"minecraft:cobbled_deepslate",
"minecraft:tuff"
]
}
{
"replace": false,
"values": [
"minecraft:spawner",
"minecraft:soul_sand",
"minecraft:soul_soil",
"minecraft:nether_bricks",
"minecraft:red_nether_bricks",
"minecraft:nether_brick_fence",
"minecraft:magma_block",
"minecraft:netherrack",
"minecraft:crimson_nylium",
"minecraft:warped_nylium"
]
}
{
"replace": false,
"values": [
"minecraft:skeleton_skull",
"minecraft:skeleton_wall_skull",
"minecraft:wither_skeleton_skull",
"minecraft:wither_skeleton_wall_skull",
"minecraft:zombie_head",
"minecraft:zombie_wall_head",
"minecraft:creeper_head",
"minecraft:creeper_wall_head",
"minecraft:dragon_head",
"minecraft:dragon_wall_head",
"minecraft:piglin_head",
"minecraft:piglin_wall_head",
"minecraft:player_head",
"minecraft:player_wall_head",
"minecraft:bone_block",
"minecraft:wither_rose",
"minecraft:potted_wither_rose",
"minecraft:cobweb",
"minecraft:gravel",
"minecraft:mud"
]
}