Skip to main content

Config

The config lives at config/midnightthoughts.json and is created on first launch.

info

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.

LoaderHow to open
Forge, NeoForgeMods list, select Midnight Thoughts, press Config
FabricMod Menu, select Midnight Thoughts, press the config button

The screen is split into five sections:

SectionWhat is inside
Sleep overlayOverlay, moon, stardust, space objects, slide times, fades, opacity, text and moon size, facts API, custom content, chat and HUD messages
InterfaceTheme, Well Rested HUD position, hiding the Well Rested HUD and the sleeping players HUD, summary size
MVP scoringMVP on or off, points, death penalty, MVP buff duration
ComfortComfort on or off, scan radius, nightmares, sleep block, all eight weights
Server behaviourPhantom 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.

note

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.

warning

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.

On a server

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
}
}
Version differences

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.

note

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​

SectionExplained on
sleepOverlaySleep overlay, plus custom facts for useFactsApi and userContentReplaces, and summary screen for enableDailySummaryScreen
wellRestedWell Rested
mvpPlayer statistics
comfortComfort system
serverFor servers
uiSee the table below

UI settings​

The ui section is spread across several features, so here it is in one place:

ParameterDefaultDescription
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
hideWellRestedHudfalseHides the Rested effect bar with its level and remaining time. See Well Rested
hideSleepingPlayersHudfalseHides the Sleeping 2/5 plate shown while anyone on the server is asleep. See for servers
summaryScale0Size of the summary screen. 0 is Auto, 1 to 4 is a fixed size. Personal setting, never taken from the server. See summary screen
note

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.

Removed in 1.6

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.

tip

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.

Out-of-range numbers are pulled back to the nearest valid value.

SettingAllowed range
minSlideDisplayTimeMs, maxSlideDisplayTimeMs500 to 120000
fadeInDurationMs, fadeOutDurationMs0 to 10000
overlayOpacity, textOpacity, imageOpacity, specialSlideChance0.0 to 1.0
textScale, imageScale0.5 to 1.5
summaryScale0 to 4
durationMinutes, mvpWellRestedDurationMinutes1 to 1440
regenBonus0.0 to 1.0
Attribute phase1 / phase2 / phase3-10000 to 10000
Effect phase1 / phase2 / phase3-1 to 255
scanRadius0 to 8
nightmareThreshold, sleepBlockThreshold-100 to 100
Comfort weights-100 to 100
minScoreRequired0 to 1000000
Other MVP point values0 to 100000

If maxSlideDisplayTimeMs ends up below minSlideDisplayTimeMs, it is raised to match.

Updating from 1.5.x

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.

note

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.