Villager

A Villager (also called a Testificate from a temporary name tag in Beta 1.9pre1) is a passive NPC (Non-Player Character) that spawns and moves about in NPC Villages. They spawn around the villages and inside the buildings. They spawn at their respective buildings corresponding to the role they have.

Appearance
Their characteristic look is dominated by their large, bald heads, green eyes, monobrows, and long, protruding noses. Villagers' arms are implied to be jointed, with two parts each to create folded arms. The arms are tucked inside the sleeves, with the sleeves touching at the seam in the middle.

There are different types, distinguished by the color of their robes, which signify their role in the community. There are 6 unique skins for the villagers which are found in the minecraft.jar file, but the generic green robe villager is not used in the game on normal maps. Hood texture files are also present, but no mesh currently exists to display them.

Behavior


Villagers will randomly wander around the area of the village. They have no attack, but they do run from zombies and hide in their homes. A death of a villager does not affect nearby villagers' behavior, though if a player's popularity in the village is low, any natural Iron Golems nearby will attack the player.

Villagers have the ability to utilize doors and are therefore able to go in and out of houses. Villagers will hide in houses during the night, rain, or when chased by Zombies. Although it never rains in desert biomes, desert villagers will still attempt to hide from the rain; this means they are actually hiding from the possibility of zombies spawning.

Villagers decide which houses they like. They seem to favor well lit conditions over dimly lit ones, seemingly due to the lower chance of zombie spawning. Villagers favor houses over well lit areas, even if the house is completely unlit. This is probably due to the fact that houses are assumed to be sufficiently lit. Villagers will climb stairs and climb ladders just as a player would.

