All Mods Resource Packs Data Packs Shaders Modpacks Plugins
Midnight Thoughts

Midnight Thoughts

by Iliiasik • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions
Logo Head Overlay Summary Well Rested Nightmares
Text description

Midnight Thoughts improves the mechanics of sleep, making it more rewarding and memorable. See thoughts, facts, nightmares while resting. Players who slept overnight receive the rest effect and their overall statistics from the last time they slept.

The mod is modpack-friendly, every feature can be disabled or customized

While you sleep, you will see random slides featuring facts, quotes, and much more. By default, slide data is sourced from a local database that supports 13 languages. For certain languages, you can enable the Useless Facts API in the mod's configuration settings to fetch slides from the internet, (More details can be found in the mod's wiki), or you can add your own facts, thoughts and nightmares!

The moon in the overlay always displays the phase that is currently in the game, there are 8 of them in total.

Each player has their own statistics, and everyone can see each other’s results. Results are displayed after sleep. The summary highlights the MVP - the most active player, along with personal bests and mini achievements. The default server theme can be set in the mod's config. Each player can choose their own theme. Four design themes are available: Vanilla, Classic, Tech, and Magic.

The mod adds a comfort system. When the player goes to bed, the player's rest level after sleep depends on the comfort level around the bed. The comfort level is determined by certain blocks, furniture, plants, etc., located around the bed. In addition to blocks that increase comfort, there are also blocks that decrease it.

Upon waking, the player enters the Rested state. It has up to five levels, each increasing effect strength and duration. The effect progresses through three phases, gradually weakening from phase 1 (strongest) to phase 3 (weakest).

Well Rested provides bonuses to speed, strength, and block mining speed, increases the player's HP, and also adds gradual health regeneration. The effect of the additional health and regeneration doesn't diminish over time, unlike other buffs.

When playing with friends, MVP always receives the most powerful buff, regardless of the conditions under which it was inactivated. MVP's buff lasts longer than the standard level 5 buff.

If the sleeping conditions are bad, the player will have nightmares, but if the sleeping conditions are terrible, the player will not be able to go to sleep at all.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.21.1
Neoforge
8d ago 1
1.21.1
Neoforge
1mo ago 1
1.20.1
Fabric
2mo ago 1
1.21.11
Fabric
2mo ago 1
1.21.1
Fabric
2mo ago 1
26.1.2
Fabric
2mo ago 1
1.20.1
Fabric
2mo ago 1
1.20.1
Forge
2mo ago 1
1.21.11
Neoforge
2mo ago 1
1.21.1
Neoforge
2mo ago 1
26.1.2
Neoforge
2mo ago 1
26.1.2
Neoforge
2mo ago 1
1.21.11
Neoforge
2mo ago 1
1.21.1
Neoforge
2mo ago 1
1.20.1
Forge
2mo ago 1
26.1.2
Fabric
2mo ago 1
1.21.11
Neoforge
2mo ago 1
1.21.1
Neoforge
2mo ago 1
26.1.2
Fabric
3mo ago 1
26.1.2
Neoforge
3mo ago 1
26.1.2
Neoforge
3mo ago 1
1.20.1
Forge
3mo ago 1
1.21.11
Neoforge
3mo ago 1
1.21.1
Neoforge
3mo ago 1
1.21.11
Neoforge
3mo ago 1
1.20.1
Forge
3mo ago 1
1.21.1
Neoforge
3mo ago 1
1.20.1
Forge
3mo ago 1
1.20.1
Forge
4mo ago 1
1.21.1
Fabric
4mo ago 1
1.21.1
Neoforge
4mo ago 1
1.20.1
Fabric
4mo ago 1
1.20.1
Forge
4mo ago 1
1.21.1
Neoforge
5mo ago 1
1.20.1
Fabric
5mo ago 1
1.21.1
Fabric
5mo ago 1
1.21.11
Fabric
5mo ago 1
1.20.1
Forge
5mo ago 1
1.21.11
Neoforge
5mo ago 1
1.20.1
Forge
5mo ago 1
1.21.11
Fabric
5mo ago 1
1.20.1
Fabric
5mo ago 1
1.21.11
Neoforge
5mo ago 1
1.21.1
Fabric
5mo ago 1
1.21.1
Neoforge
5mo ago 1
1.21.11
Fabric
5mo ago 1
1.21.11
Neoforge
5mo ago 1
1.20.1
Fabric
5mo ago 1
1.21.1
Neoforge
6mo ago 1
1.21.1
Fabric
6mo ago 1
1.20.1
Forge
6mo ago 1
1.21.11
Fabric
6mo ago 1
1.21.1
Fabric
6mo ago 1
1.20.1
Fabric
6mo ago 1
1.21.11
Neoforge
6mo ago 1
1.21.1
Neoforge
6mo ago 1
1.20.1
Forge
7mo ago 1
1.20.1
Fabric
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.21.1
Fabric
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.20.1
Fabric
7mo ago 1
1.21.1
Fabric
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.20.1
Forge
7mo ago 1
1.20.1
Fabric
7mo ago 1
1.21.1
Fabric
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.20.1
Fabric
7mo ago 1
1.21.1
Fabric
7mo ago 1
1.20.1
Forge
7mo ago 1
1.20.1
Fabric
7mo ago 1
1.21.11
Neoforge
7mo ago 1
1.21.1
Neoforge
7mo ago 1
1.20.1
Forge
7mo ago 1
1.21.11
Fabric
7mo ago 1
1.21.1
Fabric
7mo ago 1
1.21.11
Fabric
8mo ago 1
1.20.1
Forge
8mo ago 1
1.21.1
Neoforge
8mo ago 1
1.21.11
Neoforge
8mo ago 1
1.21.1
Neoforge
8mo ago 1
1.21.11
Neoforge
8mo ago 1
1.21.1
Neoforge
8mo ago 1
1.21.11
Neoforge
8mo ago 1
1.21.11
Neoforge
8mo ago 1
1.21.1
Neoforge
8mo ago 1
1.20.1
Forge
8mo ago 1
1.20.1
Fabric
8mo ago 1
1.21.11
Fabric
8mo ago 1
1.21.1
Fabric
8mo ago 1
1.20.1
Forge
8mo ago 1
1.20.1
Forge
8mo ago 1
1.20.1
Fabric
8mo ago 1
1.21.11
Fabric
8mo ago 1
1.21.1
Fabric
8mo ago 1
1.20.1
Forge
9mo ago 1
1.21.11
Fabric
9mo ago 1
1.21.1
Fabric
9mo ago 1
1.20.1
Fabric
9mo ago 1
1.20.1
Fabric
9mo ago 1
1.20.1
Forge
9mo ago 1
1.21.11
Fabric
9mo ago 1
1.20.1
Fabric
9mo ago 1
1.21.1
Fabric
9mo ago 1
1.21.1
Fabric
10mo ago 1
1.21.1
Fabric
10mo ago 1
A new overlay layer featuring space-themed objects has been added (this can be disabled in the config). A configuration settings screen has finally been implemented! Accessible in single-player mode, this screen allows you to edit all settings, with the exception of the "Well Rested" effect, which must still be modified directly within the config file. Compatibility with MCA Reborn has been added, if MCA Reborn is installed, the summary screen will now display the player's MCA Reborn skin instead of the default vanilla skin. Minor bugs related to content loading have been fixed, and the summary screen can now be closed by pressing the inventory key (default: E). The network protocol has been updated, a 1.5.7 client cannot join a 1.5.8 server, and vice versa
Added compatibility with Better Days, Seamless Sleep, and other mods that alter the night-skipping mechanic. The "Well Rested" effect is now fully customizable, allowing you to add or remove any effect or attribute from any mod, disable default settings, and add any vanilla effects via the config file. Also includes update 1.5.6
## Midnight Thoughts 1.5.6

