Minggu, 07 Oktober 2012

NPC Village

NPC Villages are groups of buildings inhabited by non-player characters (NPCs)�Villager mobsthat spawn naturally in the world. They only occur in the plains or desert biomes. Villages in Desert biomes have the buildings made of Sandstone, Smooth Sandstone, Chiseled Sandstone, Sandstone Slabs and Sandstone stairs instead of wooden or cobblestone features.

Structures

The buildings and structures that make up a village are:
  • Wood huts are made of oak wood and oak wooden planks, with a rounded roof, dirt floor, and glass panes for windows. Some have a fencepost-and-pressure-plate '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 houses, similar in size to wood huts, but made with more planks, fewer wood blocks, and a cobblestone floor. Their roof is flat, and may have fenced off balcony with access provided by ladders. As with wood huts, they generate with no more than one villager. Unlike the other buildings, small houses have no door.
  • Large houses are composed of the same materials as small houses. However, they are much larger in size and are L-shaped. Two farmers always spawn in these houses.
  • Butcher's Shops have small seating areas made of two wooden stairs and between them a pressure plate-on-fence table. Nearby is a double stone slabcounter, probably for cutting up the 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 they never spawn there. A butcher has a white work apron and always spawns in his shop. A farmer will also spawn.
  • Libraries are longer and narrower than other buildings, and have a row of wooden stairs as a bench in front of two pressure plate-on-fence tables, with a row of bookshelves above. A crafting table is located in the corner. One librarian villager with a white robe always spawns in each library.
  • Farms can come in small and large varieties. The small farms contain four rows of crops of wheat. A row of water separates the four rows into two groups of two. Larger farms are essentially two small farms combined. The farms are bordered by wooden logs, and in large farms, a walkway of logs also runs down the middle. Farms often seem to spawn in clustered areas near many small huts, possibly suggesting the poorer villagers who reside in the huts work on the farms. In 12w36a or above, carrots or potatoes can be found on a farm.
  • Wells are 2x2 pools filled with water, surrounded by cobblestone and have small roofs of cobblestone supported by fences. The wells are normally 10 blocks deep, but are only 4 blocks deep on Superflat worlds due to the low elevation. There is only one well in each village. Wells usually spawn near the center of the village with roads leading out from all sides. Wells do not provide an infinite water source unless the player inserts a layer of blocks below the top level of water, allowing the pool to replenish itself when water is withdrawn.
  • Blacksmiths are primarily made out of cobblestone, with wooden walls on the far side, (away from the lava) and stone slabs lining the roof. On the front of the building is a small porch with an awning supported by fences. 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 back room with a small room and a small chest containing a variety of items (listed below). One blacksmith villager with a black work apron always spawns near each Blacksmith but often wanders off. The lava can rarely set nearby structures on fire, which was a problem Jeb tweeted about during development.
The approximate chance of finding each item is as follows:

ItemQuantityWeightChance
Bread1 � 31562%
Red Apple1 � 31562%
Iron Ingot1 � 51047%
Iron Sword1527%
Iron Pickaxe1527%
Iron Helmet1527%
Iron Chestplate1527%
Iron Leggings1527%
Iron Boots1527%
Oak Sapling3 � 7527%
Obsidian3 � 7527%
Gold Ingot1 � 3527%
Diamond1 � 3317%
 equipped with ladders and glass panes to a balcony on the top. One priest villager with a purple robe always spawns in each church.
  • Lamp posts can be found throughout villages, made of stacked fences topped with black wool, to which four torches are affixed, with one on each side.
  • Gravel roads connect most of the buildings.
The number of buildings within villages varies considerably, and not all types of buildings will be in every village. There is always exactly one well; for other buildings, the maximum number is chosen at random, and is increased in superflat worlds. Structures are picked from a weighted list, in which some are more likely than others (for example, libraries are more common than butcher shops). Due to the nature of the generation algorithm, there may actually be fewer buildings of a given type than the chosen maximum. There is no fixed limit on the number of lamp posts; they are generated when no suitable place is found for other buildings. Gravel roads often go out of the village for quite a distance, leading nowhere.
StructureWeightDefault maximum
range
Superflat maximum
range
Wood hut32 � 53 � 8
Small house42 � 43 � 6
Large house80 � 31 � 5
Butcher's shop150 � 21 � 3
Library200 � 21 � 3
Small farm32 � 43 � 6
Large farm31 � 42 � 5
Blacksmith150 � 10 � 2
Church200 � 11 � 2

Finding NPC Villages

