Minecraft wiki entry for Safe_home, associated text: Because ghasts require a 5×5×5 space to spawn, it is possible to create a large ghast-free area in a cavern by placing blocks so that there is never enough space for the ghasts to spawn. Start by walling in any entrances to the cavern so that ghasts can't wander in. Then, you need to place blocks within that cavern to prevent any new ones from spawning (this is easiest to do in Peaceful difficulty). The simplest method would be 1×1 pillars of any material, placed in a grid across the entire cavern, with 4 clear squares in each direction between each pillar. A more complex method is to place glass blocks in a 3-dimensional grid to fill up the entire space rather than pillars. The only limit to how large an area you can protect is resources. Once you have protected a cavern like this, you can terraform it, and it is actually safer than anything you can build in the Overworld since the only mobs that can spawn are magma cubes and piglins. But you can even prevent these two mobs from spawning in your cavern by covering the entire floor with a material that mobs aren't able to spawn on, such as glass.