Night Terror is a simple mod, that brings back an old mechanic, that was present in Alpha and Beta versions of Minecraft. In these versions, if you slept in an unlit area, there was a chance of being woken up by a zombie or skeleton. In Minecraft 1.0.0 this mechanic was replaced by the “You may not rest, there are monsters nearby” message.
How it works
At the moment when you should all players present on the server wake up, the game checks an area around each one of them, and if there is any reachable unlit block and they have bad luck with the “RNG roulette”, a monster (zombie or skeleton) will spawn next to their bed and instead of day it is still night.
What about multiplayer/LAN
It is simple, if any player is woken up by a monster, all players will wake up at night.
Since I expect this mod is more likely to be used in modpacks rather than standalone, I added a configuration file (nightterror-common.toml), where you can change few settings:
check_range – how far from the bed should the game look for “dark” spots.
terror_chance – the base chance of being woken up. This chance is multiplied by a “difficulty modifier” (Peaceful – 0.5, Easy- 0.75, Normal – 1, Hard – 1.5).
interrupt_sleep – if this value is false, the monsters will wait until you wake up in the morning.
wake_damage – the amount of damage dealt with the player when woken up by a monster
waking_entities – a list of all entities, that can wake the player up. Accepts even modded entities, as long as they are instances of MobEntity class.
Minecraft’s pathfinding can be sometimes rather silly – especially when dealing with things like slabs or height differences – therefore having unlit spots on a roof can sometimes cause monsters attacking you even if there is no way they could get to you. If this happens, you should either put some torches on your roof/around your house or decrease the check_range in the configuration file.