Minecraft-Zombie-Villager Interaction

## Villagers

A **Villager** (previously called a **Testificate**) is an intelligent passive NPC that the player can trade with.

## Contents

* 1 Spawning
	+ 1.1 Natural generation
	+ 1.2 Baby villagers
	+ 1.3 Zombie villagers
* 2 Drops
* 3 Behavior
	+ 3.1 Picking up items
	+ 3.2 Sharing food
	+ 3.3 Farming
	+ 3.4 Baby villagers
	+ 3.5 Zombies
	+ 3.6 Lightning
* 4 Breeding
	+ 4.1 Willingness
* 5 Professions and careers
* 6 Trading
* 7 Video
* 8 History
* 9 Issues
* 10 Trivia
	+ 10.1 April fools
* 11 Gallery
* 12 References

## Spawning

Villagers will not despawn even if the player wanders away from them.

### Natural generation

Villagers naturally spawn in villages inside various buildings.

### Baby villagers

Villagers can breed, spawning baby villagers. After exactly 20 minutes, the baby villager will grow up to an adult. See this section for more information.

### Zombie villagers

Villagers will spawn if a player uses a splash potion of weakness on a zombie villager and then feeds it a regular golden apple.
 It will then shake and turn into a villager within 5 minutes. During
the change the zombie villager turning villager can still burn in the
sun.

## Behavior

Upon spawning, villagers will leave their homes and begin to explore
the village. Generally, they wander aimlessly inside the village during
the day. They may go indoors or outdoors. Occasionally, two villagers
may stop, and turn to look at each other, in a behavior called
socializing, in which they will stare at a mob (sometimes even a zombie)
 or another villager for a few seconds at a time. In the case of
players, they will continuously stare at them as long as the player is
close enough, unless the villager tries to get into a house at night or
run away from a zombie. When a player attacks a villager, the villager
will not run away, but angry particles will fly out from the villager if
 it is in a village.

Villagers will not willingly fall off high cliffs that would kill
them, but may occasionally take fall damage. They will not stay away
from fire or cacti, nor change their behavior around them, as with most
mobs.

At night, or during a storm, villagers will run inside, closing doors
 behind them, staying indoors until the morning. In the morning, the
villagers will head outside, fleeing from any remaining zombies. Once
the zombies are gone, the villagers will resume normal behavior.

There is evidence that villagers are prone to overcrowding certain
areas of a village while leaving other areas completely empty. There is
speculation that villagers will crowd predictably into set areas;
however, exactly which areas has still not been discovered. It has been
noticed they crowd their church/watchtower very often at certain times
of the day.[1]
 The overcrowding can lead to villagers swarming into a few houses at
night rather than spreading themselves. The sheer amount of villagers
trying to enter such a small area can result in a portion of the
villagers taking more time to enter the safety of their homes. In
extreme cases, some villagers will become stranded outside. There is no
known way to prevent this type of overcrowding.

### Picking up items

Villagers have eight inventory slots. Villagers will not intentionally seek out items to pick up, but they will collect any bread, carrots, potatoes, wheat, or seeds
 they happen to come within range of. These are the only items they are
able to pick up. If a player and a villager are in the pickup range of
an item at the same time, the player will always pick it up first.

### Sharing food

If a villager has enough food in one inventory stack (6 bread or 24
carrots or potatoes, or 18 wheat for Farmers only) and sees a villager
without enough food in one inventory stack (3 bread or 12 carrots or
potatoes for non-Farmers; 15 bread, 60 carrots or potatoes, or 45 wheat
for Farmers), he may decide to share food with that villager.

To share, a villager finds his first inventory stack with at least 4
bread, carrots, or potatoes or with at least 6 wheat, and then throws
half the stack (rounded down) in the direction of the target villager.
When wheat is shared, it is first crafted to bread which may result in 1
 or 2 less than half the stack being shared.

### Farming

Adult and baby brown-robed villagers, both farmers and other careers,
 will tend crops within the village boundary. Villagers far enough
outside the boundary of *any* village will also tend nearby crops.

Farmland to be tended is found by seeking for certain blocks up to 15
 blocks away from the villager in X and Z and up to 1 away in Y (a
31×31×3 area total).

* If a brown-robed villager does not have enough food in one stack in

