Tutorials/Villager farming

All you need to breed villagers in any update after 1.14 is a big enough space with 3 beds and give each villager enough of the right food; then they create a baby villager.

Purpose
Farming villagers can be beneficial for a lot of reasons. If the player has a villager trading hall, then the player must 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 work with a certain number of villagers; see Tutorials/Iron golem farming.

Mechanics
Unlike for other breedable mobs, villager breeding cannot be forced. However, the player can provide ideal accommodations (beds and food) 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 meet and spawn a baby villager in between them, like other passive mobs. There are many factors of willingness, but it depends mostly 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. A villager requires 12 food points to be considered ready to breed. Below is a table indicating the number of points for each food item. Any mix of the items mentioned can be used as long as they total at least 12 points.

Willingness can be increased if the player trades with the villagers. Also, a farmer villager can 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 can 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, comparing their population to the number of available beds. They become willing only if the population is less than 100%. This depends on the number of beds. There must be at least one bed for each villager, and each bed must be reachable by some villager. If there is an excess of beds, villager breeding commences.

The beds require a full two blocks of space above them; the bed itself counts as a full block, and so does any top slab that may be used for the ceiling. Essentially, the baby villager needs to be able to bounce on the available bed.

A historical note: The current breeding mechanics were instituted by the the Village & Pillage update; where the population limit is now set by number of beds, formerly it was set by the number of doors in the village, where there were various rules defining a valid door (roughly, there had to be an identifiable "inside" and "outside").

Automatic breeder
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 are needed to initiate the process. Here are the roles they play in a villager farm:
 * 1) Farmer - collect food from nearby crops to feed the breeder villagers, can be any villager in a straw hat (brown coat pre-1.14)
 * 2) Breeder - collects food from the farmer and they both do the breeding work
 * 3) Detector - registers the nearby beds (doors at 1.13 or earlier) at a village so that breeding can occur

If the farmer is too busy collecting crops, it may take longer to get baby villagers. Increasing the amount of breedable villagers within the farm (by keeping bred babies inside), helps to solve that problem as well as increase breeding speed in general.

Manual breeder
To make a manual breeder, you just need to build a space big enough for 3 or more beds. Then throw the food to the villagers so that they can breed.