
Midnight Thoughts
Unique sleep overhaul and rest system
- Загрузки
- 12K
- Подписчики
- 100
- Обновлён
- 20 августа 2026 г.
- Лицензия
- MIT
Опубликован 9 декабря 2025 г.
Ченджлог
1.5.5Релиз1.20.1 · 16 августа 2026 г.
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.
1.5.5Релиз1.21.11 · 16 августа 2026 г.
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.
1.5.5Релиз1.21.1 · 16 августа 2026 г.
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.
1.5.4Релиз1.20.1 · 15 августа 2026 г.
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
barposition 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.
1.5.2Релиз1.21.1 · 7 августа 2026 г.
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 existinghideWellRestedHudandhideThemeSwitchButtonoptions. Defaults tofalse, 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.
1.5.1Релиз1.21.11 · 7 августа 2026 г.
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
useFactsApinow 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.
1.5.1Релиз1.20.1 · 3 августа 2026 г.
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
useFactsApinow 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Релиз1.21.1 · 26 июля 2026 г.
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,textOpacityandimageOpacityare 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:
weightsper category —lighting,carpet,furniture,decoration,structure(positive) andmacabre,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 atcomfort <= -1.sleepBlockThreshold(default -2) — sleep blocked atcomfort <= -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.enabledcomfort.enabled,comfort.nightmareEnabled,comfort.sleepBlockEnabledmvp.enabledsleepOverlay.enableOverlay,enableImage,enableDailySummaryScreen,useFactsApiserver.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).
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) |
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.enablednow 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.
Комментарии
Загружаем…