his inventory (15 bread, 60 carrots or potatoes, or 45 wheat) and finds
fully-grown wheat, carrots, or potatoes, he will move to the crop block
and break it.

* If a brown-robed villager has any seeds, carrots, or potatoes in his

 inventory and finds an air block above farmland, he will move to it and
 plant a crop. They will always plant from the first eligible slot in
their inventory.

### Baby villagers

A group of villager children playing a game of tag.

Baby villagers will sprint around, entering and leaving houses at
will. They will also chase each other around the village to simulate
that they are playing tag. They will sometimes stop sprinting to stare
at an Iron Golem. If the Iron Golem is holding a poppy, the children will cautiously take the flower from its hands.

Unlike other breed-able mobs, the parents and child have no personal interactions other than socializing.

### Zombies

Main articles: Siege and Zombie

Zombies will find villagers from up to 42 block radius (even when the villager is invisible), and will attempt to break down doors.
 Zombies will only successfully break doors if the difficulty is set to
hard; although, only a fraction of zombies spawned in hard mode can
break doors. This also applies to zombie pigmen if they path find
through a door. Villagers will run away from zombies, which attempt to
attack villagers. The villager's only "natural" defense are the Iron Golems, which protect villagers from nearby mobs.
Zombies will kill villagers, or convert them to zombie villagers.
 The chance that the villager will become a zombie villager on death is
0% on Easy, 50% on Normal, and 100% on Hard. Baby villagers can be
infected by zombies as well.

Villagers will also run from zombie pigmen.

### Lightning

When lightning strikes between 3-4 blocks of a villager, it will turn into a witch.

## Breeding

*See also: Tutorials/Village mechanics*
Two villagers mating.

Villagers will mate depending on the number of valid doors.
 Villagers will then mate until the number of adult villagers equals or
is more than 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.

A valid door is any door within the village 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 has nothing but transparent blocks above it all the way
to the sky.

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. If two villagers
simultaneously enter mating mode while they are close to one another,
they will mate with each other and produce a child.

### Willingness

Additionally, villagers must be "willing" in order to breed. After
mating, they will no longer be willing, and must be made willing again.

Villagers may become willing when the player trades with them.
Willingness is granted the first time a new offer is traded, or at a
one-in-five chance on subsequent trades. Green particles will appear if
the villager becomes willing by trading. This will not cause them to
immediately seek out a mate, however.

Villagers can also become willing by having either 3 bread, 12 carrots or 12 potatoes
 in one stack in their inventory. Any villager with an excess of food
(usually farmers) will throw food to other villagers, allowing them to
pick it up and obtain enough food to become willing. You can also throw bread, carrots, or potatoes at the villagers yourself to encourage breeding. Villagers will consume the required food upon becoming willing.

## Professions and careers

Each villager has a profession, which can be identified by their
clothing. Villagers also have careers specific to their profession. The
player can identify a villager's career by reading the title at the top
of the trading interface.
 Below is a table listing the various villagers, with their careers in
relation to their professions, as well as the IDs specifying these.

* Farmer Villager
* Librarian Villager
* Priest Villager
* Blacksmith Villager
* Butcher Villager
* Zombie Villager (hostile)

## Trading

Main article: Trading

The pre-1.8 trading interface displaying a trade of 28 paper for 1 emerald.

The trading system is a gameplay mechanic that allows players to trade emeralds for items and vice-versa with villagers.Their trades can be good or bad, depending on what the cost is and what items you might get. Trading is only available for adult villagers; the player cannot trade with baby villagers.
Right-clicking a villager will allow a player to trade with them, and
 display their career. Villagers will make offers based on their
profession and career, 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 and
 career. 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.

After trading a new offer once, the villager will open a new tier of
trades after a short period of time. After 2-12 times an offer is used,
the villager will lock the trade offer. When this happens, you will have
 to use another new trade offer in the villager's window once (or
several times if it is already used once), and then wait for a short
time. If green particles appear, all trades reopen. There is a maximum
number of tiers each villager can possess, varying by career. Once the
villager has unlocked all tiers, it will not open any new ones. However,
 you will still be able to renew all offers by trading.

When a villager gives off particles from a new trade, they get 10 seconds of regeneration, which gives them 8 ().