### Comfort rework
  • Comfort is now measured **once**, at the moment you enter the bed, from the bed's position.
  • Nightmares and blocked sleep are decided from that single value — the warning you get and the effect you receive can no longer disagree.
  • Blocks placed around you while you sleep no longer change your Well Rested level.
  • /midnightthoughts comfort still measures where you are standing.

### Sleep overlay
  • The nightmare overlay is picked before sleep begins — the regular overlay no longer flashes first.
  • Vanilla action bar messages are hidden while the overlay is on screen.
  • New: separate scale settings for the overlay image and text (sleepOverlay.imageScale, sleepOverlay.textScale, 0.5–1.5).
  • New: sleepOverlay.hideHudMessagesWhenSleeping.

### Server
  • New: server.suppressVanillaSleepMessages — hides "N/M players sleeping" and "no sleep will skip this night".

### Fixes
  • Portuguese (Brazil): corrected summary labels.

### API
  • NightmareCallback now fires exactly once per sleep.

> **Important:** the network protocol changed in this version. Client and server must both be updated to 1.5.6 — mixing 1.5.6 with 1.5.5 will not work.
# Midnight Thoughts 1.5.5

## Added

  • /midnightthoughts wellrested info [player] — shows the current level, phase, time left and total duration of the Well Rested effect. Handy when reporting a bug.

## Fixed

  • Saving the client config no longer fails when another program briefly holds the file. The write is now retried before falling back to a non-atomic replace.
  • Well Rested buffs are no longer left applied when the stored effect state is missing, for example after restoring a partial world backup.
# Midnight Thoughts 1.5.5

## Added

  • /midnightthoughts wellrested info [player] — shows the current level, phase, time left and total duration of the Well Rested effect. Handy when reporting a bug.

## Fixed

  • Saving the client config no longer fails when another program briefly holds the file. The write is now retried before falling back to a non-atomic replace.
  • Well Rested buffs are no longer left applied when the stored effect state is missing, for example after restoring a partial world backup.
# Midnight Thoughts 1.5.5

## Added

  • /midnightthoughts wellrested info [player] — shows the current level, phase, time left and total duration of the Well Rested effect. Handy when reporting a bug.