One method is to find the possible places that villages can spawn by using a superflat world, where a lack of terrain makes villages spawn more often. This method will not always work:
  1. Find your seed number. This can be done by pressing "/" and typing "seed".
  2. Create a creative, superflat world, using that seed.
  3. If the computer being used is sufficiently powerful, set the render distance to "far".
  4. Fly around and search for an NPC village.
  5. When you find one, press F3 and find the coordinates.
  6. Go to these coordinates on your other (first) world.
  7. An NPC village (not the same design but still an NPC village) will have spawned there.
The above does not always work because NPC villages only spawn in flat biomes (plains 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 2 select default world type (as opposed to superflat). This makes it harder to see NPC villages, but each NPC village found is much more likely to exist in the original world.
There are also programs like AMIDST (by Skidoodle) to map worlds that will display all villages of the world/seed.

Defending and Rescuing NPC Villages

If a player stays in or near an NPC Village overnight, they are likely to encounter a Zombie Siege. Zombies will spawn within the village, regardless of light level, and attack the villagers. While the villagers will attempt to hide in their houses, zombies will be capable of breaking down their doors even on normal mode (this is believed to be a glitch). Sufficiently large villages may have Iron Golems to help defend them, but even so, without aid from the player, the village is likely to be depopulated within a few sieges. (If there are fewer than two villagers remaining at any time, they will be unable to respawn, and even if they can respawn, this process will be too slow to recover from the zombie attacks.) There is also the matter that Villager AI is woefully insufficient for their survival -- even without zombies, they are prone to falling into nearby caves or pits, dancing on cactus, and otherwise getting themselves killed.
Accordingly, player assistance will be needed to help the village survive, consisting of the following steps:
  1. Until the village is fenced (see below), players should not spend the night within 128 blocks (their mob despawning radius) of the village borders.
  2. As quickly as possible, they should light the entire area (including inside buildings), and build a fence completely enclosing the village, taking the usual care to make sure that nearby blocks do not allow mobs to jump over the fence from outside. While this will not protect against the siege itself, it will prevent 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 will blow up parts of the village. Alternatively, wait till nightfall, and then place a block in front of every door in the village that is holding villagers. The villagers won't be able to wander, and the zombies won't be able to attack them.
  3. The player should go out at night and fight zombies.
  4. When morning comes, the player should replace any doors that have been broken. Do not try replacing the doors with iron doors -- sure, the zombies can't break them, but neither will the villagers recognize an iron door as a "village door", for spawning purposes.
  5. In version 1.4, zombies will not merely kill villagers, but will convert them to Zombie Villagers. If a player has been to a Nether Fortress, they may be able to cure these unfortunates as follows: (a) Splash them with a Potion of Weakness, then (b) Feed them a Golden Apple (nugget version), and (c) wait.
  6. In version 1.4, even a depopulated village will occasionally spawn Zombie Villagers, who can then be cured to repopulate the village.

Expanding NPC Villages

See also: Tutorials/Creating NPC Villages

The bare minimum that a house can be. A door with at least 1 building block at same height within 30 blocks. Villagers will congregate within a few blocks of the door regardless of structure size.

A surprisingly "acceptable" house for a villager who tries to escape the rain
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 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.
  • Buildings may be constructed out of most kinds of blocks provided that they are not transparent.
  • To properly register each door, a villager must be within a radius of 16 blocks horizontally and 3 to 4 blocks vertically of it. Doors may unregister if there are no villagers within range for a period of time.
  • Each door successfully registered as a house counts as 35% of a villager, meaning that every 3 registered doors produces a villager and every 20 registered doors is an additional 7 villagers.
Perhaps the easiest way to increase villager population is to make a kind of building some players call, "love shacks." These shacks are simply a building three blocks tall with large dimensions that for walls simply have alternating column and door. These are extremely efficient and easy to make.
For a slightly more natural way to make expanding easier, given the choice, villagers prefer areas where numerous doors back onto an area - like a communal square; this is almost always occupied as the chance of there being an active door within 16 blocks or so of the square is very high relatively speaking.

Criteria for an acceptable house

General criteria tested:
  • With door - villagers enter acceptable structure upon downfall (rain/snow) (does not enter without door of course, as a door determines a house)
  • No lighting (the existence of a light source is irrelevant in determining house eligibility)
  • Grass floor (floor surface does not seem to be relevant, also experimented: Jack-o-Lanterns, ice, bookshelves, gold ore as floors - all acceptable, although ice was interesting to watch)
  • Interestingly, whether the door was placed inside the frame, or on the bordering block outside the frame in any fashion, the villager entered in all cases (diagrams below)
  • Floor does not have to be at door level (inside floor can have a 1 block drop immediately after door without stairs, or 1 block up as long as door frame accommodates head space)
  • Acceptable structure does not require a roof cover (top can be completely open to rain and villager will attempt to escape from it inside the open top structure)
    • In fact, an acceptable "house" can be as minimal as a door, and then any single building block at the same height and within 30 blocks
  • Villagers cannot directly find a house unless there are no more than 15 blocks between them and the door only, regardless of any of the structure (also without random wandering in the right direction)
  • Villagers will attempt to squeeze as many of themselves as possible into 1 structure if it is the nearest house
  • A lone door will not be seen as a structure to a newly spawned villager, although destroying all of the structural blocks will not cause previous residents to forget about the house, and they will often congregate within 3 blocks of the "inside" of the door where the structure used to be
  • Note that regardless of structure size, villagers will stay within 3 blocks of the door while "actively" occupying the house
  • The final definition of a "house" seems to be: any door that has at least 1 building block at the same height, and within 30 blocks of the door.
Door placement:
Acceptable (natural village standard)
(inside)
BlockCSS.pngBlockCSS.pngBlockCSS.png
(outside)

Acceptable
BlockCSS.pngBlockCSS.pngBlockCSS.png
BlockCSS.pngBlockCSS.pngBlockCSS.png
Acceptable (for some reason)
BlockCSS.pngBlockCSS.pngBlockCSS.png
BlockCSS.pngBlockCSS.pngBlockCSS.png
BlockCSS.pngBlockCSS.pngBlockCSS.png

Acceptable
BlockCSS.pngBlockCSS.pngBlockCSS.png
BlockCSS.pngBlockCSS.pngBlockCSS.png

Creating NPC Villages

Main article: Tutorials/Creating NPC Villages
The player is capable of founding a new village by "transplanting" villagers from an existing village, as long as the following conditions are met:
  • Must be at least 40 blocks from the "boundary" of the existing village, or else villagers will simply return to the village.
  • There must be homes at the new village, or else the villagers will simply wander.
As a villager cannot be manually pushed far past the boundary of the village, a common method for transplanting villagers from an older town to a newer one is placing tracks, and pushing the villagers into minecarts - they will simply sit in the minecart and not react to the village border as they pass it, until they are removed from the cart. Villagers may disappear when traveling in minecarts only to reappear when the minecart is broken. It is often helpful, but not required, to place the doors of the homes after the arrival of the villagers to speed detection. You can also simply destroy all the doors in the villages which will remove the boundary.


History

Notch originally worked on NPC Villages by himself, but eventually gave the task to Jeb, so that he could work on other things.[1]
Jeb has said that during early tests of villages, the lava in a smithy often set the village on fire.[2]
NPC villages were added in Beta 1.8. Originally, NPC Villages were intended to be populated with Pigmen,[3] but in Beta 1.9 Pre-release, Villager mobs were added to spawn in NPC Villages.
A picture of NPC villages was released by Notch before 1.8 was released.[4][5] In the early screenshots, villages were partly made of Moss Stone. Even though the picture only showed the exterior of the buildings, videos recorded later during PAX revealed the interior of the structures.
NPC Villages are most often spawned in desert or plains biomes. This is probably due to the fact that while villagers wander, they are prone to falling off of cliffs and other tall structures, much as a wolf will. It is implied that villages will have their own biome in order to solve many of the problems that were hindering their development.[6]
As of 12w07a, Villagers will automatically repopulate according to the number of available houses in the Village. This is useful, because Zombie sieges have also been implemented, which hordes of zombies will have a chance to spawn near villages at night and attack Villagers. The player may supplement the amount of available houses by creating structures that consist of an area with a roof and wooden door.
As of 12w08a, Iron Golems will spawn near villages in order to protect the Villagers against any mobs in its sight, except passive mobs, wolves, and certain hostile mobs, such as the creeper, due to its potentially destructive nature when aggravated.
Since Minecraft snapshot 12w21a the player can trade with Villagers using emeralds.
As of 12w21a, NPC Villages change style according to their biome (e.g., the structures are made of sand/sandstone when any NPC villages are spawned in a desert).
As of 12w32a, villages now keep track of the 'popularity' of players by username. A player's popularity starts at zero, and ranges between -30 and 10, and the following can alter a player's popularity:
Popularity of Actions
ActionPopularity Change
Trading a villager for the last offer slot on their list+1
Attacking a villager-1
Attacking a villager child-3
Killing a villager-2
Killing a village's Iron Golem-5
A player's popularity is not reset by death, and players cannot alter other players' popularity. In addition, a player's popularity is stored per-village, meaning a player may be popular in one village and notorious in another. When a player's actions are direct on a villager, particles will appear around that villager to indicate the change in popularity.
Presently, popularity has only 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. The only limit to this aggression is a distance of approximately 13 quinquagintillion (10^153) blocks, which is many times larger than the size of the Minecraft world: therefore, if an iron golem is in a loaded chunk, it may become aggressive to a player at any possible distance in-game.
Finally, this snapshot added a mechanic to encourage 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.

PAX

NPC Villages were shown to the public during the PAX 2011 demo. For demo purposes, Notch made them appear near the spawn so people could see them.[7] On a live stream from his Android phone during PAX, Notch stated that NPCs were not added to the villages but that they were coming eventually. (According to Jeb, NPCs for the village was delayed until Beta 1.9.[8]) The majority of the NPC structures are made from wood based resources, with frames of cobblestone, and the footpaths are 3 blocks wide and made of gravel. The gravel appears to replace the top layer of dirt (or sand) upon generation of the village.[9]

] Old interview of Notch

