Free tool · Minecraft Java

Minecraft spawner command generator

Pick the mob (or several), how often they spawn, how many and whether light matters. The command shows up below, written the way your server's version reads it: with /setblock to place it in the world or with /give to place it yourself.

Timing and range the defaults

Empty means the default. Times are in ticks: 20 ticks are 1 second.

/setblock ~1 ~ ~ minecraft:spawner{SpawnData:{entity:{id:"minecraft:zombie"}}}
78 characters

How to use it

  1. Make yourself an operator: in the server console, op YourName (it's in the guide to admin commands).
  2. With /setblock, the spawner appears at the position you set: ~1 ~ ~ is the block next to you. Paste the command into the chat (T key), with the slash in front. It works the same in survival and creative.
  3. With /give, the spawner lands in your inventory. For it to keep its mob, place it as an operator in creative (gamemode creative); otherwise it comes out empty.
  4. From the panel's Console, type it without the slash and with fixed coordinates (you see them with F3): there, ~ isn't where you're standing.

If nothing spawns

  • Nobody nearby: a spawner only works with a player 16 blocks away or closer (“Player range” changes it). Having the chunk loaded isn't enough.
  • Too much light: hostile mobs need low light to spawn from a spawner too. Tick “Spawn in any light” (from 1.18) or remove the torches.
  • No room: they spawn in free blocks around it, up to “Spawn range”. A zombie needs two blocks of height; a spawner buried in stone spawns nothing.
  • Peaceful: on peaceful difficulty no hostile mobs appear, not from spawners either.
  • The spawner rule: gamerule spawner_blocks_work true (from 1.21.11; in 1.21.9 and 1.21.10 it was called spawnerBlocksEnabled). At NapNodes it's in Settings → Game rules → Mobs → Enable Spawner Blocks. More cases in why mobs aren't spawning on your server.

Ideas for your server

  • A dungeon for an event: zombies and skeletons with weights 3 and 1, “Max nearby” at 4 and “Spawn in any light”, so you don't need to darken the room.
  • A farm at spawn: cows or chickens, with a delay of 400 to 600 ticks and a low “Max nearby” so it doesn't fill up.
  • A boss: for a single mob with a name, health and gear, the /summon generator on the day of the event is better.

Every mob counts: lots of loaded spawners with no cap fill the server with mobs and you notice it in performance. If it stutters, see the lag guide.

Why it changes with the version

The block has been the same since 1.13 (minecraft:spawner), but its tag has changed twice. Since 1.18 the mob goes inside entity (SpawnData:{entity:{id:"minecraft:zombie"}}) and you can choose the light with custom_spawn_rules; before, it went on its own, SpawnData:{id:…}. Since 1.20.5, /give carries the block_entity_data component with a mandatory id:"minecraft:mob_spawner", instead of BlockEntityTag. With the wrong form there's no error: the spawner comes out empty. For /setblock in general, the /setblock command guide.

Frequently asked questions

I gave myself the spawner with /give and it comes out empty

The game only keeps the mob stored in the item if an operator in creative mode places it; otherwise the spawner stays empty. It's so nobody can bring a ready-made spawner to someone else's server. In survival, place it directly with /setblock.

How do I change the mob in a spawner that's already placed?

Run a /setblock on top of it with that spawner's coordinates and the new mob: it replaces it entirely. In creative, right-clicking it with a spawn egg works too.

The spawner is placed, but nothing comes out

Almost always it's that nobody is close enough (16 blocks by default), there's too much light for a hostile mob, there's no room for the mob around it or the difficulty is on peaceful. If none of them work, check the spawner_blocks_work rule: set to false, spawners spawn nothing.

What are ticks?

The game's unit of time: 20 ticks are 1 second. A default spawner waits between 200 and 800 ticks (10 to 40 seconds) between waves, and spawns up to 4 mobs each time.

Can I pick up a spawner with Silk Touch?

Not in the normal game: it breaks and drops experience. You can with a plugin like SilkSpawners or with Purpur's silk touch option.

Does it work for Bedrock?

No. In Bedrock /setblock takes no data tag: the spawner is placed empty and you give it a mob with a spawn egg.

No server yet?

At NapNodes you get a free Minecraft server, no card, on Paper and the latest version, with the panel's Console to type these commands. And if you want to play with no queues and the server always on, the plans have RAM reserved for you alone, with the service status public on the status page.

Create your free server

Guides that explain it

More free tools

All the tools