Config
The config lives at config/midnightthoughts.json and is created on first launch.
A full explanation of every parameter is on the matching page in the sidebar. This page is the complete reference: the file as a whole, the in-game config screen, and the rules the mod applies when reading the file.
In-game config screen
Almost everything in the file can be changed without opening it.
| Loader | How to open |
|---|---|
| Forge, NeoForge | Mods list, select Midnight Thoughts, press Config |
| Fabric | Mod Menu, select Midnight Thoughts, press the config button |
The screen is split into five sections:
| Section | What is inside |
|---|---|
| Sleep overlay | Overlay, moon, stardust, space objects, slide times, fades, opacity, text and moon size, facts API, custom content, chat and HUD messages |
| Interface | Theme, Well Rested HUD position, hiding the Well Rested HUD and the sleeping players HUD, summary size |
| MVP scoring | MVP on or off, points, death penalty, MVP buff duration |
| Comfort | Comfort on or off, scan radius, nightmares, sleep block, all eight weights |
| Server behaviour | Phantom timer for non-sleepers, vanilla sleep messages |
The screen works from the main menu and in single player. Every option has a tooltip, and sliders show their units: seconds, milliseconds, percent, minutes or blocks. Changes are saved to midnightthoughts.json as soon as you leave a section, and in single player they apply to the running world right away.
Sliders cover the useful range of each setting, not the full range the file accepts. For example, the comfort weights slider goes from -10 to 10, while the file accepts -100 to 100. If you need an extreme value, write it in the file.
Well Rested levels are not in the config screen. Attributes and effects are lists that do not fit into sliders, so they are edited in the file only. See Well Rested.
While you are connected to a server, the config screen shows no sections, only a note. On a server every setting comes from the server's own config file, so editing your local copy there would change nothing.
Full config
{
"sleepOverlay": {
"minSlideDisplayTimeMs": 6000,
"maxSlideDisplayTimeMs": 8000,
"fadeInDurationMs": 300,
"fadeOutDurationMs": 300,
"overlayOpacity": 0.4,
"textOpacity": 1.0,
"imageOpacity": 0.6,
"specialSlideChance": 0.05,
"enableStarDust": true,
"enableSpaceObjects": true,
"showSlideProgress": true,
"enableOverlay": true,
"enableImage": true,
"enableDailySummaryScreen": true,
"useFactsApi": false,
"userContentReplaces": false,
"hideChatWhenSleeping": true,
"hideHudMessagesWhenSleeping": true,
"textScale": 1.0,
"imageScale": 1.0
},
"wellRested": {
"enabled": true,
"levels": {
"level5": {
"durationMinutes": 15,
"regenBonus": 0.05,
"attributes": [
{
"id": "minecraft:movement_speed",
"operation": "add_multiplied_base",
"phase1": 0.25,
"phase2": 0.15,
"phase3": 0.08
},
{
"id": "minecraft:attack_damage",
"operation": "add_value",
"phase1": 1.5,
"phase2": 1.0,
"phase3": 0.5
},
{
"id": "minecraft:block_break_speed",
"operation": "add_multiplied_base",
"phase1": 0.25,
"phase2": 0.14,
"phase3": 0.07
},
{
"id": "minecraft:attack_speed",
"operation": "add_multiplied_base",
"phase1": 0.07,
"phase2": 0.04,
"phase3": 0.02
},
{
"id": "minecraft:max_health",
"operation": "add_value",
"phase1": 10.0,
"phase2": 10.0,
"phase3": 10.0
}
],
"effects": []
},
"level4": {
"durationMinutes": 10,
"regenBonus": 0.04,
"attributes": [
{
"id": "minecraft:movement_speed",
"operation": "add_multiplied_base",
"phase1": 0.2,
"phase2": 0.12,
"phase3": 0.06
},
{
"id": "minecraft:attack_damage",
"operation": "add_value",
"phase1": 1.0,
"phase2": 0.75,
"phase3": 0.5
},
{
"id": "minecraft:block_break_speed",
"operation": "add_multiplied_base",
"phase1": 0.2,
"phase2": 0.11,
"phase3": 0.06
},
{
"id": "minecraft:attack_speed",
"operation": "add_multiplied_base",
"phase1": 0.06,
"phase2": 0.03,
"phase3": 0.02
},
{
"id": "minecraft:max_health",
"operation": "add_value",
"phase1": 8.0,
"phase2": 8.0,
"phase3": 8.0
}
],
"effects": []
},
"level1": {
"durationMinutes": 3,
"regenBonus": 0.01,
"attributes": [
{
"id": "minecraft:movement_speed",
"operation": "add_multiplied_base",
"phase1": 0.08,
"phase2": 0.04,
"phase3": 0.02
},
{
"id": "minecraft:attack_damage",
"operation": "add_value",
"phase1": 0.25,
"phase2": 0.25,
"phase3": 0.25
},
{
"id": "minecraft:block_break_speed",
"operation": "add_multiplied_base",
"phase1": 0.07,
"phase2": 0.04,
"phase3": 0.02
},
{
"id": "minecraft:attack_speed",
"operation": "add_multiplied_base",
"phase1": 0.02,
"phase2": 0.01,
"phase3": 0.01
},
{
"id": "minecraft:max_health",
"operation": "add_value",
"phase1": 2.0,
"phase2": 2.0,
"phase3": 2.0
}
],
"effects": []
},
"level3": {
"durationMinutes": 7,
"regenBonus": 0.03,
"attributes": [
{
"id": "minecraft:movement_speed",
"operation": "add_multiplied_base",
"phase1": 0.16,
"phase2": 0.09,
"phase3": 0.04
},
{
"id": "minecraft:attack_damage",
"operation": "add_value",
"phase1": 0.75,
"phase2": 0.5,
"phase3": 0.25
},
{
"id": "minecraft:block_break_speed",
"operation": "add_multiplied_base",
"phase1": 0.15,
"phase2": 0.08,
"phase3": 0.04
},
{
"id": "minecraft:attack_speed",
"operation": "add_multiplied_base",
"phase1": 0.05,
"phase2": 0.03,
"phase3": 0.01
},
{
"id": "minecraft:max_health",
"operation": "add_value",
"phase1": 6.0,
"phase2": 6.0,
"phase3": 6.0
}
],
"effects": []
},
"level2": {
"durationMinutes": 5,
"regenBonus": 0.02,
"attributes": [
{
"id": "minecraft:movement_speed",
"operation": "add_multiplied_base",
"phase1": 0.12,
"phase2": 0.06,
"phase3": 0.03
},
{
"id": "minecraft:attack_damage",
"operation": "add_value",
"phase1": 0.5,
"phase2": 0.25,
"phase3": 0.25
},
{
"id": "minecraft:block_break_speed",
"operation": "add_multiplied_base",
"phase1": 0.11,
"phase2": 0.06,
"phase3": 0.03
},
{
"id": "minecraft:attack_speed",
"operation": "add_multiplied_base",
"phase1": 0.04,
"phase2": 0.02,
"phase3": 0.01
},
{
"id": "minecraft:max_health",
"operation": "add_value",
"phase1": 4.0,
"phase2": 4.0,
"phase3": 4.0
}
],
"effects": []
}
}
},
"mvp": {
"enabled": true,
"minScoreRequired": 10,
"pointsPerDistance100": 2,
"pointsPerBlock": 3,
"pointsPerMob": 15,
"pointsPerJump10": 1,
"penaltyPerDeath": 30,
"mvpWellRestedDurationMinutes": 21
},
"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
},
"server": {
"resetPhantomTimerForNonSleepers": true,
"suppressVanillaSleepMessages": true
},
"ui": {
"theme": "classic",
"wellRestedHudPosition": "left",
"hideWellRestedHud": false,
"hideSleepingPlayersHud": false,
"summaryScale": 0
}
}
The file above is from 1.21.1 and 26.1.2. On 1.20.1 two things differ in the Well Rested levels: attribute ids use the old generic. names (minecraft:generic.movement_speed and so on), and there is no block_break_speed entry, because Minecraft has no mining speed attribute before 1.21. Everything else is identical. See Well Rested.
The levels are written in whatever order the file was saved in, so level5 may come before level1. The order does not matter.
Where each section is explained
| Section | Explained on |
|---|---|
sleepOverlay | Sleep overlay, plus custom facts for useFactsApi and userContentReplaces, and summary screen for enableDailySummaryScreen |
wellRested | Well Rested |
mvp | Player statistics |
comfort | Comfort system |
server | For servers |
ui | See the table below |
UI settings
The ui section is spread across several features, so here it is in one place:
| Parameter | Default | Description |
|---|---|---|
theme | "classic" | Theme of the summary screen and the sleeping players HUD. One of classic, vanilla, tech, magic. See summary screen |
wellRestedHudPosition | "left" | Where the Rested bar sits on screen. One of left, bar, right. See Well Rested |
hideWellRestedHud | false | Hides the Rested effect bar with its level and remaining time. See Well Rested |
hideSleepingPlayersHud | false | Hides the Sleeping 2/5 plate shown while anyone on the server is asleep. See for servers |
summaryScale | 0 | Size of the summary screen. 0 is Auto, 1 to 4 is a fixed size. Personal setting, never taken from the server. See summary screen |
Both hide flags are false by default, which means everything is shown. Setting one to true hides that element for every player on the server.
hideThemeSwitchButton no longer exists. The gear button on the summary screen was removed, the theme is now picked in the config screen. If the key is still in an old file, it is dropped on the next save.
Where the values come from
Most settings are server-authoritative. When you join a server, it sends its config to your client, and that copy wins over your local file for the session. This keeps overlay timings, opacity, comfort rules and the theme consistent for everyone.
The only exception is summaryScale. It depends on each player's monitor, so it is always read from the player's own file, also on a server.
In single player your own file is used, and the config screen edits it directly.
Changing the config on a live server does not require a restart:
/midnightthoughts reload config
The file is re-read, validated, and pushed to everyone online. If the file got messy and you want to start over, /midnightthoughts config recreate backs it up and writes a fresh default one. Full command reference on the commands page.
Validation
The config is checked every time it is read. Values that make no sense are corrected rather than rejected, and each correction is written to the server log so you can see what happened.
- Clamping
- Invalid values
- Missing keys
- Broken files
Out-of-range numbers are pulled back to the nearest valid value.
| Setting | Allowed range |
|---|---|
minSlideDisplayTimeMs, maxSlideDisplayTimeMs | 500 to 120000 |
fadeInDurationMs, fadeOutDurationMs | 0 to 10000 |
overlayOpacity, textOpacity, imageOpacity, specialSlideChance | 0.0 to 1.0 |
textScale, imageScale | 0.5 to 1.5 |
summaryScale | 0 to 4 |
durationMinutes, mvpWellRestedDurationMinutes | 1 to 1440 |
regenBonus | 0.0 to 1.0 |
Attribute phase1 / phase2 / phase3 | -10000 to 10000 |
Effect phase1 / phase2 / phase3 | -1 to 255 |
scanRadius | 0 to 8 |
nightmareThreshold, sleepBlockThreshold | -100 to 100 |
| Comfort weights | -100 to 100 |
minScoreRequired | 0 to 1000000 |
| Other MVP point values | 0 to 100000 |
If maxSlideDisplayTimeMs ends up below minSlideDisplayTimeMs, it is raised to match.
"theme" only accepts classic, vanilla, tech or magic. Anything else resets to classic.
"wellRestedHudPosition" only accepts left, bar or right. Anything else resets to left.
An attribute "operation" that is not one of the known operations resets to add_value.
An attribute or effect entry without an id is dropped. An entry whose id does not exist in the game, for example from a mod that is not installed, is kept in the file but skipped in game, with one warning in the log.
Numbers that are not numbers at all, such as NaN or Infinity, reset to their defaults instead of being clamped.
A missing Well Rested level is restored from defaults, so deleting level3 from the file is a valid way to reset just that one.
Any key absent from the file is filled in with its default, and the file is rewritten so you can see and edit it. Values already present are preserved.
Deleting a key, or a whole section, is therefore a valid way to reset it.
A Well Rested level without an attributes list gets the default list for that level. An empty list [] is kept as it is and means "no attribute bonuses".
If the file cannot be parsed at all, for example because of a stray comma or a truncated write, the mod does not crash and does not silently overwrite your work. The damaged file is renamed to midnightthoughts.json.broken and a fresh default config is generated.
Your original is still there under the .broken name. Fix the syntax error and rename it back.
The Well Rested levels changed format in 1.6. The old keys (speedPhase1, strengthPhase1, hastePhase1, attackSpeedPhase1, healthBonus and the rest) are no longer read, and each level gets the new default attributes list. durationMinutes and regenBonus keep your values. If you had tuned your buffs, write your values again in the new format. Everything outside the levels carries over as it was.
Safe writing
The config and the statistics file are written atomically: the mod writes to a temporary file and then swaps it into place. A crash or a power cut in the middle of a save leaves the previous version intact instead of a half-written file.
Statistics are also kept in memory while the server runs and flushed on player disconnect and on shutdown, rather than re-read from disk on every access.