Monster Room

Dungeons are small rooms made of Cobblestone and Moss Stone that contain a hostile Mob Spawner and up to 2 Chests. Finding a dungeon without a chest is very unlikely, but possible. Dungeons are currently the only place where Moss Stone can be found in a natural map. Anyone exploring a cavern should be wary of encountering a dungeon, as they are almost always connected to large caverns, and are very dangerous. Dungeons do exist on peaceful mode, as they are generated with the map. Monster Spawners will still spawn mobs in peaceful mode, but the mobs will instantly despawn.

Properties
Dungeons are generated as a 5x5, 5x7, or 7x7 floor space surrounded by Cobblestone or Moss Stone. Dungeons contain a Monster Spawner, which can be used to make a mob spawner trap, and 0-2 chests (two chests may be adjacent, forming a large chest), unless they are overwritten by a cave or other structure. It is also possible to find two dungeons joined together, with 2 spawners and 0-4 chests.

The Mob Spawner acts as a guard for the loot, spawning endless mobs until the player can light up the room enough to stop new mobs from being spawned, or simply break the spawner itself. This is usually accomplished by placing a torch on top of the spawner, and is known as "sacking" the dungeon. The Mob 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). The chests contain randomly generated treasure that are placed in random slots. It is possible to find a Dungeon almost anywhere in the ground, but they rarely spawn high in the stone layer of a map. There are reports of dungeons being generated in unusual locations, as shown in the gallery below.

There is a 50% chance the spawner will be a Zombie spawner, 25% chance of Skeletons, and 25% chance of Spiders.

Chest contents
Each dungeon chest block contains up to 8 item stacks, with the following distribution:

This information was obtained from the Minecraft code. The generation algorithm places one of these items in a random slot in the chest eight times, possibly overwriting items already placed.

History
Dungeons were introduced in the Seecret Friday Update 2 of Infdev.

Prior to 1.8, dungeons could spawn quite high up, sometimes rarely appearing in mountains.

Dungeon Game Mode
It is possible that adventure mode will be based upon dungeons.
 * See the Adventure Mode Article

Tips

 * A simple way to find dungeons is to hold F3 and press F, the fog key, and while the screen is blue with clouds and a sun/moon, look for flames from a mob spawner. This only works when you are 16 blocks or fewer from the spawner. This tends to work better on slower computers.
 * Another reliable way of locating dungeons is through listening, either for a large amount of noise from one kind of mob, or for ambience. Neither of these things are an exclusive trait of a dungeon, but they do mean that there is an unlit and unexplored area nearby, which may well be a dungeon, particularly in the case of frequent and similar mob noises.
 * A sure way of knowing a dungeon is near is if you see naturally generated cobblestone or mossy cobblestone as you explore underground. This allows you to prepare to tackle the dungeon and face whatever mobs are inside.
 * If all else fails, one can use a map viewer to search for Moss Stone blocks. To locate them, set the viewer to show only moss stone (data value 48), mob spawner (data value 52) or cobblestone (data value 4) that you did not place. Play the save file and head out to one such place and dig down until the Dungeon is found. The viewer must be up-to-date, or it may crash upon trying to load blocks that it doesn't recognize.
 * To defeat a dungeon, aside from the obvious method of fighting the monsters and lighting up the area, one can instead tunnel underneath it and destroy the spawner from below. or it is also possible to flood the dungeon with lava, kill all of the mobs, then place torches to disable the spawner just as the last of the lava disappears.
 * Digging around the sides of the dungeon will allow you to bypass the spawner and loot the chests directly without any risk of health loss.
 * A fast way to collect loot from the chest is to destroy the chest rather than removing the items from it. This way you collect all loot as well as the chest.
 * Torches can be placed directly on the monster spawner. Placing one on each side provides the same effect as placing a torch on the blocks adjacent to the spawner, without needing to be replaced when you mine the floor out for Moss Stone.

