Monster Spawner

A monster spawner is a cage-like block that can spawn mobs, the type of which being visible within it as a miniature spinning version. It cannot be obtained as an item or moved by a piston, and drops experience orbs when broken.

Obtaining
Monster spawners cannot be obtained in Survival, even with Silk Touch.

A monster spawner can be obtained in Creative mode by taking it from Creative inventory, by using the command, or by using. It is initially empty and inert, but can be configured to spawn a desired mob by a spawn egg on the placed block.

A, or  command can also be used to obtain a monster spawner.

Breaking
If broken with a pickaxe, a monster spawner drops 15-43 experience. When mined with anything else, it drops nothing.

Natural generation
Monster spawners can generate naturally in the following places:


 * Monster Rooms
 * One in the center of the monster room spawning one of the following mobs with the indicated frequency: zombie (50%), skeleton (25%), or spider (25%).


 * Mineshafts
 * Any number of cave spider monster spawners, densely surrounded by cobwebs, scattered throughout.


 * Woodland Mansions
 * Optionally one spider monster spawner, densely surrounded by cobwebs, in a rarely generated secret room on the 2nd or 3rd floor. It is sometimes visible through the windows from outside.


 * Strongholds
 * One silverfish monster spawner in the end portal room.


 * Nether Fortresses
 * One or two blaze monster spawners on fenced platforms with full-block "stairs" leading up to them. Normally two are generated per fortress, but there can be fewer.


 * Bastion Remnants
 * One magma cube monster spawner hanging from a chain underneath a bridge in treasure rooms.

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

In Peaceful difficulty, monster spawners still activate but do not spawn monsters $$. $$, zombified piglins, magma cubes, and ghasts do not spawn at all and other hostile mobs disappear immediately after spawning.

Monster spawners are transparent, but they behave like in that they diffuse sky light coming from directly above.

$$, they have a hitbox slightly smaller than a full block, and therefore, one can walk on the edge of a supporting full block directly below the monster spawner.

Mechanics
A monster 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 monster spawner itself. $$ an active monster spawner attempts to spawn mobs within a 4-block horizontal and 1-block vertical range; that is, in a 9×3×9 volume centered on the monster spawner. $$, the horizontal spawning range is 4 blocks taxicab distance, creating spawning volume extending 4 blocks in each cardinal horizontal direction from the sides of the monster spawner; its horizontal cross-section is therefore diamond-shaped. Mobs can spawn anywhere in this range that is suitable, with mobs more likely to spawn closer to the monster 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 range, but vertically, mobs spawn with their legs at either the same layer as the monster spawner block, one block above it, or one block below it.

The monster spawner attempts to spawn 4 mobs at randomly chosen points within the spawning volume, then wait anywhere from 200 to 799 ticks (10 to 39.95 seconds) before spawning again. As it waits, the mob inside the block spins 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 monster 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 monster spawner 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 6 or more mobs of the monster spawner's type are present within (i.e. the mob's hitbox intersects) a 9×9×9 volume centered on the monster spawner block $$ or a 16×10×16 volume centered on the lower northwest corner of the monster spawner block (in Bedrock Edition), the monster spawner "poofs" without creating any mobs and then waits for the next cycle. This is checked before each of the four spawn attempts.

Spawning requirements
The monster spawner performs a relaxed version of the ordinary spawning check: the general solid block requirement is removed, but the volume (hitbox of the mob), the light level, and other checks are kept. As a result, 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 solid blocks to conform with the mobs' height, width, or other rules governing their individual spawn volumes. For example, 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. A turtle spawner will only spawn turtles on sand blocks less than 4 blocks above sea level (typically at Y=62).

For all of the volumes listed in the table, the horizontal plane is centered on the center of the monster 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 to 8.9×1.0×8.9. Other mobs can spawn in mid-air, ignoring general rules about spawning on solid ground.

The spawn conditions do not include biomes for most mobs. As such, monster spawners can place mobs where they normally wouldn't generate. For example, a mooshroom monster spawner can operate in a plains biome as long as there are mycelium blocks within the spawn area because the mooshroom's spawning code checks only for mycelium. The reason mooshrooms are not actually spawned elsewhere is that the game does not normally try to spawn them in other biomes: only the mushroom field biome has mooshroom on the list of things to spawn.

Disabling


The way a monster spawner can be disabled depends on the entity it tries to spawn.

For a monster spawner that generates mobs that spawn only in dark conditions (light level = 0), a torch placed on any side or top of the monster spawner is sufficient to disable it for the whole 9×9×3 volume.

For a blaze or silverfish monster spawner, a light level of 12 is required to prevent spawning. This can be achieved by:
 * Laying 9 blocks in the pattern shown on the right using blocks having a luminance value of 15
 * Laying a dense 7×7 grid of torches on the monster spawner's Y level
 * $$, placing a light source of level 15 on four surfaces

A monster spawner is also disabled by filling the spawning volume with solid blocks. This is often used to disable magma cube monster spawners, as magma cubes can spawn in any light level. However, since all magma cubes require the space of a large magma cube in order to spawn, a clever placement of as little as 9 solid blocks a layer above the monster spawner (see right image) can completely disable it.

Custom monster spawners


Using commands, monster spawners can be customized:
 * They can be made to spawn any kind of entity.
 * A single monster 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 monster spawner can be changed.

Detailed technical information about custom monster spawners can be found below.

Note blocks
Monster spawner can be placed under note blocks to produce "bass drum" sounds.

Piston interactivity
Monster spawners cannot be pushed by pistons. They also cannot be pushed nor pulled by sticky pistons.

ID




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




 * See Bedrock Edition level format/Block entity format.
 * See Bedrock Edition level format/Block entity format.

Video
Note: This video is outdated, as monster spawners has been added to the Creative inventory in Java Edition 1.19.3.

Trivia

 * A monster spawner containing zombies can never spawn a zombie villager.
 * $$, monster spawners containing zombies have a small chance to spawn a chicken jockey.
 * Monster spawners containing zombies or skeletons have a chance for the mob spinning inside to have armor.
 * Monster spawners containing spiders have a small chance to spawn a spider jockey.
 * Monster spawners containing Pillagers have a small chance for the mob spinning inside to be a Raid captain in Java Edition.
 * Monster spawners in mushroom fields, the deep dark or the Void biome can function normally, despite those biomes having no hostile mobs spawn naturally.
 * It is possible for a pig monster spawner to generate naturally. If a newer world is loaded in an older version of Minecraft, the monster spawner can lose its metadata, causing it to enter its default state, which is a pig monster spawner. Alternatively, if a buried treasure chest generates next to a monster spawner, it duplicates the monster spawner without duplicating the NBT tag, resulting in a natural pig monster spawner. The chest also gets invalid block (monster spawner) data, making it unopenable.
 * If a monster room monster spawner overwrites a monster room chest during world generation, the monster spawner does not spawn any mobs. It appears as a pig monster spawner, but placing a hopper underneath it reveals the contents of the chest that should have been there.