Notch once answered some questions about an idea he had, NPC Villages, where he revealed some thoughts about them[10]:
  • If you treat the Villagers well (giving them items), they'll give you items back. (This has been fulfilled with the addition of trading.)
  • If you treat the Villagers badly (attacking/killing them), they'll try to do the same to you. (This has been partially fulfilled with the addition of Iron Golems, and in the 1.4 snapshots.)
  • Raiding chests will anger the owners of the town/chest and they will attack.
Eventually these villages will have more player looking NPC's. Also, trading has been Jeb's main focus on villages.


Gallery

Iron Golem


Iron Golem
Village Golem.png
Health Points100 (Heart.svg � 50)
Attack Strength7 (Heart.svgHeart.svgHeart.svgHalf Heart.svg) to 21 (Heart.svg � 10.5)
SpawnNear a group of 16 Villagers and 21 houses in any light level or anywhere created by The Player
First Appearance12w08a
Network ID99
Savegame IDVillagerGolem
DropsItemCSS.png Iron Ingot(3-5)
BlockCSS.png Rose (0-2)
Experience0


Iron Golems are large, strong utility mobs. Their main purpose is to defend Villagers in NPC Villages from hostile mobs and siegeattacks.on Golems spawn in NPC Villages naturally, provided there are 16 adult Villagers and at least 21 houses (counted as doors). An Iron Golem will also spawn in player-made villages. The chance of spawning is 1 in 7000 per tick.
The golems can be crafted using blocks in a similar fashion to Snow Golems. To do so, the player must vertically place 4 blocks of iron in a T-shape, and place a Pumpkin or a Jack-O-Lantern on top, the pumpkin must be placed last. 4 blocks of iron are equivalent to 36 Iron Ingots, making creation difficult, as iron can sometimes be difficult to find. They will always spawn facing south. Iron Golems cannot be manufactured by a pistonassembly line without player(s) interaction.