## Fixed

  • Saving the client config no longer fails when another program briefly holds the file. The write is now retried before falling back to a non-atomic replace.
  • Well Rested buffs are no longer left applied when the stored effect state is missing, for example after restoring a partial world backup.
# Midnight Thoughts 1.5.4

## Balance

  • Well Rested buffs toned down by default: movement speed halved, mining and attack speed reduced, regeneration halved. Health bonus unchanged.
  • Strength now adds flat attack damage like the Strength potion, instead of a percentage that was barely noticeable.
  • Existing configs keep your current values — delete or edit the config file to pick up the new defaults.

## Added

  • The Well Rested bar pulses during the last 10 seconds before the effect expires.

## Fixed

  • Air bubbles no longer shift upward when the Well Rested HUD is hidden in the config.
  • The bar no longer freezes at full after changing the effect duration while the effect is active.
  • In the bar position the HUD is no longer stretched — the fill lines up with the scale exactly.
  • The sleeping players HUD fades in and out again instead of popping in.
# Midnight Thoughts 1.5.2

## Added

  • /midnightthoughts comfort [target] — the comfort report can now be run on another player. It also works from the server console and command blocks, which the self-only version could not do.
  • ui.hideSleepingPlayersHud — hides the "Sleeping X/Y" plate, matching the existing hideWellRestedHud and hideThemeSwitchButton options. Defaults to false, so nothing changes unless you turn it on.

## Fixed

  • The daily summary was shown to a player who had slept, got up during the night on their own, and was afterwards refused sleep by a nightmare. A refused attempt no longer counts as going back to bed. *(Forge 1.20.1 only — the NeoForge builds were never affected.)*

## Notes

  • The network protocol was bumped to **3**. Client and server both need 1.5.2; a 1.5.1 client will be rejected by a 1.5.2 server.
  • NeoForge 1.21.1** goes straight from 1.5 to 1.5.2, so this build also carries everything from 1.5.1: ten additional languages (thirteen in total, 4446 dream entries), config validation with migration and automatic backup of a corrupted file, atomic writes for the config and the stats file, an in-memory stats cache, the redesigned nightmare overlay, and a pile of HUD and summary fixes.
  • KubeJS users on NeoForge 1.21.1**: MidnightThoughts.getComfort(player) now returns the comfort *level* (0–5) instead of the raw point total. This shipped in 1.5.1 on Forge and reaches this loader now. Scripts comparing that value against a threshold need to be checked.
# Midnight Thoughts 1.5.1

> **Client and server must both update.** The network packet format changed and the protocol
> version was bumped. A 1.5 client cannot connect to a 1.5.1 server.

## Languages

Support grew from 3 to 13 languages. Added Russian, Ukrainian, Polish, French, Italian,
Brazilian Portuguese, Turkish, Chinese, Japanese and Korean.

The entire interface and every dream slide is translated — 4,446 entries in total. The language
follows your game settings automatically. The facts API only supports English and German, so on
any other language it turns itself off and the bundled slides are used instead.

## Interface

  • New nightmare visuals: a breathing red vignette that draws in and opens back up, replacing the star dust
  • Achievement badge text is now centred
  • Stat labels reworded: **Mined**, **Traveled**, **Slain**, **Leaps**
## Fixes

  • A malformed config file no longer crashes the mod on startup; the broken file is backed up
  • A malformed stats file no longer crashes the server when a player joins
  • Configs and stats are written atomically — a crash mid-save no longer wipes your settings or progress
  • Chinese, Japanese and Korean text now wraps properly instead of running off the screen
  • Star dust actually animates
  • The facts API recovers after a network hiccup instead of staying off until the game restarts
  • The sleeping counter no longer sticks after leaving a server
  • Client state is properly cleared on disconnect
  • German content restored: two empty files and 245 misaligned entries
  • Removed contradictory and duplicate facts
  • Numbers are formatted identically on every locale
## Configuration

  • Values are validated: out-of-range numbers are clamped, invalid ones reset to defaults
  • Migration on update: the new schema wins, your existing values carry over, obsolete keys are dropped
  • useFactsApi now defaults to **off**
  • User content is cached — apply your edits with /midnightthoughts reload content
## Performance

Reworked how stats and user content files are handled, cutting server tick load when players
wake up and when they join.
# Midnight Thoughts 1.5.1

> **Client and server must both update.** The network packet format changed and the protocol
> version was bumped. A 1.5 client cannot connect to a 1.5.1 server.

## Languages

Support grew from 3 to 13 languages. Added Russian, Ukrainian, Polish, French, Italian,
Brazilian Portuguese, Turkish, Chinese, Japanese and Korean.

The entire interface and every dream slide is translated — 4,446 entries in total. The language
follows your game settings automatically. The facts API only supports English and German, so on
any other language it turns itself off and the bundled slides are used instead.

## Interface

  • New nightmare visuals: a breathing red vignette that draws in and opens back up, replacing the star dust
  • Achievement badge text is now centred
  • Stat labels reworded: **Mined**, **Traveled**, **Slain**, **Leaps**

