Village

Villages, also known as NPC villages, are groups of buildings inhabited by villagers that spawn naturally in the world. They only occur in the plains, savanna or desert biomes. Village buildings in plains and savanna biomes will be made out of Oak Wood, Oak Wood Planks, Cobblestone, Stone Stairs and Glass Panes. Village buildings in desert biomes are made out of Sandstone, Smooth Sandstone, Sandstone slabs, Sandstone Stairs and Glass Panes instead of wooden or cobblestone features. Also, the plains and savanna biome villages have Gravel roads while the desert biome villages have Sandstone roads.

Finding villages
One method is to find the possible places that villages can spawn by using a superflat world, where the completely flat terrain makes villages spawn more often. This method will not always work: The above does not always work because villages only spawn in flat biomes (plains, savanna and desert), so the above produces many false positives where the location in the original map is not suitable. One possibility is to retry the steps above but for step 1 select default world type (as opposed to superflat). This makes it harder to see villages, but each village found is much more likely to exist in the original world.
 * 1) Create a creative, superflat world by using the "Re-Create" button.
 * 2) * An alternative is to use, then copy the output number into the seed box in the world creation settings.
 * 3) Set the render distance to the farthest distance your computer is sufficient for.
 * 4) Fly around and search for a village.
 * 5) When you find one, press F3 and find the coordinates.
 * 6) Go to these coordinates on your other (first) world.
 * 7) A village (not the same design but still a village) may spawn there (if the conditions are right).

In superflat worlds villages spawn one in every quadrant at the same coordinates of the coordinative system. For example: if a village is at x=200 z=200,there is also another village at x=-200 z=200; and another at x=-200 z=-200; and of course one at x=200 z=-200. This works most of the times, on superflat worlds of course, although there aren't always the same coordinates (like x=200 z=200) on the other quadrant (the village is going to be on x=250 z=-150).

There are also programs like AMIDST (by Skidoodle) to map worlds that will display all villages of the world/seed.

Villages are much more common in worlds generated with large biomes than in default worlds; multiple villages can often be found on one desert or plains.

Defending and rescuing villages
Staying in a village overnight may result in a Zombie siege: Zombies will spawn near the outskirts of the village, regardless of light level, and attack the villagers. While the villagers will try to hide in their houses, some may fail to get to safety, and on the Hard difficulty level zombies can break down doors. These sieges can kill off all the villagers within a couple of nights. (On Normal or Hard difficulties, most or all of the villagers would become zombies themselves, which would eventually despawn or burn.) Sufficiently large villages may have Iron Golems to help defend them, but almost any village is likely to become depopulated within a few sieges unless the player provides help. Even when two villagers survive, villager breeding is much too slow to recover from the regular deaths.

There is also the matter that Villager AI is woefully insufficient for their survival – even without sieges, they are prone to falling into nearby caves or pits and becoming lost, dancing on cactus, inviting zombies in, and otherwise committing suicide. Furthermore, even the naturally spawned zombies still hunt villagers, and have become much more dangerous: besides summoning aid and powering up when the player attacks, they can now see the player and sense villagers for a large distance. Note that if there are less than two villagers remaining at any time, they will be unable to breed their numbers back up, and the village will not be viable. Even with two villagers, there also need to be at least nine doors within range before they will breed.