In Pocket Edition, trading is currently not available.

## Issues

Issues relating to "Villager" are maintained on the issue tracker. Report issues there.

## Trivia

* The villagers were inspired by the shop keepers in Dungeon Master 2.[2]
* Notch has agreed that villagers look like "cavemen squidwards".[3]
* Originally, the mobs populating villages were to be pigmen.[4]
* Using the command `/gamerule mobGriefing false` will prevent a farmer Villager from harvesting and replanting crops.
* Baby farmer villagers can harvest and replant crops as well as adult farmers.
* You can use a name tag

 on an adult villager directly upon exiting a Nether portal, any other
time will cause the trading interface to open and leave the villager
unnamed.

* Villagers can see invisible players.
* In the Pocket Edition of the game, villagers can leave villages. However, once they leave the village, they rarely come back.
* After a zombie villager is cured, the villager gets Nausea for 10 seconds (indicated by the purple status effect particles).
* When a villager is in love mode, it walks very slowly. However, when

 a villager runs indoors as the night falls, it runs extremely fast,
even faster than the player's walking speed.

### April fools

Main article: Easter eggs#2014

On April 1st 2014, Mojang announced that villagers have taken over
the skin servers and content delivery networks (CDN) as an April Fools
joke. This caused players' current skin to turn into villager skins.
This also caused users to be unable to change their skins. Different
career villager skins were used, including the unused generic villager
(green robe).
Many of the sounds were also changed, supposedly by the villagers.
They seem to be similar to a villager talking (with words, rather than
their normal sounds). The in-game music has also been altered to include
 villager like noises, and also features a villager version of the "Game
 of Thrones" theme on the title screen. The sounds originate from the
sound resource pack created by Element Animation, titled The Element
Animation Villager Sound Resource Pack (T.E.A.V.S.R.P), which is based
on the villagers appearing in their fan videos. The villagers were
voiced by Dan Lloyd, Director of Element Animation.

## Gallery

* Villager in Beta 1.9-pre1, when villagers had the word "TESTIFICATE" displayed over their head.
* A group of villager children socializing together.
* The unused Generic Villager in-game.
* The 13w22a Banner.
* A house full of villagers.
* Villagers can still see invisible players.
* A priest villager giving bread to a librarian.
* A baby zombie villager getting cured.
* A baby villager cured from being a zombie.

## References

1. http://www.minecraftforum.net/topic/1904552-villagers-crowding-and-the-southwest-162/
2. http://www.reddit.com/r/Minecraft/comments/xfzdg/i\_am\_markus\_persson\_aka\_notch\_creator\_of/c5m0p26
3. https://twitter.com/notch/status/123678798691577856
4. https://twitter.com/notch/status/62531431175421952
5. https://minecraft.net

## Zombies

**Zombies** are common, undead hostile mobs.

## Contents

* 1 Spawning
	+ 1.1 Sieges
	+ 1.2 Monster spawners
* 2 Variants
	+ 2.1 Zombie Villagers
	+ 2.2 Baby Zombies
	+ 2.3 Armed Zombies
* 3 Drops
	+ 3.1 Halloween
* 4 Behavior
	+ 4.1 Attacking villagers
	+ 4.2 Attacking Iron Golems
	+ 4.3 Reinforcements
	+ 4.4 Console Edition
	+ 4.5 Pocket Edition
* 5 NBT data
* 6 Achievements
* 7 Video
* 8 History
* 9 Issues
* 10 Trivia
* 11 Gallery
	+ 11.1 Armor
	+ 11.2 Tools
	+ 11.3 Hats
* 12 Notes
* 13 References

## Spawning

In the Overworld,
 zombies spawn in groups of 4 at a light level of 7 or less. Zombies
have a 5% chance to spawn as a zombie villager and a 5% chance to spawn
as a baby zombie. Baby zombies have an additional 5% chance of spawning
as a chicken jockey. This also applies to spawn eggs.

### Sieges

Main article: Zombie siege

If a player is in a village with at least 10 doors and 20 villagers
at midnight, up to 20 zombies may be spawned near the edge of the
village regardless of light level or transparent blocks.

### Monster spawners

Zombies can spawn from monster spawners inside dungeons.

## Variants

### Zombie Villagers