## Fixes

  • A malformed config file no longer crashes the mod on startup; the broken file is backed up
  • A malformed stats file no longer crashes the server when a player joins
  • Configs and stats are written atomically — a crash mid-save no longer wipes your settings or progress
  • Chinese, Japanese and Korean text now wraps properly instead of running off the screen
  • Star dust actually animates
  • The facts API recovers after a network hiccup instead of staying off until the game restarts
  • The sleeping counter no longer sticks after leaving a server
  • Client state is properly cleared on disconnect
  • German content restored: two empty files and 245 misaligned entries
  • Removed contradictory and duplicate facts
  • Numbers are formatted identically on every locale

## Configuration

  • Values are validated: out-of-range numbers are clamped, invalid ones reset to defaults
  • Migration on update: the new schema wins, your existing values carry over, obsolete keys are dropped
  • useFactsApi now defaults to **off**
  • User content is cached — apply your edits with /midnightthoughts reload content

## Performance

Reworked how stats and user content files are handled, cutting server tick load when players
wake up and when they join.

## For script authors

MidnightThoughts.getComfort() now returns the value **after** the comfortCalculated event, so
changes made through setLevel are reflected. It also reads from the cache instead of rescanning
blocks on every call.
[1.5] Midnight Thoughts 1.5 by Iliiasik on Jul 26, 2026
Download
# Midnight Thoughts 1.5 — NeoForge 1.20.1

  • Theme: control, compatibility & integrations.**

Version 1.5 makes the mod fully data-driven, modular, and scriptable. Retune every subsystem from config, toggle any part off, and react to (or drive) the mod from KubeJS — while it stays completely self-sufficient when KubeJS isn't installed.


## Redesigned sleep overlay

The sleep overlay was rebuilt from the ground up:

  • New layout** — the moon-phase image now sits **above** the text, centered and more compact, instead of crowding it.
  • Vignette + star dust** — a soft vignette frames the screen and gentle drifting "star dust" animates in the background for atmosphere.
  • Crossfade between slides** — slides now fade smoothly into one another instead of hard-cutting.
  • Slide progress indicator** — a subtle progress bar shows how far along the current slide is.
  • Auto-fitting text** — text scales to fit cleanly regardless of length, so long facts and short thoughts both look right.
  • Configurable fades & opacity** — fadeInDurationMs, fadeOutDurationMs, overlayOpacity, textOpacity and imageOpacity are all in config and synced from the server.

New toggles: enableStarDust, showSlideProgress.


## Data-driven comfort

Comfort used to sum hardcoded +1 / -1 values. Now the weights and thresholds live in ComfortSettings:

  • weights** per category — lighting, carpet, furniture, decoration, structure (positive) and macabre, hostile, dark (negative). Defaults keep the old behaviour, but every value is tunable.
  • Threshold semantics** — a rule fires when comfortLevel <= threshold.
  • nightmareThreshold (default **-1**) — nightmares at comfort <= -1.
  • sleepBlockThreshold (default **-2**) — sleep blocked at comfort <= -2.
  • Which blocks belong to a category is still driven by **tags** (datapack) — unchanged.
  • Comfort recalculates on /reload (cache is cleared).


## Flexible /reload

/midnightthoughts reload [config | achievements | content | all] (permission level 2):

  • config** — re-read the config and re-broadcast it to all clients.
  • achievements** — reload achievement definitions and re-broadcast.
  • content** — reload user content (facts / slides) and re-broadcast.
  • all** — everything at once.

Config changes apply **in place**, so every live system reads the fresh values instantly — no restart. Already-applied well-rested buffs aren't recalculated (they live in NBT); new applications use the new values.


## Admin commands

  • /midnightthoughts comfort — debug the comfort around you: level, which categories were found (● / ○), and each category's contribution.
  • /midnightthoughts wellrested grant <targets> <1-5> — grant well-rested manually.
  • /midnightthoughts wellrested clear <targets> — remove it.

All require permission level 2.


## Full modularity

Master toggles for every subsystem, so a pack can disable any part without touching code:

  • wellRested.enabled
  • comfort.enabled, comfort.nightmareEnabled, comfort.sleepBlockEnabled
  • mvp.enabled
  • sleepOverlay.enableOverlay, enableImage, enableDailySummaryScreen, useFactsApi
  • server.resetPhantomTimerForNonSleepers


## Java Event API

A pure-Java API on the Forge event bus (mt.api.event), always available and independent of any third-party mod. Any mod can subscribe with plain Java.

| Event | Fields | Notes |
|-------|--------|-------|
| WellRestedAppliedEvent | player, level, isMvp, durationTicks | Fired on normal grant and on MVP grant |
| WellRestedExpiredEvent | player | Natural expiry, death, manual clear, or disabled-branch |
| NightmareEvent | player, comfortLevel | Fired when a player sleeps into a nightmare |
| MvpDeterminedEvent | mvp | Fired at day rollover when an MVP is chosen |
| ComfortCalculatedEvent | player, level, setLevel(int) | **Overridable** — listeners can rewrite the computed comfort |