Behavior

Iron Golems slowly roam in villages, avoiding water and lava at all times, although they cannot drown. When provoked, Iron Golems will move quickly toward their target, and once in range will swing their arms up violently to attack, dealing 3� to 10� hearts damage and flinging targets into the air. They can take damage from lava, fire, poison, cacti, and suffocation. They do not take fall damage or drowning damage. They can climb up any solid surface that is at most 1 block high, and can climb down ledges and holes if the bottom is at most 3 blocks deep and at least 2 blocks large. However, they seem to be unable to climb down when walking on top of fences. They won't try to avoid contact with cacti, and might walk on top of them if they are able to do so. Upon death, Iron Golems drop 3 to 5 iron ingots and 0 to 2 roses.
Iron Golems have a comparatively large attack range, allowing them to attack through a solid 1 block thick wall, even without line of sight to the target. If an Iron Golem generated as part of an NPC Village is killed, another will eventually spawn to take its place.
An Iron Golem with a red flower in its hand.
Iron Golems will attack all hostile and neutral mobs if any come within their sight, except Creepers, Slimes, Magma Cubes, and Ghasts. Iron Golems likely do not attack Creepers because of Creepers' destructive nature, which may destroy sections of the village. While they do attack Zombie Pigmen, this only causes them to become aggressive against the Iron Golem and not against player characters.
Naturally spawned Iron Golems will attempt to attack the player if the player attacks them first, but will quickly give up. But if the player attacks a nearby Villager, Iron Golems will pursue the player (only in Survival Mode). The Iron Golem does not have to directly see the player attacking a Villager to become hostile toward the player. If an Iron Golem is provoked by the player attacking it or a villager, the Golem will become neutral again after the player runs away. Iron Golems created by the player will not attack the player; in SMP however, they may attack the player if the server has restarted. Any Iron Golems generated through other means will not defend any Villagers, and have a habit of wandering off.
Iron Golems are able to hold roses and give them to Villagers, symbolizing the friendly relationship between the Villagers and Iron Golems.
Iron Golems will only attack hostile mobs if the hostile mob is within 5 blocks of the Iron Golem. It also must be on equal ground with the mob. During village sieges, however, a naturally spawned Iron Golem will seek out any hostile mob threatening a Villager, regardless of distance.
Iron Golems are also able to be (CAREFULLY) pushed up ladders; though they are not able to climb them more than one square naturally themselves. (This is similar to Snow Golems.)


