Tutorials/Villager farming

This guide seeks to teach the player how to “farm” villagers. The method of farming is similar to other animal farms. However, villager breeders are significantly more difficult to construct.

Purpose
Farming villagers can be beneficial for a host of reasons. If the player has a villager trading hall, then the player will need to fill it with villagers and replace the ones that the player discards. It is difficult to do this through kidnapping villagers alone, so having an artificial breeder can be very helpful.

Another use is for an iron golem farm as they will only work with a certain number of villagers (10 per golem). For example, if the player wanted to be able to store ten golems in the same village at the same time, the player will need 100 villagers. That is a lot of villagers, and it is only possible in the practical sense if the player builds a villager breeder beforehand.

Mechanics
Unlike for other breedable mobs, villager breeding cannot be forced. However, the player can provide for ideal accommodations to make the process efficient. The decision for a villager to show heart particles depends on how “willing” a villager is to mate. If two villagers nearby are willing at the same time, they will spawn a baby villager in between them, like other animals. There are many factors of willingness, but it most importantly depends on the food that the player feeds the parents. To feed villagers, the player must throw the food to them, and let them obtain it in their inventory. Below is a table that tells the player approximately how much food they must give to a villager before they are willing.

Willingness can be increased if the player trades with the villagers. Also, a farmer villager will throw excess food to other villagers. So, if the farmer has free access to crops, and they are within range of a village, then that village will be able to support the autonomous feeding of villagers.

There are more parameters to willingness than just the food villagers have. Villagers take a census of the population of their village about every minute. They will only become willing if the population is at or lower than 35% of valid village doors, rounded down. So, if there are 21 village doors, enough to start spontaneously spawning iron golems, the villagers will continually mate until there are about 7 villagers within the village. The population is counted based on whether the villagers are within 5 blocks of a door that is recognised as a valid house, in spherical distance. An infinite villager breeder can consist of 6 doors that are more than 5 blocks away from the breeding villagers, with a villager nearby to register the doors to a village. By placing the doors farther than 5 blocks away from the breeder, the villagers will think there is only the one detector villager in a 6-door village. Using the 35% rule shows that the villagers will try to mate until there are 2 villagers in that village. No other villagers can get in range of the doors, however, so mating will occur continuously and endlessly. When using this method, it's recommended to have a way to stop the villagers from breeding, so that they don't produce so many villagers that the game starts to lag.

Setting Up
The area around a villager breeder must be carefully scoured to ensure the breeder works correctly. The village must be small, so the player must ensure that no other villages exist within an 80-block spherical radius. No matter what the player builds, at least three villagers will be needed to initiate the process. Here are what roles they will play in a villager farm:
 * 1) Farmer - collect food from nearby crops to feed the breeder villagers, can be any brown-coated villager
 * 2) Breeder - collects food from the farmer and they both do the breeding work
 * 3) Detector - registers the nearby doors to a village so that breeding can occur

In some cases, the farmer will be too busy collecting crops. If this is the case, it may take longer to get baby villagers. Increasing the amount of breedable villagers within the farm (by keeping bred babies inside), will help solving that problem as well as increase breeding speed in general.

Designs
Here are four different designs for villager farms. They all produce an infinite number of villagers, although the villagers in the second and third videos require food in order to breed (for the first and fourth video, the food is already worked into the design).