ComfortCalculatedEvent is posted before the result is cached, so an override changes the value everyone downstream sees (nightmare / sleep-block checks included).


## KubeJS integration (optional)

Layered design: the Java Event API above is always on; the KubeJS bridge is a **soft/optional dependency**. Without KubeJS the mod is fully self-sufficient — no errors, no crash.

### Events (mod → script)

Event group: **MidnightThoughtsEvents** (server events).

``js
MidnightThoughtsEvents.wellRestedApplied(event => {
// event.player, event.level, event.mvp (boolean), event.durationTicks
let mins = Math.max(1, Math.floor(event.durationTicks / 1200))
event.player.tell('Well-rested ' + event.level + ' for ' + mins + ' min')
})

MidnightThoughtsEvents.wellRestedExpired(event => {
// event.player
event.player.tell('The rested feeling fades...')
})

MidnightThoughtsEvents.nightmare(event => {
// event.player, event.comfortLevel
event.player.runCommandSilent('effect give @s minecraft:nausea 12 0 true')
})

MidnightThoughtsEvents.mvpDetermined(event => {
// event.mvp = the MVP ServerPlayer
event.mvp.server.tell(event.mvp.username + ' is the MVP of the day!')
})

MidnightThoughtsEvents.comfortCalculated(event => {
// event.player, event.level, event.setLevel(int) — override the result
if (event.player.block.canSeeSky) {
event.setLevel(event.level + 1)
}
})
`

### Bindings (script → mod)

Global object: **
MidnightThoughts**.

| Binding | Signature | Effect |
|---------|-----------|--------|
|
grantWellRested | (player, level) | Apply well-rested at the given level |
|
grantMvp | (player) | Apply the MVP-level well-rested |
|
clearWellRested | (player) | Remove the buff **and** fire WellRestedExpiredEvent |
|
hasWellRested | (player) → boolean | Is the buff active |
|
getLevel | (player) → int | Current well-rested level (0 if none) |
|
getComfort | (player) → int | Raw comfort at the player (no event fired, recursion-safe) |

`js
PlayerEvents.inventoryChanged(event => {
if (event.item.id == 'minecraft:nether_star') {
MidnightThoughts.grantWellRested(event.player, 5)
event.player.tell('§dThe star fills you with restful energy...')
}
})
`

getComfort reads raw comfort without posting ComfortCalculatedEvent, so calling it from a comfortCalculated handler cannot recurse. grant* / clearWellRested respect wellRested.enabled.


## Catalogue branding

Custom **icon**, **banner**, **background** and links (website / issues) in the mod list when Catalogue is installed.


## Fixed / Improved

  • mvp.enabled` now actually gates MVP selection (was a dead flag).
  • Config changes apply in place on reload — live systems pick them up instantly.
  • Comfort cache is cleared on reload so new weights/thresholds take effect immediately.
  • Overlay rendering fixes: no more content dimming or alpha build-up; fades and opacity behave correctly.


## Performance

Profiled with spark on a dedicated server (multiplayer, KubeJS loaded, active sleeping / nightmares): **~0.13% of server-tick time**, a flat **20 TPS**, MSPT 4–14 ms against a 50 ms budget.

  • Requires NeoForge 1.20.1.**


Full documentation will be available soon on the Wiki.
[1.5] Midnight Thoughts 1.5 by Iliiasik on Jul 26, 2026
Download
Change useFactsApi default parameter from true to false

Version 1.5 changelog:
# Midnight Thoughts 1.5 — Forge 1.20.1

  • Theme: control, compatibility & integrations.**

Version 1.5 makes the mod fully data-driven, modular, and scriptable. Retune every subsystem from config, toggle any part off, and react to (or drive) the mod from KubeJS — while it stays completely self-sufficient when KubeJS isn't installed.


## Redesigned sleep overlay

The sleep overlay was rebuilt from the ground up:

  • New layout** — the moon-phase image now sits **above** the text, centered and more compact, instead of crowding it.
  • Vignette + star dust** — a soft vignette frames the screen and gentle drifting "star dust" animates in the background for atmosphere.
  • Crossfade between slides** — slides now fade smoothly into one another instead of hard-cutting.
  • Slide progress indicator** — a subtle progress bar shows how far along the current slide is.
  • Auto-fitting text** — text scales to fit cleanly regardless of length, so long facts and short thoughts both look right.
  • Configurable fades & opacity** — fadeInDurationMs, fadeOutDurationMs, overlayOpacity, textOpacity and imageOpacity are all in config and synced from the server.

New toggles: enableStarDust, showSlideProgress.


## Data-driven comfort

Comfort used to sum hardcoded +1 / -1 values. Now the weights and thresholds live in ComfortSettings:

  • weights** per category — lighting, carpet, furniture, decoration, structure (positive) and macabre, hostile, dark (negative). Defaults keep the old behaviour, but every value is tunable.
  • Threshold semantics** — a rule fires when comfortLevel <= threshold.
  • nightmareThreshold (default **-1**) — nightmares at comfort <= -1.
  • sleepBlockThreshold (default **-2**) — sleep blocked at comfort <= -2.
  • Which blocks belong to a category is still driven by **tags** (datapack) — unchanged.
  • Comfort recalculates on /reload (cache is cleared).


