# How are dungeons in minecraft generated?

While looking through my map using MCEdit, i found a double dungeon (interconnected). After searching for a while on the internet i found out that it was extremely rare. How are these dungeons generated and what are the possibilities of 2 or more dungeons being interconnected to each other?

-
I found one of these myself! Further question: are double dungeons always at the same height? Mine was, and this one appears to be too. – fredley May 13 '11 at 15:34
The guy in the background is Prosay – DemonicMushy Sep 12 '11 at 14:39

When a chunk is populated, the dungeon generation is always tried 8 times independently at random positions in the chunk. For each generation, given a random size (5x5, 5x7, or 7x7, excluding walls), a dungeon is generated only if the ceiling and floor blocks are solid and there are 1~5 air blocks in the lower half of the surrounding walls.

Possibility? That's complicated to calculate because the probability distribution of air blocks is more complicated and that depends on this. However, you can certainly qualitatively assert that double dungeon is rare. I assert the existence of triple dungeon.

-