Minecraft Java Edition – Average Dungeon Density in the Minecraft World

minecraft-java-edition

I recently have started a new world in minecraft and I spawned near a mountain that had a dungeon in it. Then I had a thought 'How many dungeons spawn in a world?'

Also, what is the average and can a world be made with no dungeons?

Best Answer

There is no easy answer to this because it depends heavily on the rest of the terrain generation that has already been done before the game checks for valid dungeon placement locations.

When a chunk (a 16x16 wide piece of the world) is generated the game tries 8 times to place dungeons in the chunk, centred on a randomly-chosen block between bedrock and an altitude of 128. First it picks a dungeon shape for the location, then it checks to see if it's a legal dungeon location. It will refuse to place the dungeon if it is above ground, or if where its walls would be placed aren't exposed to air, or if six or more vertical sections of its walls would be visible. That means that it depends on there being air pockets underground, but not too many of them around the spot it randomly tried to place a dungeon.

As a result, there is no guarantee of a dungeon appearing in a chunk, and it's theoretically possible for a chunk to contain up to eight dungeons. Beyond that, it's almost impossible to say what the frequency is, since the game isn't using a simple percentage chance.

There's no way to turn off dungeon spawning. The game options claim that setting "Generate Structures" to OFF will disable dungeon generation, but in reality dungeons are generated in a part if the code that doesn't check that option. The only way to prevent dungeons from spawning is to have no legal locations for them, which can be accomplished by making a flat world that has only a few layers of ground.