Minecraft wiki entry for Best_biomes_for_homes, associated text: The most immediate problem is the monsters which spawn, generally regardless of light level. Bases can be floored with transparent or partial blocks to prevent spawns inside the base. Depending on the nearby biomes, various other measures will also be needed: For Endermen, avoid building with blocks they can pick up, and make sure that low ceilings are available for shelter. For Ghasts, enclose the base completely to prevent them from getting line-of-sight on a player. Avoiding fragile blocks on the exterior can forestall problems when working near the base. Piglins can be deterred by placing soul fire (including the torches, lanterns, or campfires) as a perimeter, and pacified by wearing a piece of gold armor. (Note that they can open doors!) Hoglins can be deterred with warped fungus, and cannot pass through one-block-wide gaps. Zombified Piglins are a particular nuisance, because of the hazard of accidentally aggravating them; they can also knock on doors (and in Hard difficulty, break them) even while still neutral. However, most of the general base-defense techniques (not lava or fire) will work against them. Magma cubes are especially dangerous -- in areas where they can spawn, spawnproofing and a solid perimeter are a must, and low ceilings can at least keep the largest cubes out.