Monster Room

A dungeon, also referred to as a monster room in its ID, is a structure-like feature that appears in the Overworld that contains a spawner that produces either zombies, skeletons, or spiders.

Generation
$$, dungeons generate naturally in the Overworld at any altitude above Y=6. For each chunk, 14 attempts are made to generate a dungeon; it is possible, though unlikely, for multiple attempts to succeed. $$, dungeons can generate as underground structures above sea level.

Dungeons are a feature instead of a structure, so they generate regardless of whether the "Generate structures" world creation option has been toggled off for said world. They also cannot be searched by the command.

For each attempt, a location (the position for mob spawner) and size (an open area with a width and length of 7 or 9 and a height of 6) is chosen. The attempt succeeds if the following conditions are met:
 * Blocks in the floor area (including under the walls) of the potential dungeon must be material solid.
 * Blocks in the ceiling area (including over the walls) of the potential dungeon must be material solid. The ceiling blocks may be gravity-affected such as gravel or sand, which fall if disturbed by the player.
 * The walls of the potential dungeon must have 1–5 openings (2-high air blocks) at floor level. Dungeons are always connected to a cavern or other hollow structure, although it is possible for the dungeon itself to overwrite most of a tiny cave.

If the location passes, air and cobblestone are placed, then 3 attempts are made to generate each of two chests. To generate a chest, the chosen block must be empty and must have a solid block on exactly one of its four sides. The mob spawner is placed at the center of the dungeon.

The spawner has a 50% chance of producing zombies, a 25% chance of producing skeletons, or a 25% chance of producing spiders. A zombie spawner $$ also has the same chance (5%) of producing zombie villagers as in natural generation. Cobblestone has a 75% chance to be mossy when it is on the floor of the dungeon.

Construction
Dungeons are small rooms made of cobblestone and mossy cobblestone and contain a spawner and up to 2 chests. Finding a dungeon without a chest is unlikely but possible. Additionally, there is a rare chance of a dungeon being found without a spawner. Occasionally, a dungeon generates with its chests in such a way as to create a double chest. Dungeons generate with either a zombie (50% chance), skeleton (25% chance), or spider (25% chance) spawner. The spawner is always in the center of the dungeon room, with chests located around the walls of the room (large chests can connect with the short side against the wall). Each block of the floor has a 25% chance of being cobblestone and a 75% chance of being mossy cobblestone.

Because the horizontal range for spawning mobs is 4 blocks from the spawner, it is possible for mobs to be spawned outside the walls of a 5×5 dungeon that is surrounded by air outside the walls.

ID




Trivia

 * A contradiction exists in Java Edition that even though the "Generate Structures" world creation option listed "Villages, dungeons etc." as two example structures that are supposed to generate only when the option is turned "ON", dungeons generate even if the option is set to "OFF".