Updated:
The easy way: a spawn egg
- Place a spawner:
/give @p spawner(Bedrock:mob_spawner). - Right-click it with the spawn egg of the mob you want.
This works in creative mode on both Java and Bedrock.
Place one with a command (Java)
/setblock ~ ~ ~2 spawner{SpawnData:{entity:{id:"minecraft:zombie"}}}
This puts a zombie spawner two blocks in front of you. Change id for another mob.
Adjust the spawning (Java)
/setblock ~ ~ ~2 spawner{SpawnData:{entity:{id:"minecraft:skeleton"}},MinSpawnDelay:100,MaxSpawnDelay:200,SpawnCount:4,MaxNearbyEntities:6,RequiredPlayerRange:16,SpawnRange:4}
| Field | Meaning | Default |
|---|---|---|
MinSpawnDelay / MaxSpawnDelay | Ticks until the next spawn (20 = 1 second) | 200 / 800 |
SpawnCount | Mobs it tries to spawn each time | 4 |
MaxNearbyEntities | Stops spawning when this many are nearby | 6 |
RequiredPlayerRange | Only active with a player this close | 16 |
SpawnRange | Size of the spawning area | 4 |
Short delays and large counts make a server lag. Change the defaults a little at a time, even for farms.
Give a filled spawner item (Java 1.20.5+)
/give @p spawner[block_entity_data={id:"minecraft:mob_spawner",SpawnData:{entity:{id:"minecraft:blaze"}}}] 1
The spawner already contains the mob when placed. block_entity_data needs the id of the block entity.
When nothing spawns
- Light: zombies, skeletons and similar mobs do not spawn in bright light.
- Space: the mob needs room and a block to stand on.
- Distance: no player within RequiredPlayerRange.
- Peaceful: hostile mobs never spawn.
Bedrock Edition
The Bedrock ID is mob_spawner. Delay and count cannot be changed with commands, so set the mob with a spawn egg.
Common questions
- Spawner or /summon? /summon creates a mob once; a spawner keeps creating them.
- Can I mine a spawner in survival? Not even with Silk Touch; it only drops experience. Place a new one with a command instead.
- Can spawned mobs have gear? On Java, put the same NBT you would use in /summon inside
SpawnData.entity; see the summon generator.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.