If all doors in a village are covered so that villagers may not enter and the time is night, they will carry on with their normal business as if it were day time. If all doors are covered but one at night, the villagers will avoid it, for some reason (probably a bug, or they don't want to be overcrowded)

Zombies will find villagers from up to 31 block radius to attempt to break down their doors. Villagers will run away from zombies, which can attack the villagers. Zombie Sieges can occur between these mobs, and the villager's only "natural" defense are the Iron Golems, which protect villagers from nearby mobs. Zombies have a chance of turning a villager into a zombie villager if the difficulty is on Normal or Hard, or Hardcore gamemode.(Easy or Peaceful gamemode have 0% chance of villagers being infected. Normal is 50%, and Hard or Hardcore is 100%) This can also happen with baby villagers, resulting in Baby Villager Zombies or Baby Zombies.

The villagers will "socialize" with each other and passive mobs. This involves two villagers simply facing each other. Villagers can socialize with the player as well, (which happens a lot) if they approach and stand still (they will start moving their heads in a bobbing fashion). On some occasions, villagers will gather in a large group in one point in a village, seemingly without any cause. They are also attracted to pumpkins and doors. They will sometimes appear to socialize with Snow Golems probably because of their attraction to pumpkins.

When villagers are near an Iron Golem, they will stop and stare at it. The Iron Golems sometimes give roses to the villagers, symbolizing the friendly relationship between the villagers and Iron Golems.

Villagers also will not willingly fall off high cliffs. They will not stay away from fire or lava or change their behavior around fires. They will just carry on as usual, and rarely, but possibly, walk straight into the fire and cactus. They will not flee, run, or act differently when being damaged by fire or cactus.

Mating and population


Villagers will mate depending on the number of valid doors. A valid door is any door (within the city radius) where the number of "outside" spaces within 5 blocks (in a straight line) on one side of the door is not the same as the number of "outside" spaces within 5 blocks on the other side of the door. A space is considered to be "outside" if it is hit by the sun during the day, i.e. it is transparent, and has nothing but transparent blocks above it all the way to the sky. (This means that starting a village deep underground, such as in a cavern or buried ravine, is not feasible.) Notice that a door is not a valid door without a roof on one side, or with equal amount of roof on both sides. Sometimes the villager AI (such as mating and housing) doesn't behave as expected until the game is restarted (as in save and quit, then reload the world).

Once housing has been established, villagers will then mate until the number of adult villagers equals 35% of the number of doors. Any remaining children will grow up as usual, resulting in a total number of adult villagers somewhere above one third of the number of nearby wooden doors. The type of villager that the child is doesn't depend on what type the parents are, e.g., two farmer villagers can have a child that is any of the occupations. Unlike other breed-able mobs, the parents and child have no personal interactions other than socializing.

The game engine periodically takes a census to determine the current population of the village. All villagers within the horizontal boundary of the village and within 5 vertical blocks of the center will be counted as part of the population to determine if continued villager mating is allowed. However, any villager within the horizontal boundary of the village and within a vertical distance of 32 blocks downwards of the center of the village will attempt to enter mating mode as long as there is at least one villager within the boundary. Therefore, it is possible to create an unlimited population by holding a single villager within the village boundary and forcing all other villagers outside the 5 block vertical range of the census. If two villagers simultaneously enter mating mode while they are close to one another, they will mate with each other and produce a child.

Villager children will sprint about, entering and leaving houses at will. The villager children will also chase each other around the village to simulate that they are playing tag. These children will sometimes stop sprinting to stare at an Iron Golem. If the Iron Golem is holding a rose, the children will cautiously take the flower from its hands. Although children look smaller than adult villagers, the hitbox of children have been fixed in snapshot 13w06a. Villager children can be infected by Zombies. Zombie children will not burn in daylight and run faster. Villager children can be spawned by right-clicking an adult villager with a villager Spawn Egg.

Professions
Each villager's profession can be identified by its clothing.

(Note that all villagers have brown clothing under their robes/aprons.)

*Note: Generic villagers do not spawn naturally, nor with a Spawn Egg and Zombie Villagers have a 1 in 20 chance of spawning instead of a normal Zombie.

Trading


The trading system is a gameplay mechanic that allows players to trade emeralds for items (and vice-versa) with villagers.

Right-clicking a villager will allow a player to trade with them. Villagers will make offers based on their profession, and will only make trades based on whatever offers they are making. Different offers may be viewed by pressing the left and right buttons next to the currently displayed offer. Most offers involve emerald as a currency, and some item pertinent to the villager's profession. Trading allows the acquisition of uncommon items that would otherwise be fairly difficult to obtain, such as chain armor. It is also the only legitimate method of acquiring a Bottle o' Enchanting in Survival mode. When villagers get a new trade, purple particles and green cross particles appear.

Zombie Villager
A zombie villager looks and acts like a normal Zombie except its head is similar to that of a villager, and are much more rare. They occur when a zombie murders a villager during Sieges and depending on the difficulty, (Hard=100%, Normal=50%, Easy & Peaceful 0%.) they will be zombified and transform into their zombie counterpart. Their eye color changes to red, their heads turn green, and they get the clothes of The Player and stick out their arms. They have a 5% chance to spawn naturally including from a Monster Spawner in zombie Dungeons and the creative spawn egg. They can be cured to change them back into normal villagers. (See below) along with the trivia.


 * Zombie Villagers can be cured by throwing a Splash Potion of Weakness at it, feeding the villager a Golden Apple, and then waiting for a certain period of time until the villager turns back into their normal state. A villager who was infected and cured will not lose their profession.
 * When villagers turn into Zombie Villagers, they become less reminiscent of an actual Villager and more Zombie-like, with their normally wrapped-up arms now held outwards, much like an actual Zombie, with red eyes, tall heads, long noses, and monobrows.
 * Zombie Villagers will continue to attack uninfected villagers even when under the cure. This is why it's important to separate infected villagers from the rest of the villagers during the curing process.
 * Villagers have robes and aprons but when infected, they will change their attire to a regular zombie's clothing.
 * Villagers will normally take between 180s and 192s but they will be cured quicker when there are beds or iron bars nearby. The speed at which they cure is proportional to (the number of these blocks in a 7*7*7 cube around their feet) * 0.3 + 1. This could be to encourage players to put zombie villagers in some sort of prison cell or a pen.
 * Zombie Villagers may spawn from a zombie spawner or egg, and even naturally, (5% chance) and can still be cured

Issues
View the full list of bugs by clicking on the link above.
 * - Villagers crowd into a single building.
 * - Villagers Despawn

Trivia

 * Villagers are not supposed to despawn, however, reports that they can.
 * The villagers were inspired by the shop keepers in Dungeon Master 2.
 * Due to their peculiar look, villagers have been compared to Squidward from SpongeBob SquarePants, Ki-Adi Mundi from Star Wars, or Bert from Sesame Street. Notch himself agreed they look like "Caveman Squidwards".
 * A texture in the main mob directory of Minecraft appears to be the default character texture ("Steve") reoriented to be a villager texture. As is expected, applying it to the current villager model produces a very broken look, as seen to the side.
 * Villagers can climb ladders if they are in their path, like other mobs.
 * Villagers and squid are the only mobs in the game that don't have any sound effects.
 * Sometimes, when children are playing tag, a child may grow up and still be playing tag until the villagers stop for a break. The adult will then continue with a normal life.
 * Originally, the mobs populating villages were to be pigmen.
 * Flaming villagers will ignore the fact that they are on fire and may even continue to stand in it.
 * Villagers treat Zombie Pigmen as Zombies, running from them.
 * C418 is currently working on sounds for Villagers.
 * Villagers will commonly stare at random mobs, and certain blocks. Villagers will also rarely stare at zombies through doors or glass panes.
 * You can manually spawn baby villagers in creative by right-clicking the villager with their spawn egg. This works for all other mobs that can breed.
 * Since villagers will buy renewable resources from you for emeralds, emeralds and anything purchased with them may be considered renewable.
 * The villager was a Pigman before it was added, from the idea for the Zombie Pigman, which was added before the idea for a living Pigman was.
 * When a baby villager is attacked, it usually runs towards its parents.
 * If you go into minecraft.jar, you may notice in the mobs folder, the villager texture looks exactly like the texture of The Player.