Zombie villagers comprise 5% of all spawned zombies. They behave as
ordinary zombies, but their character model's head and face is
reminiscent of that of a villager, shaded with a darker green hue.

Zombie villagers can also result from zombie attacks on villagers. If
 any type of zombie kills a villager, there is a chance that the
villager will transform into a zombie villager (100% on hard difficulty,
 50% on normal, 0% on easy).

Zombie villagers can be cured by using a golden apple on them while they are under the effects of Weakness, which can be applied using a splash potion of Weakness thrown by the player or a witch.
 A loud hissing sound will be heard if successful, and the zombie
villager will begin to shudder. The transformation will take 2–5
minutes, during which time the zombie villager behaves as normal. While
the zombie is being cured, it will have the strength I effect in normal
difficulty (or strength II on hard difficulty), making it more important
 to isolate the zombie.

* Cured villagers do not retain the trades they had before they became

 infected. Furthermore, zombie villagers that are cured are given
professions at random.

* If the zombie villager is wearing any armor or wielding tools or weapons, those items disappear when the villager is cured.
* During the curing process, it is often a good idea to keep the

zombie villager away from any other zombies, because the other zombies
will attack it after it is cured.

* Conversion can be sped up by around 4% by surrounding the zombie

villager with iron bars and/or bed blocks within a 9×9×9 cube centered
on the zombie villager.[1]
A zombie villager cannot be cured by switching from Easy, Normal or
Hard difficulty to Peaceful; they will simply disappear like all other
monsters.

### Baby Zombies

A baby zombie.

An armored baby zombie riding a chicken.

Baby zombies make up 5% of zombie spawns. They behave similar to regular zombies, with the following oddities:

* They do not burn in sunlight.[2]
* They are faster than the normal zombie and they have the same HP as normal zombies.
* The noises they make are higher-pitched than normal zombie sound effects.
* They can ride chickens.
* Baby zombie villagers will turn into adult villagers if cured.
* Worn armor shrinks to fit their body size.
* They are able to fit through 1×1 block gaps.
* They give more Experience Orbs when killed by the player, except in the Console Edition where they don't drop experience.

Baby zombie villagers are spawned when a zombie kills a baby
villager, the chance of infection being the same as adult zombie
villagers. Baby zombie villagers also spawn naturally, but the combined
chance (5% villagers × 5% babies) is very low at 0.25% of all newly
spawned zombies.

### Armed Zombies

Along with skeletons,
 some spawned zombies can pick up dropped items from the ground. These
zombies will automatically hold any item they come across, but if those
items happen to be armor, weapons, or tools, the zombie will use them. Some of these zombies spawn already in possession of such items, and those items may also be enchanted.
 The chances of that event are listed below and are taken from the
game's code. Zombie villagers can spawn naturally with armor on.

 Pick up

1. Value is based on the regional difficulty.
2. 1⁄3 chance of an iron sword, 2⁄3 chance of an iron shovel
3. Enchantment is the same as on an enchantment table at level 5–22.[note 1]

If a zombie does spawn with armor, the chances of specific armor are as follows:

 Helmet & Chestplate
 Helmet & Chestplate & Leggings
 Full set

The chances of it being of a particular material are:

 Gold
 Chain
 Iron
 Diamond

Zombie armor is not damaged from most damage sources, which means it
cannot "wear out" the way player armor does. Helmets (not blocks) on
zombies can wear away and break if the zombie is exposed to daylight or
has an anvil or other falling block dropped on its head. Zombies also
have a natural armor rating of 2 (), which gives 8% damage reduction from most sources.

If any zombie has a sword
 in their hand, and a sword of a better type or with better enchantments
 is given, they will drop the existing sword (with the same chance as if
 killed with Looting I) and start using the better one. Zombies capable of taking items will also take mob heads,
 which they will wear on top of their existing head. Any zombie that