## Flexible /reload

/midnightthoughts reload [config | achievements | content | all] (permission level 2):

  • config** — re-read the config and re-broadcast it to all clients.
  • achievements** — reload achievement definitions and re-broadcast.
  • content** — reload user content (facts / slides) and re-broadcast.
  • all** — everything at once.

Config changes apply **in place**, so every live system reads the fresh values instantly — no restart. Already-applied well-rested buffs aren't recalculated (they live in NBT); new applications use the new values.


## Admin commands

  • /midnightthoughts comfort — debug the comfort around you: level, which categories were found (● / ○), and each category's contribution.
  • /midnightthoughts wellrested grant <targets> <1-5> — grant well-rested manually.
  • /midnightthoughts wellrested clear <targets> — remove it.

All require permission level 2.


## Full modularity

Master toggles for every subsystem, so a pack can disable any part without touching code:

  • wellRested.enabled
  • comfort.enabled, comfort.nightmareEnabled, comfort.sleepBlockEnabled
  • mvp.enabled
  • sleepOverlay.enableOverlay, enableImage, enableDailySummaryScreen, useFactsApi
  • server.resetPhantomTimerForNonSleepers


## Java Event API

A pure-Java API on the Forge event bus (mt.api.event), always available and independent of any third-party mod. Any mod can subscribe with plain Java.

| Event | Fields | Notes |
|-------|--------|-------|
| WellRestedAppliedEvent | player, level, isMvp, durationTicks | Fired on normal grant and on MVP grant |
| WellRestedExpiredEvent | player | Natural expiry, death, manual clear, or disabled-branch |
| NightmareEvent | player, comfortLevel | Fired when a player sleeps into a nightmare |
| MvpDeterminedEvent | mvp | Fired at day rollover when an MVP is chosen |
| ComfortCalculatedEvent | player, level, setLevel(int) | **Overridable** — listeners can rewrite the computed comfort |

ComfortCalculatedEvent is posted before the result is cached, so an override changes the value everyone downstream sees (nightmare / sleep-block checks included).


## KubeJS integration (optional)

Layered design: the Java Event API above is always on; the KubeJS bridge is a **soft/optional dependency**. Without KubeJS the mod is fully self-sufficient — no errors, no crash.

### Events (mod → script)

Event group: **MidnightThoughtsEvents** (server events).

``js
MidnightThoughtsEvents.wellRestedApplied(event => {
// event.player, event.level, event.mvp (boolean), event.durationTicks
let mins = Math.max(1, Math.floor(event.durationTicks / 1200))
event.player.tell('Well-rested ' + event.level + ' for ' + mins + ' min')
})

MidnightThoughtsEvents.wellRestedExpired(event => {
// event.player
event.player.tell('The rested feeling fades...')
})

MidnightThoughtsEvents.nightmare(event => {
// event.player, event.comfortLevel
event.player.runCommandSilent('effect give @s minecraft:nausea 12 0 true')
})

MidnightThoughtsEvents.mvpDetermined(event => {
// event.mvp = the MVP ServerPlayer
event.mvp.server.tell(event.mvp.username + ' is the MVP of the day!')
})

MidnightThoughtsEvents.comfortCalculated(event => {
// event.player, event.level, event.setLevel(int) — override the result
if (event.player.block.canSeeSky) {
event.setLevel(event.level + 1)
}
})
`

### Bindings (script → mod)

Global object: **
MidnightThoughts**.

| Binding | Signature | Effect |
|---------|-----------|--------|
|
grantWellRested | (player, level) | Apply well-rested at the given level |
|
grantMvp | (player) | Apply the MVP-level well-rested |
|
clearWellRested | (player) | Remove the buff **and** fire WellRestedExpiredEvent |
|
hasWellRested | (player) → boolean | Is the buff active |
|
getLevel | (player) → int | Current well-rested level (0 if none) |
|
getComfort | (player) → int | Raw comfort at the player (no event fired, recursion-safe) |

`js
PlayerEvents.inventoryChanged(event => {
if (event.item.id == 'minecraft:nether_star') {
MidnightThoughts.grantWellRested(event.player, 5)
event.player.tell('§dThe star fills you with restful energy...')
}
})
`

getComfort reads raw comfort without posting ComfortCalculatedEvent, so calling it from a comfortCalculated handler cannot recurse. grant* / clearWellRested respect wellRested.enabled.


## Catalogue branding

Custom **icon**, **banner**, **background** and links (website / issues) in the mod list when Catalogue is installed.


## Fixed / Improved

  • mvp.enabled` now actually gates MVP selection (was a dead flag).
  • Config changes apply in place on reload — live systems pick them up instantly.
  • Comfort cache is cleared on reload so new weights/thresholds take effect immediately.
  • Overlay rendering fixes: no more content dimming or alpha build-up; fades and opacity behave correctly.


## Performance

