minecraft
This article is about the practice. For the block on which crops grow, see Farmland. For the village feature, see Farm.
A small  and  farm.

A small carrot and potato farm.

Farming refers to the systematic production of renewable resources. The technique is typically used to get blocks, food, experience and other desired items. Specific types of farming are listed below.

Automation

Farms can be classified as manual, semi-automatic, and fully automatic. Manual farms rely mostly or solely on the player to harvest and restart the farm. Semi-automatic farms use mechanisms to automatically harvest the farm, but they are manually activated by the player. Fully automatic farms do not rely on the player at all and usually use mobs or more complicated mechanisms.

There are other limits to farming regardless of automation:

Many farms require their chunks to be ticked;. In Bedrock Edition, all loaded chunks in the world are ticked, but in Java Edition, a chunk must also have a player nearby – specifically, some player must be within 128 blocks (horizontal distance only) of the chunk's center. This affects most block changes, including farmland and other crop farms.

Mobs will generally despawn if they do not have a player nearby; details vary by version, but in general mobs can randomly despawn if no player has been within 32 blocks for at least 30 seconds (sometimes 10 seconds), or if no player is within 128 blocks. In either case, the chunk needs to still be loaded for the despawning process to work. This affects most mob farms, especially those which depend on hostile mobs.

Many mobs are protected from despawning; by way of summary:

Within survival mode, this allows using properly-prepared hostile mobs as part of a farm, e.g., a nametagged zombie in an iron farm.

Mob farming

Animal farming
Using wheat, seeds, beetroot, and carrots to breed animals, to be slaughtered for their products or used in egg, milk, or wool farming.
Bee farming
Using flowers to breed bees to store in beehives and bee nests, and make honeycomb and/or honey.
Hostile mob farming
Creating spawn rooms for hostile mobs to be killed for their drops.
Villager farming
Farming villagers requires the player to have enough beds and job site blocks for each villager for them to breed.
Guardian farming
Farming guardians by funneling them to a concentrated area for materials and/or experience.
Blaze farming
Farming blaze rods from blazes.
Pillager farming
Farming crossbows, emeralds, iron tools‌[Bedrock Edition only] and ominous banners from pillagers.
Drowned farming
Farming tridents, nautilus shells, rotten flesh and copper ingots from drowned.
Slime farming
Farming slime balls from slimes.

Experience farming

The reason to farm experience is to easily enchant items, or repair tools and armor. Many common experience farms require a difficulty above Peaceful, as they require mobs to spawn. Other uncommon farms use other ways to gain experience, such as fishing or furnaces.

Spawner farming

Spawner farming involves waiting at an active monster spawner for monsters to spawn. This includes mobs that do not spawn naturally without the use of spawners, such as cave spiders.

These can be automated with a water pathway transferring the mobs to a convenient collection or killing area.

A similar system can be used to adapt "dark-spawn farms" to experience harvesting: Mobs are funneled into a grinder to soften them up, then a killing chamber where you can take a sword to them without being targeted. There are several considerations here, the hard part is doing them all at once:

Furnace farming

Even in peaceful mode, certain crops can be auto-farmed and directed into an automated furnace or smoker. The experience from the smelting is accumulated until the furnace is manually emptied or broken.

Given automatic farms for smelting stock, fuel, and disposal, the only real limit is how much time a player is willing to let a furnace collect experience between harvests. A full chest of items contains 1,728 items, which requires 144 minutes (2 hours 24 minutes, over 6 game days) in a smoker, double that in a plain furnace.

Fuel is difficult to supply automatically, but a bamboo farm may be able to keep up. Alternatively, a fuel chest can be loaded with dried-kelp blocks. A chest full of 1,728 items can be smelted by 18 lava buckets, 22 blocks (or 216 pieces) of coal, 288 logs crafted to planks, 87 dried kelp blocks... or four chests full of bamboo.

The smelted result can be collected for use, or discarded.

Fishing

Fishing provides a steady stream of experience, food, and treasure. Catches include enchanted rods, bows, and books, which can be used directly, combined in an anvil, or converted to experience in a grindstone.

Fishing initially yields an average of 12 experience points per minute, which Lure III can increase to 28 points/minute. The rain bonus increases that to over 33 points/minute. At 28 points/minute, fishing for a Minecraft day (20 minutes) yields 560 experience, enough to raise a player from nothing to level 20.

Trading for Bottles o'Enchanting

Cleric Villagers can sell you Bottles o'Enchanting, providing a source of experience which can be stored and used at your leisure. They are expensive (3 emeralds apiece), but various crop farms (see below) can let you earn vast amounts of emeralds. Buying the bottles also grants the usual experience for trading. Each stack of 64 bottles offers an average of 448 experience, enough to elevate to level 18 from zero.

Food and other crops

Wheat, Carrot, Potato, Beetroot farming, and Sweet Berries
Farming wheat, carrots, potatoes, beetroots, and Sweet Berries
Pumpkin and Melon farming
Farming pumpkins and melons
Vine farming
Vines can be farmed for use instead of ladders, decoration, or crafting mossy stone bricks or mossy cobblestone. Cave vines can be found in lush caves, but they can only be acquired if they are mature with glow berries. The Nether also offers weeping vines and twisting vines.
Kelp farming
Farming kelp for fuel or decoration.
Bamboo farming
Farming bamboo for fuel, sticks or scaffolds.
Sugar Cane farming
Farming sugar canes to make paper and sugar.
Chorus Fruit farming
Farming chorus fruit for food and popped chorus fruit, which makes purpur blocks and end rods.
Mushroom farming
Farming mushrooms for use in mushroom stew or creating huge mushrooms. They can be farmed in darkness, in the Nether, or (in any light) on mycelium or podzol blocks.
Nether Wart farming
Farming nether wart for use in brewing.

Block farming

Cactus farming
Farming cacti for green dye or traps.
Cobblestone farming
Creating a stone or cobblestone generator for self-repairing shelters or harvesting.
Obsidian farming
Creating an obsidian generator for obsidian-intensive builds.
Ice farming
Farming ice using a self-refilling rink.
Tree farming
Farming trees for wood, saplings, apples, or charcoal.
Wool farming
Farming wool for many different uses
Basalt farming
Farming basalt for many different uses

Several other blocks can be produced in place and then harvested:

Item farming

Bone Meal farming
Farming bone meal.
Iron farming
Farming iron ingots by killing iron golems spawned in large villages.
Gold farming
Farming gold nuggets by killing zombified piglins, which spawn in the Nether or near Nether portals in the Overworld.
Egg farming
Farming eggs for use in cake, pumpkin pie or creating chickens.
Cocoa bean farming
Farming cocoa beans for use in cookies or creating brown wool.
Snow farming
Trapping a snow golem and digging the snow it produces.
Fish farming
Farming fish, experience and other items by fishing with the use of a fishing rod.
Honey farming
Farming honey bottles and honeycombs from bee nests.