spawns with equipment (picked-up items don't count) will give 1-3 extra
experience points per item.

## Drops

When killed, zombies drop 0-2 pieces of rotten flesh.

Zombies will rarely drop iron ingots, carrots, potatoes,
 and any naturally spawned equipment. Any picked-up equipment has 100%
chance of dropping and will drop with the same damage level it had when
picked up, while any naturally spawned equipment has a 8.5% (9.5% with
Looting I, 10.5% with Looting II and 11.5% with Looting III) chance of
dropping and will drop with a random durability.

A zombie will drop its head if killed by a charged creeper's explosion.

Zombies drop 5 experience when killed by a player or tamed wolf, and
an extra 1-3 extra experience if the zombie has equipment. If the zombie
 is a baby, it will drop and additional 7 experience, except in the console edition where baby zombies drop no experience.

In the Pocket Edition, zombies will not drop iron ingots at all.

### Halloween

If a zombie wearing a pumpkin or jack o'lantern
 is killed using a tool enchanted with Looting, there will be a chance
equivalent to the level of Looting used to drop the pumpkin or jack
o'lantern, up to a maximum of a 3% chance of a drop.

## Behavior

Zombies can deal damage through closed doors.

A zombie trying to break the door down instead of taking an alternative path.

A zombie with full golden armor and rotten flesh as held item, considered as a melee weapon.

The swinging arms animation.

Zombies spawn in groups of 4 and will pursue the player on sight from
 40 blocks away, as opposed to 16 blocks in other hostile mobs. Zombies
will attempt to avoid obstacles, including sheer cliffs and lava, and
will try to find the shortest path towards the player.[3]
 Unlike skeletons, zombies do not try to avoid being hit, and continue
to pursue the player even when being attacked. Zombies can sometimes
deal damage through a closed door, as shown on the picture to the right.
 Like most mobs, zombies will always float on water, even if their
target is below them.

At dawn, generally when the sun
 is 15 degrees or more above the ground (that is, when the moon can no
longer be seen), most zombies will catch fire and burn once exposed to
direct sunlight. Zombies with head armor are immune to sunlight, but the
 armor piece will take damage. They may make some attempt to seek out
shade during this time, or enter bodies of water to protect themselves
from burning up, but will exit protective areas to chase a nearby player
 or villager. If they attack an entity while burning, they may set it on
 fire, causing additional 4 ()
 damage . If wearing armor enchanted with Thorns while burning they may
set players attacking them on fire with thorns damage alone.

As zombies are undead mobs, they are harmed by the status effect
Healing and healed by the status effect Harming. They are also immune to
 regeneration and poison.

Zombies take 25 seconds underwater to die through drowning, they start taking damage at 16 seconds underwater.

### Attacking villagers

Zombies will attack villagers within 42 blocks, and they can always
see villagers through walls. Once a zombie has focused on a villager,
the zombie will ignore any other villagers and the player, until its
target is dead or a mob or player attacks.

Zombies will bang on closed wooden doors, and on Hard (and Hardcore) difficulty, up to 14.5% of them (depending on regional difficulty) can succeed in breaking them down. Otherwise, the door will crack, but not break. Iron doors are always safe. In Pocket Edition, zombies cannot break down wooden doors at all.

### Attacking Iron Golems

Zombies will attack iron golems within 42 blocks.

### Reinforcements

On hard difficulty, zombies can spawn additional zombies to “help”
when damaged. Each zombie has a "likeliness to call reinforcements"
statistic which ranges from 0–10%, and "leader" zombies (0–5% depending
on regional difficulty)
 get a bonus of 50–75 percentage points to the stat. When the zombie is
damaged by an entity or is damaged while targeting an entity, up to 50
attempts will be made to randomly choose a spawn location (0 or ±7–40
blocks away in all three axes) that is above a block with a solid top
surface, has light level 9 or lower, has no players within 7 blocks, and
 has no colliding entities or blocks at which to spawn the
reinforcement. Both the damaged zombie and the new zombie will have a 5
percentage point penalty to their "likeliness to call reinforcement"
stat, making it less likely that an infinite number of zombies will
spawn.

On all difficulty levels, damaged zombies will also call all other zombies within a 67×67×21 to 111×111×21 area[n 1] centered on the attacked zombie to target the attacking player, like zombie pigmen.

These effects can be negated by killing the zombie in as few hits as
possible, by using environmental damage such as cactus or lava, or by
ignoring them.

### Console Edition

In Console Edition,
 most of the zombie and villager reactions are present; however, the
special door-breaking tag is not present and as such all zombies can
punch doors.

### Pocket Edition

Zombies are attracted to villagers, but can't break down doors.
Zombies, unlike their PC counterparts, cannot pick up armor or items,
nor do they spawn with them.

## Achievements

 golden apple (by facing the zombie and pressing the left trigger with a
 golden apple in your hand)

## Issues

Issues relating to "Zombie" are maintained on the issue tracker. Report issues there.

## Trivia

Zombie texture

* Zombies can climb ladders, but will only do so if their path finding runs them into one.
* Zombies can frighten villagers from behind walls of glass. Villagers

 will even run into a fire to "escape" from zombies behind glass.

* Zombies' attack range is a bit higher in the Console Editions than the PC version.
* If a zombie spawns wearing multiple pieces of armor, the armor will

never be mismatched (i.e. all pieces will be made of the same material);
 the same applies for skeletons.

* The hat part of zombie texture can be used for zombie villagers, but it will be cubic instead of a parallelepiped.
* Zombies will not catch fire if they are caught in cobwebs.
* A zombie holding an item given by a player will not despawn when left alone.
* Currently, zombies have the most subtypes of all the mobs:
	+ This is because zombies can be zombie villagers, baby zombies, armed, armored, or any combination of the above.
	+ Baby zombies can also rarely be chicken jockeys.
* Zombie villagers will drop normal zombie heads when killed by a charged creeper.

## Gallery

* A zombie emerging from a dark cave.
* Dying zombie in the PC version.
* Dying zombie in the Pocket Edition.
* More recent version.
* Zombies breaking down a door.
* Zombie trap using a spawner. 97 zombies trapped.
* A zombie horde that spawned outside a village.
* A baby zombie villager riding a chicken.
* A height comparison between the player and the zombie. Note the zombie being higher than the player.

### Armor

* First image of armed and armored zombies released by Dinnerbone.
* A zombie that spawned wearing chain armor.
* A zombie villager wearing golden armor.
* A zombie wearing leather armor.
* A zombie wearing chain armor.
* A zombie wearing iron armor.
* A zombie wearing gold armor.
* A zombie wearing diamond armor.

### Tools

* An armored zombie that picked up a bookshelf.
* A zombie holding a piece of wool.[9]
* A zombie wielding an iron shovel doing its attack animation.
* A zombie villager with an enchanted iron sword.
* A zombie holding an iron shovel.

### Hats

* Zombies wearing pumpkins on Halloween.
* A baby zombie wearing a jack o'lantern on its head on Halloween.
* A zombie wearing a player head.
* A zombie villager wearing a wither skeleton skull.

## Notes

1. The inradius is based on the `followRange` stat: base value is 35, ±5% random spawn bonus, then plus 0–50% random zombie-spawn bonus

## References

1. https://www.youtube.com/watch?v=CYIAfv291k4
2. MC-3115
3. https://www.youtube.com/watch?v=3aDYJZLmtxQ
4. https://www.youtube.com/watch?v=ubDJT1KamSE&t=144s
5. https://twitter.com/notch/status/21723172931895296
6. https://twitter.com/Dinnerbone/status/243645556872855552
7. https://twitter.com/jeb\_/status/240381873480687616
8. http://www.reddit.com/r/Minecraft/comments/yrjp8/zombies\_can\_pick\_up\_items\_from\_the\_ground\_in\_the/c5y7uma
9. https://twitter.com/jeb\_/status/240381873480687616

==

Zombie Siege ==
**Zombie Sieges** are in-game events that occur when many zombies spawn in a village. They occur regardless of how well lit or walled off a village is.
As the behavior of zombies in sieges is nearly identical to that of
randomly-spawned zombies and all zombies have a very large search
radius, it can be difficult to determine if a large number of zombies
attacking a village is an actual siege or just an attack by a greater
than usual number of randomly-spawned zombies.

## Contents

* 1 Mechanics
	+ 1.1 Starting a siege
	+ 1.2 Spawning zombies
* 2 Defense tactics
* 3 Recovery
* 4 Video
* 5 History
* 6 Issues
* 7 Trivia
* 8 Gallery

## Mechanics

At midnight each night, there is a 10% chance that a zombie siege
will be attempted that night. If a siege is to occur, attempts will be
made each tick to start the siege until either a siege is successfully
started or the sun rises (specifically, the siege is abandoned when the
sky light level reaches 12).

### Starting a siege

Each village has a center (defined as the geometric center
 of all the village's doors) and a size (either 32 or the euclidean
distance of the farthest door from the center, whichever is greater).
For each player, the village with a center nearest that player where the
 player is less than the village's size + 1 blocks from the center (by
euclidean distance) is a candidate for a siege.