Uses

Defense

An Iron Golem's primary purpose is to defend NPC Villages from Zombie attacks, usually during a siege. Although slow, their high health and damage prove them to be great defenders. They swing their arms during their attacks, causing enemies to be thrown into the air and usually killed in one or two attacks. Player usage might involve enclosing Golems in a large fenced-off area to prevent their wandering off, although such control of the area could be accomplished in simpler ways.
Iron Golems are very strong mobs, being third only in terms of number of lifepoints to the Ender Dragon and the Wither. However, because they require a large amount of iron and a pumpkin, players often tame wolves because they are much easier to obtain. Just like tame wolves though, Iron Golems will not attack creepers.
Take note that while Iron Golems have an easy time of dealing with spiders, zombies, and skeletons, they have a bit more trouble taking down endermen. This is because of the endermans natural speed and slightly higher health. It may be wise to help your Iron Golems with the fight if they engage an enderman so as to minimize damage to the golem.

Farming

Example of an Iron Golem lava trap
An example of Iron Golems spawning directly in liquid
In Minecraft 1.2.1 and above Iron Golem farms that were made in 12w08a appear not to work, this was caused by a change to the spawning conditions.
It is possible to make a fully automatic iron and rose farm by building a "house" (see the trap example image below for details) in which Villagers can spawn. If an area is made in which only Golems can spawn, then a trap can be set up to obtain the Golem's drop items. Golems need a 2x2 blocks wide and 4 blocks high space (even though they're only 3 blocks high) to spawn and they can spawn in a 16x16x6 area (at most distance) (see the spawn conditions image for details) centered in the center of the village (for maximal control, no nearby [which means in a 50x50 area] houses should be made, if you're making the trap near a natural village, or your house, make sure there are no doors so they won't be classified as houses).
In order to spawn, the village must contain more than 20 doors. One Iron Golem will be able to spawn for every 16 Villagers in a village. So 16-31 Villagers spawn 1 Iron Golem, 32-47 spawn 2 Iron Golems, etc. There is no limit for the number of Iron Golems per village.
There are several ways to kill Iron Golems and obtain their drop items. The following are the most effective ones:
  • Suffocation by a sticky piston and a block. The killing can start instantly after spawning but it will clog up the trap, making other Golems unable to either spawn or die, depending on the design.
  • By lava that won't touch the Golem's feet (since this is where the drops appear). This is the most damaging (and therefore the quickest) of the automated killing methods. An example picture of this method is shown to the right.
Note: Falling and drowning traps are ineffective as Iron Golems don't take fall or drowning damage.
If the Iron Golems are dropped at least 7 blocks below the floor block(s) of the house, they will immediately be outside the village boundaries, and therefore detached from the "village," so a new Golem will be able to spawn, even before the previously village-attached Golems have died.
If there is no other spawn space available, Iron Golems will be able to spawn inside liquids, meaning an instant lava killing trap is possible, as shown on the picture to the right. Dropping the Iron Golems out of the spawn boundaries as soon they spawn, however, could be seen as preferable to this method, as it ensures a higher Iron Golem spawn rate.
The traps could have a collection area, where the player can pick up the drop items. It is possible to have multiple Golems spawn in one area to make a very effective farm.
Note: If your Villagers aren't spawning any Iron Golems and there are no other houses nearby, dropping water on the Villagers will update them, and force them to start the Iron Golem spawning, provided the spawn conditions are met.
If a player is short on resources and time but still wants to harvest the iron from Golems, the player can simply suffocate the Golems with blocks of sand or gravel. Golems are very slow-moving and tend to wait at the same spot when not patrolling a village, so it is very easy to drop 3 blocks of sand or gravel on top of them and wait for suffocation.



HERE ARE SOME PICTURES ABOUT IRON GOLEMS