How can I prevent mobs from spawning in unlit places?
In vanilla minecraft mobs don't spawn if the light level of the block is 9 or above. However, I often don't want to fully lit all my structures. I might want a courtyard or a cellar that isn't fully lit. Also controllable light systems with redstone are a lot of fun to make, but I can never turn the lights off in fear of spawning mobs.
Is there a mod or another solution to have both unlit places and no mobs around? Maybe some kind of block that prevents mobs from spawning within a radius.
5 Answers
Not counting mods, the best way I know of is to make sure the area you're "protecting" has a floor made of blocks which don't allow mob spawning.
Any transparent block will do the trick, such as glass or snow, and in your case maybe Slabs will be most suitable.
For more in-depth information about spawning and spawn conditions, check the wiki:
3The way to keep mobs from spawning in unlit places is by putting slabs, levers, or water for the floors.
Thanks for reading this if you found this helpful than your welcome!
1You can prevent mob spawning by accumulating 96 zombies in your chunk and no other mobs will spawn as 96 mobs is the mob cap. Just make sure that they don't despawn while you are not around by giving them something to hold such as a pumpkin.
2The command /gamerule doMobSpawning false will prevent mobs from spawning without player help. Use /gamerule doMobSpawning true to turn it back on.
Maybe you can just set your difficulty to peaceful? Mybe you can just type /difficulty peaceful and then only in that world it'll be peaceful. So mobs won't spawn and in other worlds they will spawn.