How to Stop Phantoms From Attacking You (Disable Insomnia)
What Causes Phantoms
Phantoms spawn when a player hasn't slept for several in-game days. The game tracks this with the doInsomnia game rule. If you play on a server or in a world where you can't or don't want to sleep regularly, phantoms will swarm you at night and knock you off cliffs or into danger. The Let Me Sleep Mod exposes the doInsomnia game rule so you can turn phantom spawns off entirely.
Turning Off Phantom Spawns
1. Make sure you have permission to change game rules (singleplayer with cheats, or operator status on a server).
2. Open the chat and type the command to set the insomnia rule to false: /gamerule doInsomnia false.
3. Confirm the change — the game will report the rule was updated. From now on, phantoms will no longer spawn from sleep deprivation, no matter how many nights you stay awake.
4. To bring phantoms back later, run the same command with true instead of false.
5. If you want phantoms gone but still want the other sleep benefits of the mod (like healing on wake-up or spawn-point setting), leave those options enabled in the config — the insomnia rule is independent of them.
This is the cleanest fix for players who are "constantly being swarmed by phantoms and fearing for their life" without having to sleep every few days.