If the candidate village has fewer than 10 doors or fewer than 20
villagers or the village has not been "stable" (no doors added or
removed) for at least 20 ticks (1 second), the next village is
considered.

Ten attempts are made to choose a random point on the circle with
radius 0.9 times size centered on the village that is not within the
bounds of any other village. The Y value of the chosen point is that of
the center of the village. If all ten attempts fail, the entire siege
attempt fails but another may be attempted on the next game tick.

If a valid point is found, 10 attempts are made to randomly choose a
valid siege zombie spawning location (see below) within a 16×16×6 box
around the chosen point. If no valid spawning location is found, the
next village is considered. If a valid spawning location *is* found, the siege is started at that point.

### Spawning zombies

Siege zombies spawned inside a roof made of stairs and surviving in sunlight

Zombies spawned for a siege ignore player proximity, light levels,
and the presence of other mobs. Only the minimal spawning conditions are
 checked:

* the spawning block must be non-opaque and non-liquid
* the block directly below it must have a solid top surface (opaque, upside down slabs / stairs and others)
* the block directly below it may not be bedrock
* the block directly above it must be non-opaque
* the block must be within the target village

Note in particular that siege zombies can spawn *inside* transparent blocks such as slabs that normally prevent mob spawning.

For the siege, 20 attempts are made to spawn a zombie over the course
 of 2 seconds. For each zombie, 10 attempts are made to randomly choose a
 valid siege zombie spawn point within a 16×16×6 box around the chosen
