Swamp hut

Swamp huts (also known as witch huts) are small generated structures that have the ability to spawn witches and black cats.

Generation
Swamp huts generate rarely in swamp biomes. However, they do not generate in the swamp hills biome variant.

Structure
Swamp huts consist of a small square building made of spruce planks, with oak log pillars extending down to the ground. There is a small platform outside of the hut that could be an entrance; however, it is many blocks above the ground, and there are no stairs that go upwards to the hut, although vines can generate from the front platform and down to the ground. The roof of the swamp hut is made up of spruce wood stairs and spruce wood planks. The hut is two blocks tall inside.

The inside of a swamp hut consists of an empty cauldron, a crafting table, and a flower pot with a red mushroom in it.

In Bedrock Edition, the cauldron generates with a random potion inside of it in random amounts. There is a 25% chance for Healing or Poison, 15% for Swiftness, 10% for Slowness, Weakness, or Water Breathing, and 5% Fire Resistance.

Brewing stands do not generate in swamp huts, as the witch "brews" potions inside the cauldron.

Mobs
Upon world generation, one witch and one stray black cat spawn inside the hut. These never naturally despawn, however, the witch does not spawn when the difficulty is set to Peaceful.

Additionally, witches can spawn on any block within the 7×7×9 (x×y×z) area that constitutes the hut (this is the size of the roof and one block over the porch, from one level below the floor of the hut to two blocks above the roof). Cats can also spawn within this area. However, they require a grass block to spawn on. $$, any other cats to spawn within the swamp hut (from spawn eggs and commands without cat type set) always spawn as black.

Witches sometimes wander around the hut, or follow any targets outside the hut. The black cat doesn't always follow the witch. The witch will always return to the hut if the witch didn't wander too far.

In Bedrock Edition, witches respawn on only one block within the swamp hut if the witch is killed.

Trivia

 * The "hut" part of a swamp hut generates on or above the surface, while the wood "pillars" extend down until they reach solid ground. This means that if part of a swamp hut is at sea level and another part is on top of deep ground, such as a ravine, the pillars on the deep-ground side go all the way down to the bottom.
 * It is possible for swamp huts to generate on top of one another.
 * Swamp huts are one of five generated structures that do not generate loot chests (the others are desert wells, fossils, nether fossil and ocean monuments).
 * Swamp huts, together with nether fortresses, ocean monuments and pillager outposts, are the only four generated structures in the game that have special spawning rules within their bounding boxes.
 * Dungeons are not included, since the spawning condition is dictated by the spawner rather than the dungeon structure.