Profiled with spark on a dedicated server (multiplayer, KubeJS loaded, active sleeping / nightmares): **~0.13% of server-tick time**, a flat **20 TPS**, MSPT 4–14 ms against a 50 ms budget.

  • Requires Forge 1.20.1.**


Full documentation will be available soon on the Wiki.
[1.5] Midnight Thoughts 1.5 by Iliiasik on Jul 03, 2026
Download
# Midnight Thoughts 1.5 — Forge 1.20.1

  • Theme: control, compatibility & integrations.**

Version 1.5 makes the mod fully data-driven, modular, and scriptable. Retune every subsystem from config, toggle any part off, and react to (or drive) the mod from KubeJS — while it stays completely self-sufficient when KubeJS isn't installed.


## Redesigned sleep overlay

The sleep overlay was rebuilt from the ground up:

  • New layout** — the moon-phase image now sits **above** the text, centered and more compact, instead of crowding it.
  • Vignette + star dust** — a soft vignette frames the screen and gentle drifting "star dust" animates in the background for atmosphere.
  • Crossfade between slides** — slides now fade smoothly into one another instead of hard-cutting.
  • Slide progress indicator** — a subtle progress bar shows how far along the current slide is.
  • Auto-fitting text** — text scales to fit cleanly regardless of length, so long facts and short thoughts both look right.
  • Configurable fades & opacity** — fadeInDurationMs, fadeOutDurationMs, overlayOpacity, textOpacity and imageOpacity are all in config and synced from the server.

New toggles: enableStarDust, showSlideProgress.


## Data-driven comfort

Comfort used to sum hardcoded +1 / -1 values. Now the weights and thresholds live in ComfortSettings:

  • weights** per category — lighting, carpet, furniture, decoration, structure (positive) and macabre, hostile, dark (negative). Defaults keep the old behaviour, but every value is tunable.
  • Threshold semantics** — a rule fires when comfortLevel <= threshold.
  • nightmareThreshold (default **-1**) — nightmares at comfort <= -1.
  • sleepBlockThreshold (default **-2**) — sleep blocked at comfort <= -2.
  • Which blocks belong to a category is still driven by **tags** (datapack) — unchanged.
  • Comfort recalculates on /reload (cache is cleared).


## Flexible /reload

/midnightthoughts reload [config | achievements | content | all] (permission level 2):

  • config** — re-read the config and re-broadcast it to all clients.
  • achievements** — reload achievement definitions and re-broadcast.
  • content** — reload user content (facts / slides) and re-broadcast.
  • all** — everything at once.

Config changes apply **in place**, so every live system reads the fresh values instantly — no restart. Already-applied well-rested buffs aren't recalculated (they live in NBT); new applications use the new values.


## Admin commands

  • /midnightthoughts comfort — debug the comfort around you: level, which categories were found (● / ○), and each category's contribution.
  • /midnightthoughts wellrested grant <targets> <1-5> — grant well-rested manually.
  • /midnightthoughts wellrested clear <targets> — remove it.

All require permission level 2.


## Full modularity

Master toggles for every subsystem, so a pack can disable any part without touching code:

  • wellRested.enabled
  • comfort.enabled, comfort.nightmareEnabled, comfort.sleepBlockEnabled
  • mvp.enabled
  • sleepOverlay.enableOverlay, enableImage, enableDailySummaryScreen, useFactsApi
  • server.resetPhantomTimerForNonSleepers


## Java Event API

A pure-Java API on the Forge event bus (mt.api.event), always available and independent of any third-party mod. Any mod can subscribe with plain Java.

| Event | Fields | Notes |
|-------|--------|-------|
| WellRestedAppliedEvent | player, level, isMvp, durationTicks | Fired on normal grant and on MVP grant |
| WellRestedExpiredEvent | player | Natural expiry, death, manual clear, or disabled-branch |
| NightmareEvent | player, comfortLevel | Fired when a player sleeps into a nightmare |
| MvpDeterminedEvent | mvp | Fired at day rollover when an MVP is chosen |
| ComfortCalculatedEvent | player, level, setLevel(int) | **Overridable** — listeners can rewrite the computed comfort |

ComfortCalculatedEvent is posted before the result is cached, so an override changes the value everyone downstream sees (nightmare / sleep-block checks included).


## KubeJS integration (optional)

Layered design: the Java Event API above is always on; the KubeJS bridge is a **soft/optional dependency**. Without KubeJS the mod is fully self-sufficient — no errors, no crash.

### Events (mod → script)

Event group: **MidnightThoughtsEvents** (server events).

``js
MidnightThoughtsEvents.wellRestedApplied(event => {
// event.player, event.level, event.mvp (boolean), event.durationTicks
let mins = Math.max(1, Math.floor(event.durationTicks / 1200))
event.player.tell('Well-rested ' + event.level + ' for ' + mins + ' min')
})

MidnightThoughtsEvents.wellRestedExpired(event => {
// event.player
event.player.tell('The rested feeling fades...')
})