point. If a valid spawn point is found, a zombie is spawned.

Zombie villagers are never spawned as part of a siege, but all other
variation (e.g. baby, jockey, equipment) is determined as for normal
random spawns.

For the most part, the zombies that are part of a siege will behave
in the same manner as randomly-spawned zombies. They will also despawn
as usual if the player is far enough away. The exception is that if they
 happen to wander more than the village's size blocks away from the
center of the village, their AI will take them back towards the village
center if they are not actively pursuing a target.

Villagers, Iron Golems, and other mobs do not differentiate between siege-spawned zombies and randomly-spawned zombies.

## Recovery

If at least two villagers survive the siege and doors are rebuilt as necessary, the villagers can mate
 and repopulate the village. The village will be safe from future sieges
 until the population reaches 20. Without player intervention, however,
it is likely that villages will be wiped out by sieges and
randomly-spawned zombies.

Even if no villagers survive, a village may be repopulated by curing zombie villagers
 (either randomly spawned or those created from zombie-killed villagers
on normal or hard difficulty), or by luring in villagers from another
village.

## History

 1.2.1
 12w07b
 12w08a
 1.4.7
 1.8
 0.9.0
 TU12

## Issues

Issues relating to "Siege" are maintained on the issue tracker. Report issues there.

## Trivia

* When a zombie is attacking a targeted villager, it will ignore the

player and any other villagers unless a player or other mob attacks it.

* Zombies also attack villager children.
* Rain or storms can allow siege start attempts to continue past dawn, since they reduce the sky light level.
* Although zombies are the only mob that attacks villagers, Iron

Golems still attack other hostile or neutral mobs. This is probably
because they can be created by the player for self-defense, not for
defending a village.

* Sieges can occur in player-made villages and mushroom biomes, despite zombies not spawning in mushroom biomes naturally.
* In Pocket Edition, Zombies attempt to reach villagers inside buildings, though they are unable to break doors.

## Gallery

* A group of Zombies breaking down a wooden door, two of which are villagers.
* An Iron Golem killing a zombie during a siege, preventing the zombie from breaking down the door.
* A siege ending because of the zombies burning in the daylight.
* A siege while it's raining in another biome. The zombies are burning because it doesn't rain in desert biomes.
* A zombie attacking a villager while the other one is trying to run.
* 3 Villagers taking cover in a Large House during a zombie siege.
* Spawn area model of the zombie siege.