Accordingly, player assistance is needed to help a village survive. Some suggestions:


 * 1) Until the village is secured (see below), players should not spend a waking night within 128 blocks (their mob despawning radius) of the village borders. Rather than risking a stray zombie getting in, set up a bed and sleep in it as soon as the sun reaches the horizon. Then go out the moment you wake up to finish off any monsters still within the town, even if they're already on fire. Trying to fight zombies at night is a bad idea, because each one you fight will call in more, and if there are any gaps in the lighting, those can spawn within the village. Daylight helps to break this vicious circle – but watch out for baby and helmeted zombies, neither of whom will burn.
 * 2) As a temporary measure until your barricades are done, you can wait until the villagers have gone indoors, then place blocks or fence gates outside doors, to barricade all the villagers inside their houses.  The villagers won't be able to wander, and the zombies won't be able to attack them.
 * 3) Remove any stairs in front of doors, and rehang the doors to face outwards. Zombies can only break the top half of a door; if they have to jump, they will never get through, but their knocking will announce their presence.
 * 4)  As quickly as possible, secure the village against nighttime monsters. While this won't protect against an actual siege, it will keep other monsters (especially creepers) from spawning or entering during the night, which they will do if a player is nearby. Left to themselves, mobs besides zombies will not attack villagers, but they will attack the player, and creepers coming after players may blow up parts of the village.
 * 5) * Light the entire area – outside, inside buildings, and even the flat parts of roofs. While you're lighting the well's roof, you might stick a ladder on the well's inside edge as another safety measure, or else top the well up to full.
 * 6) * Block off or remove any natural hazards in or near the town – caves, steep drops, open lava, and so on. For desert villages, clear all cacti out of the area.
 * 7) * Build a fence or cobblestone wall completely around the village, with gates for your convenience. As usual, make sure that nearby blocks do not allow mobs to jump over the wall from outside. Tree farming (especially a "jungle giant") and/or a cobblestone generator can provide enough material for the barricades. Some internal barricades may also help, dividing the town into sectors that can be defended separately.
 * 8) * If possible, post cats around the perimeter – you can post occasional dogs as well, but remember that dogs won't get into a fight until you do. (And remember to heal or replace them as needed!)
 * 9) Each morning, the player should quickly replace any doors that have been broken. However do not put a door on the blacksmith as it will kill villagers off (they will consider the outside to be the inside). Don't try replacing the doors with iron doors – the zombies can't break them, but neither will the villagers recognize an iron door as a "village door" for spawning purposes.
 * 10) Zombies will not merely kill villagers, but can convert them to Zombie Villagers (50% chance on Normal difficulty, 100% on Hard). Also, natural zombie spawns have a small chance of being Zombie Villagers. If a player has been to a Nether Fortress, they may be able to cure these unfortunates as follows:
 * 11) * Splash them with a Potion of Weakness
 * 12) * Feed them a Golden Apple (ingot version)
 * 13) * Wait. The cure takes several minutes, so you will want to prevent them from burning or otherwise dying (or despawning) before they recover. A covered corral will work, but it may be easier to prepare a house for them: Make sure there are at least two doors, and lock the villagers out by putting gates in front of those. Then you can lead the weakened zombie in there and escape by the other door. (A potion of Swiftness – or Slowing on the zombie – might help.) On Hard mode, you may need to add shade outside the exits, lest your patient break down the door and expose themselves to sunlight. If the zombie is damaged, splash potions of harming can be used to heal it a little, increasing its chances of surviving.
 * 14) Curing naturally-spawned Zombie Villagers can repopulate a desolate village. Once you have two villagers in the village, you can cause them to start breeding by trading with them or giving them appropriate food, provided the village is of a reasonable size. You can also build up the population or even create new villages this way (see below).
 * 15) Create new Iron Golems. You can never have too many.
 * 16) Fight back. If you see Iron Golems failing to do their job and a Villager is about to be killed, attack with everything you've got. A sword, an axe, your own fists, whatever it does to keep the villager alive. Even if Iron Golems are doing their job, that doesn't mean you can't help.
 * 17) Create new houses. Once your village has too many villagers, a house can overflow during a siege causing villagers to be automatically pushed out of the house when another villager enters it. Creating new houses with a door will allow these villagers to simply find another house and hide there instead.
 * 18) Place snow golems on roofs. Snow golems will die once it rains, so it is vital that you place something above them so they will be safe from rain. Snow golems can slow down the zombies during a zombie siege so the Iron Golems can attack without the zombie attacking fleeing villagers (Don't do this in a desert biome)

Village behavior
A village is almost always composed of at least one acceptable house and one villager. In some rare cases, villages have spawned with a well and nothing else (This appears to occur very frequently on console versions). Upon creation, a village center is defined as the geometric barycenter of the active doors' locations, and the village's size is the greater of 32 blocks or the distance to the furthest door from the center. Any villager, village golem, or siege-spawned zombie will path back into the village if they find themselves farther than "size" blocks from the center.

As the villagers move around, the area near them is occasionally checked for new valid doors ("houses"). Thus, the random movement of villagers may also slowly change the center of the village they live in, even if no houses are actually changed. If a new valid door is found more than 66 blocks outside of any existing village's center, a new village is created; if a new valid door is found fewer blocks away than that, the door is added to an existing village and the center is recalculated.

The minimum population of a village is 0.35 times the number of valid doors (see below). If the population drops below that point (due to death or kidnappings), but there are at least two villagers left who can reach each other, the villagers will mate and breed until the population is above the minimum.

Adult villagers can be traded with by right-clicking on them, except on Pocket Edition.

Advanced Village Placement
When attempting to place villages as close to each other as possible (for an iron golem farm for example) if their centers are to share the same x & y or y & z coordinate then the the remaining coordinate must differ by 66 or more. So for example village A at 0 64 0 and village B at 0 64 66 will not merge, but if village B is at 0 64 65 they will. For all other cases if the real distance sqrt(x2 + y2 + z2) between their centers is greater than or equal to 65 they will not merge. So if we want to build village C above the middle line between village A and B then their x difference is again 0 their z difference is now 33 so using our formula d2 = x2 + y2 + z2 or 652 = 02 + 332 + y2 then with a little algebra we find that their y difference must be at least 56 or in other words C's center should be at 0 120 33.

Symmetrical villages are easy to calculate the centers of, but for more complex villages such as naturally generated villages it's a good idea to give yourself a few blocks extra room. Try calculating from the position of the door closest to your build site.

Note: The integer rounding in the game's internal programming may allow villages to be placed one block closer under certain circumstances, but this formula will function to keep the villages apart every time. Also if you're planning something really complex try using the BBox Outline Mod to help visualizing.

Popularity
A player's popularity starts at zero, and ranges between -30 and 10, and the following can alter a player's popularity: A player's popularity does not reset on death, and players cannot alter other players' popularity. In addition, the popularity is stored per village; a player may have a high popularity in one village and a very low one in another. When a player's acts directly on a villager, particles around that villager will indicate the change in popularity.

Conversely, because popularity is stored per village, if the entire village is destroyed, any accumulated popularity, positive or negative, is also eliminated. This may be useful in synthetic village designs, such as when only one villager is kept in range of doors to maintain the existence of the village but is moved out of range in order to destroy the village, such as to stop infinite villager breeding.

Presently, popularity has one effect: if a player has -15 popularity or less, iron golems of that village will become aggressive to that player. If an iron golem is idle, it may become aggressive to the nearest player with -15 or lower popularity. However, "nearest" can be any distance at all, so if the village's chunks are loaded (perhaps by another player), the golems can turn hostile even after the unpopular player has traveled across the world.

Another feature further encourages players to protect villagers: if a villager dies to a non-mob, non-player source while a player is within 16 blocks, or if a monster kills a villager, then no villager in the village will mate for approximately 3 minutes.

Structures


"Natural" villages contain a variety of structures. In Plains and savanna villages, these will be made primarily of oak wood (both logs and planks) and cobblestone, while in Desert villages they will be made of sandstone. Regardless of material, the form of the buildings and other structures will be similar. Often in non-superflat worlds, villages will spawn unevenly, causing some houses to spawn too high for villagers to reach, or partially underground, trapping villagers who spawned inside. Enclosed buildings will have glass windows. "Tables" are composed of a pressure plate on a fence post. Note that the building interiors are often not well enough lit to prevent monster spawning, let alone the outdoor areas.

Well: Wells are 2x2 pools filled with water, surrounded by cobblestone/sandstone walls, and have small roofs of cobblestone or sandstone supported by fences. The wells are normally 10 blocks deep, but are only 4 blocks deep in Classic Flat worlds due to the low elevation. There is only one well in each village. Wells usually spawn near the center of the village or even far away from a village, with roads leading out from all sides. Often mobs become trapped in these wells, and cannot escape due to the water levels not reaching the top layer of cobblestone.

Road: Roads join all structures in the village. They are made of gravel in Plains and Savannah villages, and are made of sandstone in Desert villages. As of 1.8, gravel roads now generate with cobblestone under them to prevent roads from falling into caves and ravines. A cactus may grow on the sandstone road, with a sandstone block on top. Roads may go on for quite a long distance without leading to any village structures, other than lamp posts. In Pocket Edition, if a road leads to a body of water, a bridge of oak wooden planks takes its place.

Lamp post: Lamp Posts can be found throughout villages. They are made of three stacked fences topped with black wool, to which four torches are affixed, with one on each side.

Hut: Huts have a two-tiered roof, dirt floor, and windows, and sometimes a table. They may or may not be inhabited upon the village spawning, and if there are villagers present in these huts, there is only one.

Small house: Small Houses are similar in size to huts, but have a cobblestone or sandstone floor. They always spawn with a flat roof. As with huts, they generate with no more than one villager. Unlike most other buildings, small houses have no door upon spawning. Without doors, they do not count as homes for villagers. Though they appear like huts, they are a separate building type. Some small houses have a fence railing around the roof, which is accessible via a ladder. They can be used as basic watchtowers.

Large house: Large Houses are composed of the same materials as small houses, though they do spawn with doors. However, they are much larger in size and are L-shaped. Large houses lack proper lighting, containing only 1 torch inside. This generally leaves these buildings unsafe, as hostile mobs often spawn in the back area of these houses.

Butcher's shop: Butcher Shops have small seating areas made of two wooden stairs and a table between them. Nearby is a double stone slab counter, presumably for cutting up meat. A fenced off backyard is located behind the building and is accessed through a door. The yard is also presumably for the butcher to raise animals, but the spawn of animals is not increased for the yard. These are also referred to as taverns, with the stone slab as a counter or bar area.

Library: Libraries are longer and narrower than other buildings. They are furnished with a row of wooden or sandstone stairs as a bench, in front of two tables, with a row of bookshelves above. They also have larger windows than any other kind of buildings, but lack any form of lighting. A crafting table is located in the corner, and a Mushroom may grow on the top.

Smithy: A smithy is a fairly complex building, with stone or sandstone slabs lining the roof. On the front of the building is a small porch with an awning supported by fences. Three cobblestone/sandstone stairs lead up to the porch from the road. On the porch is a small pool of lava, surrounded on one side by iron bars. There are also two furnaces and a work table made of one double stone slab. An opening leads to a small back room with a chest containing a random selection of items (listed below). Smithies do not spawn with a door. Be warned that adding a door to a Smithy will slowly kill your villagers, as their AI for determining which side of the door is "inside" will get it wrong and think the front porch is inside. This will result in villagers idling on the porch at night and getting picked off by zombies.

Farm: Farms can come in small and large varieties. All consist of plots separated by rows of water, surrounded by wood logs or sandstone. The small farms contain two 7&times;2 plots of crops (wheat, potatoes or carrots), separated by a row of water. Larger farms are essentially two small farms combined side-by-side, with a walkway down the middle in lieu of a third water row.

Church: Churches are tall buildings, composed of 3 floors, two of which are accessed by ladders that are naturally spawned. The first floor is the main floor, containing stairs which form an "altar." The second floor is an empty floor with windows on all 4 sides, it is presumably the priest's quarters. The third floor is the top of the tower, which provides a wide view of the surrounding area. They are also commonly referred to as watchtowers or castles.

Frequency of village structures
The number of buildings composing a village can vary, and not every village is composed of all buildings at once. Apart from the well, which is unique and systematic, the number of buildings of each type is randomly generated, and increased in superflat worlds. Structures are picked from a weighted probability list (libraries are more common than butcher shops). There may be fewer buildings of a given type than the maximum allowed. The number of lamp posts has no restriction, as they are generated where no other buildings can be placed. Gravel roads are found between the buildings of the village and often extend beyond them.

Blacksmith chest loot chart
One or more slots in the chest that spawns in a Blacksmith Shop may be populated with items from the following list. There may be more than one slot containing the same type of item, but the numbers per slot do not exceed these limits:

Expanding and creating villages


The player can add more doors to a village to cause more villagers to spawn there. For every valid door in the village it will produce 0.35 of a villager. The requirements for a valid village door are that more spaces must be "outside" on one side of the door than the other. A space is considered "outside" if the sun hits it directly during the day, i.e., there is nothing above it except for transparent blocks like glass. Any space that is not transparent, or is shaded from above, is considered "inside". It will look at the 5 blocks in a straight line on each side of the door, and count the number of "outside" spaces. If the number of "outside" spaces on one side of the door is different than the number of outside spaces on the other side, it will be a valid door. For a guide on what constitutes a valid house and the mechanics and behavior of villages, see the tutorial on village mechanics.

With the addition of Zombie Villagers and the ability to cure them into villagers, it is feasible to create a village anywhere a house can be made and zombies can be spawned, given the materials to cure the zombie villager. If the player has access to a zombie spawner (found in naturally-occurring dungeons), a village can "easily" (at great cost in gold and potions) be created by curing the zombie villagers spawned from it and corralling them (like cows or pigs) into nearby enclosed area. However, they will continue to attempt to wander and will not multiply unless a legitimate village is created following the villager housing criteria.

History

 * Notch originally worked on Villages by himself, but eventually gave the task to Jeb, so that he could work on other things.
 * A picture of villages was released by Notch before 1.8 was released. In the early screenshots, villages were partly made of Moss Stone.
 * Villages were shown to the public during the PAX 2011 demo, including the interiors.
 * Jeb has said that during early tests of villages, the lava in a smithy often set the village on fire.
 * An early interview with Notch discussed his plans for the village.

Trivia

 * Villages are optional as part of the setting for generated structures.
 * If gravel paths go through a tall grass area, upon generation tall grass will quickly (but not instantly) realize it's in an invalid location. It will then break and it may drop seeds. If you run to a village the moment it appears on the horizon you may get there in time to see the unbroken tall grass on the gravel. However you are far more likely to see it if you use the setblock, clone or fill commands (or a map editor) to replace terrain (since the change is happening close to you instead of in the far distance).
 * Farms in the villages avoid overhanging by filling in the area below them with dirt. When the farm overhangs a ravine, this can cause a very tall rectangular dirt structure that at first glance almost looks like a chunk error.
 * Occasionally, surface ravines will be generated through villages, causing missing pathways or even entire buildings sunken into the ravine. This also applies to cave entrances and other surface oddities.
 * The well acts as the "center" of the village in reference to Minecraft's code. For example, in 12w21a and above, if a well generates in a desert, all buildings and paths will be made of sandstone, even if all other buildings are in an adjacent plains biome. The well also appears to be the point where village-locating tools will point to. This explains why there is always exactly one well in each village.
 * Sometimes buildings can generate so that their entrances are buried. You have to uncover the entrance, or dig in through the walls.
 * Alternatively to the above, entire villages can be rarely found 2 or more blocks higher than the gravel path with no stairways going up to the houses.
 * It is possible for the foundations of structures built by NPCs to continue down into a ravine, if spawned on/next to one. Technically not a bug, but a way of dealing with uneven terrain.
 * Since valid doors require "outside" (read: sunlit) space within 5 blocks of one side, cavern cities are impractical without 1x1 sunlight shafts within the 5-block line straight out from the door.
 * The upper limit for village size using Superflat preset editing is 6741. If you attempt to use a preset to make a village any larger, it will act as if the preset were for the default size, though the preset will not change.
 * If you create a superflat world using the water-world preset, villages will spawn underwater.
 * In the Demo Version there is a village at X:-955 Y:69 Z:-1200. It has a Well, a Lamp post, a Hut, 2 Small houses, a Butcher's shop, a Library and 3 Wheat Farms generated in the map.
 * Sometimes, villages will be generated part way underwater, due to issues when generating the village.
 * Due to the absence of Pressure Plates in Pocket Edition, tables are made up of 1 fence and 1 brown carpet instead.