How to Build a Mob Farm in Minecraft (Gunpowder & XP)
A mob farm is the single best "set it and forget it" machine in survival Minecraft. Build one and you get a steady stream of gunpowder (for TNT and fireworks), bonemeal from skeletons, and a torrent of XP for your enchanting table — all while you AFK. This guide covers the spawning rules that make it work and a tower design you can build in an afternoon.
How mob spawning works
Before placing a single block, understand the four rules that every mob farm depends on. Get these wrong and you get an empty room.
| Rule | What it means for your farm |
|---|---|
| Darkness | Mobs only spawn on solid blocks at light level 0. Seal the farm from sun, moon, and glowstone alike — one lit corner kills that layer. |
| Player distance | Mobs never spawn within a 24-block sphere of you, and despawn beyond roughly 128 blocks. Your AFK spot lives in that 24–128 band. |
| Solid floor + space | The block must be opaque and solid with at least 2 blocks of clear space above it. Carpets, glass, and slabs (on the lower half) do not count as spawnable. |
| Mob cap sharing | The world has a mob cap. If a cave full of zombies sits under your base, it steals spawns from your farm. Build high up or over an ocean so there is nothing else to spawn nearby. |
The dark-room tower design
This is the classic "stacked dark rooms" design: several identical spawning floors stacked into the sky. Mobs spawn on each floor, walk onto a center hole lined with open trapdoors (they think it is floor), fall through, and drop onto a campfire that finishes them while leaving the XP orbs for you to collect.
Materials (for a 6-floor tower)
| Item | Approx. amount | Used for |
|---|---|---|
| Solid blocks (stone, deepslate, any) | ~6–8 stacks | Walls, floors, the shaft |
| Trapdoors | ~50 | Lining each floor's center hole |
| Water buckets | 2–4 | Pushing mobs toward the hole (optional but smoother) |
| Campfire (no hay block under it) | 1 | The kill chamber — 1 dmg/0.5s, mobs die but drop XP |
| Signs or slabs | a few | Stopping water/lava from overwriting the campfire |
| Hopper + chest | 1 each | Collect the loot automatically |
| Scaffolding or ladders | as needed | Getting up to build and to your AFK ledge |
Build steps
- Pick a build height. Stand on the ground where you will build, then fly or pillar up 100+ blocks. Higher = fewer competing cave spawns.
- Make a floor. Lay an 9×9 (or 11×11) solid platform. Leave a 2×2 hole in the exact center.
- Wall it in, keep it dark. Build 3-high walls around the edge and put a roof on top. No torches, no windows — light level must be 0 inside.
- Trapdoor the hole. Place trapdoors flat over the center hole, then flip them open. Mobs path toward the hole, step on the "floor" that is actually open, and fall.
- Stack more floors. Repeat steps 2–4 directly above, separated by 3 blocks. Six floors is a sweet spot for effort vs. rate.
- Build the kill chamber. At the bottom of the central shaft, place a hopper feeding a chest, then a campfire on top of the hopper. Mobs drop onto the campfire, die, and drop loot + XP.
- Add your AFK ledge. From the chamber, build out 24–128 blocks (or straight up) to a safe spot with a roof. Stand there.
Where to build it
- Over a deep ocean is ideal: there is no seafloor cave system nearby to steal the mob cap, and the open water guarantees a dark, empty 128-block radius.
- In the sky over land also works — just go high (100+ blocks). The point is to leave nothing else spawnable within range.
- Avoid building at ground level near your base or a cave system; you will spend hours watching an empty farm.
What you get & how fast
A 6-floor tower at a good location typically yields 1,000–4,000 XP per hour and a steady pile of:
| Drop | From | Use it for |
|---|---|---|
| Gunpowder | Creepers | TNT, fireworks (Elytra boost & crossbow), fire charges |
| Bones | Skeletons | Bonemeal for farms and instant crop growth |
| Rotten flesh | Zombies | Feed a tamed wolf, or trade to some villagers |
| Ender pearls | Endermen (if they spawn) | Reach the End — pair with our Ender Dragon Guide |
| XP orbs | All of the above | Mend gear and fuel the enchanting table |
Rates at a glance (survival-tested)
A 9×9 spawning floor, built 100+ blocks up over ocean, single-player, optimal AFK spot:
| Floors | Approx. mobs / hr | Approx. XP / hr | Gunpowder / hr |
|---|---|---|---|
| 2 | ~400–700 | ~800–1,500 | ~40–70 |
| 4 | ~900–1,500 | ~1,800–3,000 | ~90–150 |
| 6 (guide build) | ~1,400–2,400 | ~2,800–4,500 | ~140–240 |
| 8+ | ~2,000–3,500 | ~4,000–6,000 | ~200–350 |
XP figures assume you collect the orbs (a hopper-less kill zone) rather than letting them expire. Yields scale with floor count until server or entity limits bite.
AFK setup
To keep the farm running while you step away:
- Stand on your ledge 24–128 blocks from the farm.
- Place a bed nearby and set your spawn, in case you get disconnected.
- If in a zombie-heavy area, keep a shield or a 1×1 safe corner — strays and skeletons can still shoot you from the ground far below, but the open sky usually keeps you clear.
- Collect XP passively: the orbs fall to the chamber; walk over them (or use a hopper-less design where you stand in the kill zone) to bank levels.
What to do with the loot
The farm is a means, not an end. The two payoffs:
- Gunpowder → TNT & fireworks. TNT is the fastest way to strip-mine for ancient debris (see our Netherite Guide); fireworks are your Elytra fuel and a lethal crossbow load.
- XP → enchants. Bank a few levels, then spend them wisely — our Enchanting Guide shows the 15-bookshelf setup and the anvil strategy that avoids "Too Expensive!", and the XP Calculator tells you exactly how much farming each level costs.