Monster Spawner

Spawners are cage-like blocks that spawn mobs. They have a miniature mob spinning around inside them.

Obtaining
Spawners cannot be obtained in survival, even with Silk Touch. They can be mined quickly with a pickaxe and drop some experience, but mining a spawner without a pickaxe takes longer and drops no experience.

In Java Edition, spawners are not found in the creative inventory and are the only block that cannot be picked with. They can be obtained only by using the command, which gives a pig spawner by default; the mob can be changed by  a mob spawn egg on the block. The /clone command can also be used to create spawners. In Bedrock and Legacy Console Editions, empty spawners can be found in the creative inventory or can be picked with.

Natural generation
Spawners can generate naturally in these places, spawning mobs chosen randomly when generated:


 * Dungeons
 * Placed in the center of the dungeon. It may be a zombie spawner (50% chance), skeleton spawner (25%), or spider spawner (25%).


 * Mineshafts
 * Cave spider spawner heavily surrounded by cobwebs.


 * Woodland mansions
 * Spider spawner heavily surrounded by cobwebs in a rarely generated secret room.


 * Strongholds
 * Silverfish spawner. Located in the end portal room. One per stronghold.


 * Fortresses
 * Blaze spawner. Located on fortress balconies with stairs leading up to them. Normally two per fortress.

Usage
The spawner spawns mobs in an 9×9×3 area (see ) around it when the player is within 16 blocks. Suitable spawning locations for the block's mob type are provided in the area. The spawner attempts to spawn 4 mobs around it, then wait from 10 to 39.95 seconds before spawning more.

When obtained as an item and placed, it spawns pigs by default in Java Edition, or appears empty in Bedrock Edition and Legacy Console Edition.

The spawned mob can be changed by a spawn egg on the spawner.

In Peaceful difficulty, spawners still appear and work, but any spawned hostile mobs disappear immediately after spawning. Zombie pigmen, magma cubes, and ghasts do not spawn at all.

Spawners are transparent in their rendering only - unlike most other transparent blocks, they can have torches and redstone components placed on them, conduct a redstone current, suffocate mobs, and exhibit other behavior of opaque blocks.

Spawners cannot be moved by pistons.

Mechanics
A spawner activates when a player comes within a spherical radius of 16 blocks from the center point of the block; i.e. 15.5 blocks from the block itself. While the block is active, it spawns mobs within an 8×3×8 block volume (8 wide, 8 long, and 3 high) centered on the center of the block, effectively meaning mobs can spawn in a 9×9 horizontal area, or 3.5 blocks vertically from the spawner. Mobs can spawn anywhere in this range that is suitable, with mobs more likely to spawn closer to the spawner than farther away.

While mobs are spawned at fractional x and z-coordinates (i.e. not aligned to blocks), they are spawned at an integer y-coordinate. Horizontally, a mob can spawn with its center point anywhere within the 8×8 range, but vertically, mobs spawn with their legs at either the same layer as the spawner block, one block above it, or one block below it.

For some types of mobs to spawn in the outer planes of the spawning volume, some planes outside the volume may also need to be free of opaque blocks to conform with the mobs' height, width, or other rules governing their individual spawn volumes. For mobs that are two or more blocks tall such as zombies, skeletons, or blazes to spawn in the top y-layer, the layer above that must contain only air.

For all of the volumes listed in the table, the horizontal plane is centered on the center of the spawner block. While the spawning volume for pigs is 8.9×2.9×8.9, the requirement of grass blocks that are necessary for pigs to spawn reduces the actual volume in which they successfully spawn, however other mobs can spawn in mid-air, ignoring general rules about spawning on solid ground.

A spawner does not have to be near or in the correct biome to spawn biome-specific mobs. As such, spawners can place mobs where they normally wouldn't generate. For example, a mooshroom spawner can operate in a plains biome as long as there are mycelium blocks within the spawn area.

The block attempts to spawn 4 mobs at randomly chosen points within the spawning area, then wait anywhere from 200 to 799 ticks (10 to 39.95 seconds) before spawning again. As it waits, the mob inside the block spin faster and faster. Except for spawning on a solid block, all of the usual requirements for spawning must be met (not in a solid block, correct light level, etc.), so the spawner often produces fewer than 4 mobs. When it does spawn, it emits a "poof", and more flame particles temporarily appear around it. If the block fails to spawn any mobs because it did not pick any suitable locations, it repeats this process every tick until it succeeds. It starts waiting for the next cycle after it spawns at least one mob. If, at the time of spawning, 6 or more mobs of the spawner's type are present within a 9×9×9 area centered on the spawner block (in Java Edition) or a 16×10×16 area centered on the lower northeast corner of the spawner block (in Bedrock Edition), the spawner "poofs" without creating any mobs and then waits for the next cycle.

Disabling
A spawner of a mob that spawns only in dark conditions cannot spawn mobs in any blocks where the light level is higher than 7. Placing a torch on any side of one of these spawners will disable it. However, blaze spawners are a special case as they require a light level of 11 to stop spawning. Therefore either a dense 7 x 7 grid of torches on the spawner Y level is required, or a minimum of 16 Jack o'lanterns or glowstones in the specific pattern here on the right.

Custom spawners


Using commands, spawners can be customized in many ways:
 * They can be made to spawn any kind of entity.
 * A single spawner can spawn multiple different entities, chosen at random from a list.
 * Properties can be set on the spawned entities.
 * Various range and timing properties of the spawner can be changed.

Detailed technical information about custom spawners can be found below.

Block entity
A monster spawner has a block entity associated with it that holds additional data about the block.

Trivia

 * Spawners containing zombies or skeletons have a chance for the mob spinning inside to have armor.
 * Spawners in mushroom fields, mushroom field shore or the Void biome can function normally, despite those biomes having no hostile mobs spawn naturally.
 * Although in Bedrock Edition a spawner emits light level 3, the only effect on gameplay is to make an inactive spawner slightly more visible in a very dark area because mob spawning and crop growth effects are always the same for light levels 0-3.