Trivia

 * Dungeons can spawn with a side open to a ravine. This can cause mobs to not spawn, as the dungeon is exposed to sunlight, or for mobs to walk out of the ravine cliff and fall to their deaths. Dungeons may also generate with their openings closed, but with walls exposed on the side of a ravine, acting as a flag to players. This happens as of Beta 1.8.1.
 * Dungeons are almost always connected to a cavern, and because the cavern can be as small as a single block of air, the dungeon could completely overwrite it, usually resulting in a dungeon with no entrance.
 * Because deserts are made of sand and dungeons are not generated with a roof, dungeons close to the surface can cause tell-tale rectangular pits. These pits can also be identified by cobblestone or stone exposed by the fallen sand and can be easily looted during the daytime once excavated.
 * Sometimes dungeons can be found on the coast on beaches. It is similar to desert dungeons since the sand will cave in. Furthermore, water can flood into the dungeon as well.
 * It is possible for the player to spawn in a dungeon near the surface.
 * It is possible for dungeons to spawn when you specify for the world to not spawn such structures.
 * Rarely, a mushroom will appear in a dungeon on mossy cobblestone.
 * It is possible, though almost impossibly rare for a dungeon to be generated at bedrock level, thereby deleting the bedrock. In which case digging through the moss stone can lead into the Void.
 * It is possible for a Dungeon to spawn over a lava pit. It is also possible that the dungeon does not have a cobblestone floor, or only a partial floor, resulting in a floating spawner. At around 03:20 a floating spawner, in an open dungeon, is shown in this video
 * Rarely, on peaceful, a monster spawner may spawn a monster that plays its sound file before it can despawn.
 * Rarely, a monster spawner can be spotted from the surface. Islands of gravel or sand will have an obvious ditch in them which can indicate a monster spawner which the sand or gravel has caved in on.
 * It is rarely possible for a player to find a dungeon with two spawners and up to 4 chests. This occurs when a 5x5 dungeon spawns within a 7x7 dungeon, since the dungeon will remove any blocks from the walls or floor that open into a cave, the walls of the smaller dungeon will be removed, resulting in a 7x7 floor space with one spawner in the middle, and a second spawner adjacent or diagonally adjacent to the first.
 * Sometimes, a dungeon can spawn in an ocean or lake, but very rarely.
 * Double-chest dungeons as shown below may have chests that form a perpendicular barrier between the wall and spawner (an exception to this would be in 7x7 dungeons, in which the chest cannot reach the spawner):
 * Sometimes, dungeons spawn at the lava level. This causes parts of the floor to be open directly to the lava. Around 1:20, a dungeon with a lava floor is shown
 * The Moss Stone pattern on the dungeon floor seems to have a pattern, most noticeable with a 5x5 dungeon, where a 2x2 cube of moss stone lays in one corner. Unknown if this happens with 5x7 or 7x7 dungeons.
 * Although extremely rare, three dungeons may spawn together or very close to each other, resulting in a massive amount of mobs and up to 6 chests. Due to the sheer amount of mobs generated, these dungeons may be very difficult to conquer (unless the game is set to Peaceful mode) A seed to this is 'i dont care'. It is found in the desert part of the map on the surface (1.0.0. only).
 * If a dungeon loads in two chunks and one regenerates (often causing a flat vertical wall), the dungeon can become partially generated. This can be found if one of the walls of the dungeon is not cobblestone, but rather stone. Sometimes, the partially generated dungeon will not have a spawner or a chest. Example of a partially generated dungeon
 * The contents of chests in dungeons appear to be based on the world seed.
 * Dungeons may spawn in Abandoned Mine Shafts, Ravines, and even Strongholds (although this is very rare).
 * Because some caves are deep, skinny pits, dungeons may have a small hole in the corner, which can be dangerous to both mobs and the player
 * If you are playing on peaceful in a skeleton dungeon, sometimes skeletons will shoot arrows before despawning.
 * Abandoned Mine Shafts can strip a dungeon apart, due to the arches and air overwriting the dungeon. The result is usually a partial floor and/or a missing wall. Strongholds may also have this capability.
 * Rarely, three chests can be found in a single generated dungeon, though this might be due to a generation bug.
 * Rarely, dungeons may spawn with no chests at all.
 * It is possible to find dungeons in mine-shafts.
 * Rarely, dungeons may spawn in underwater ravines, usually entered via the ravine's opening.
 * Rarely, a dungeon may spawn under a pool of lava.
 * Rarely, A Dungeon may be exposed to the surface with no access at all at first, this is only proven in the new jungle biomes
 * Dungeons are the only current legitimate way to obtain cocoa beans.
 * Rarely, dungeons can spawn with no floor at all. This video shows a dungeon with no floor above an end portal.