MidnightThoughtsEvents.nightmare(event => {
// event.player, event.comfortLevel
event.player.runCommandSilent('effect give @s minecraft:nausea 12 0 true')
})

MidnightThoughtsEvents.mvpDetermined(event => {
// event.mvp = the MVP ServerPlayer
event.mvp.server.tell(event.mvp.username + ' is the MVP of the day!')
})

MidnightThoughtsEvents.comfortCalculated(event => {
// event.player, event.level, event.setLevel(int) — override the result
if (event.player.block.canSeeSky) {
event.setLevel(event.level + 1)
}
})
`

### Bindings (script → mod)

Global object: **
MidnightThoughts**.

| Binding | Signature | Effect |
|---------|-----------|--------|
|
grantWellRested | (player, level) | Apply well-rested at the given level |
|
grantMvp | (player) | Apply the MVP-level well-rested |
|
clearWellRested | (player) | Remove the buff **and** fire WellRestedExpiredEvent |
|
hasWellRested | (player) → boolean | Is the buff active |
|
getLevel | (player) → int | Current well-rested level (0 if none) |
|
getComfort | (player) → int | Raw comfort at the player (no event fired, recursion-safe) |

`js
PlayerEvents.inventoryChanged(event => {
if (event.item.id == 'minecraft:nether_star') {
MidnightThoughts.grantWellRested(event.player, 5)
event.player.tell('§dThe star fills you with restful energy...')
}
})
`

getComfort reads raw comfort without posting ComfortCalculatedEvent, so calling it from a comfortCalculated handler cannot recurse. grant* / clearWellRested respect wellRested.enabled.


## Catalogue branding

Custom **icon**, **banner**, **background** and links (website) in the mod list when Catalogue is installed.


## Fixed / Improved

  • mvp.enabled` now actually gates MVP selection (was a dead flag).
  • Config changes apply in place on reload — live systems pick them up instantly.
  • Comfort cache is cleared on reload so new weights/thresholds take effect immediately.
  • Overlay rendering fixes: no more content dimming or alpha build-up; fades and opacity behave correctly.


## Performance

Profiled with spark on a dedicated server (multiplayer, KubeJS loaded, active sleeping / nightmares): **~0.13% of server-tick time**, a flat **20 TPS**, MSPT 4–14 ms against a 50 ms budget.

  • Requires Forge 1.20.1.**


Full documentation will be available soon on the Wiki.
### Version 1.4.2

Mod network optimization has been improved

Admin command added: /midnightthoughts reload

for reloading config data in the world
### Version 1.4.2

Mod network optimization has been improved

Admin command added: /midnightthoughts reload

for reloading config data in the world
### Version 1.4.2

Mod network optimization has been improved.

Admin command added: /midnightthoughts reload

for reloading config data in the world
### Version 1.4.2

The Forge version now supports full sleep overlay customization like other versions, including image and text opacity and slide transition animation.

Mod network optimization has been improved.

Admin command added:
/midnightthoughts reload

for reloading config data in the world
## Version 1.4.1

### New UI
New magic and tech themes, rework vanilla and classic one

### Added Spanish
Full Spanish support, include custom facts, nightmares etc

### Server optimisation fixes
## Version 1.4.1

### New UI
New magic and tech themes, rework vanilla and classic one

### Added Spanish
Full Spanish support, include custom facts, nightmares etc

### Server optimisation fixes
## Version 1.4.1

### New UI
New magic and tech themes, rework vanilla and classic one

### Added Spanish
Full Spanish support, include custom facts, nightmares etc

### Server optimisation fixes
## Version 1.4.1

### New UI
New magic and tech themes, rework vanilla and classic one

### Added Spanish
Full Spanish support, include custom facts, nightmares etc

### Server optimisation fixes
## Version 1.4.1

### New UI
New magic and tech themes, rework vanilla and classic one

### Added Spanish
Full Spanish support, include custom facts, nightmares etc

### Server optimisation fixes
## Version 1.4.1

### New UI
New magic and tech themes, rework vanilla and classic one

### Added Spanish
Full Spanish support, include custom facts, nightmares etc

### Server optimisation fixes
intermediate version

Nightmare Mode eats up server thread fix
intermediate version

Nightmare Mode eats up server thread fix
intermediate version

Nightmare Mode eats up server thread fix
intermediate version

Nightmare Mode eats up server thread fix
intermediate version

Nightmare Mode eats up server thread fix

New UI demo
intermediate version

Nightmare Mode eats up server thread fix

[1.4] Midnight Thoughts 1.4 by Iliiasik on Jun 01, 2026
Download
## Version 1.4 - Servers Update
### Server Update
All config parameters can now be configured from the server. Previously, players could only customize UI parameters individually in their local config. This also applies to custom achievements and custom facts.

### New UI Sleep overlay
The texture is now completely Minecraft-style and displays the eight moon phases in the world. This means the sleep overlay reflects the current moon phase in the world!

Minor bugs have been fixed, including a bug preventing players from receiving daily summaries after going to bed but waking up without fully sleeping
Midnight Thoughts Icon
Download Midnight Thoughts
Select game version
Select platform