Command blocks let you spawn mobs, items, and structures with a single command instead of placing them by hand

A command block is a special block in Minecraft that runs commands when activated. You place it, type a spawn command into it, and it executes that command — summoning a mob, dropping items, or creating structures at the location you specify. Command blocks only work in Creative mode or on servers where the owner has enabled them, and they're faster than building or placing things manually when you need the same thing multiple times.

The most common use is spawning mobs. Instead of waiting for a creeper to appear naturally, you can command a creeper to spawn exactly where you want it, with specific equipment or effects already applied. You can also spawn items, armor stands, or entire structures if you know the right command syntax.

Key Takeaways

  • Command blocks only work in Creative mode or on servers where the owner has enabled them; Survival mode blocks them by default.
  • You find command blocks in the Creative inventory under the "Redstone" tab, or get them with the command /give @s command_block.
  • The basic spawn command is /summon [mob name] [x] [y] [z], where the coordinates tell Minecraft exactly where to place the mob.
  • You set up a command block by powering it with redstone, a lever, a button, or a redstone repeater connected to it.
  • Repeat command blocks run the same command over and over while powered, which is useful for continuous spawning or effects.

Getting a command block into your world

In Creative mode, open your inventory and search for "command block" in the search bar. It appears in the Redstone tab if you scroll through manually. Grab one and place it anywhere in your world like a normal block.

If you're on a server or in a world where Creative inventory is locked, use the command /give @s command_block to add one to your inventory. This works only if the server owner has enabled command blocks in the world settings. If the command doesn't work, command blocks are turned off and you'll need to ask the server owner to enable them.

Writing your first spawn command

Right-click the command block to open its interface. You'll see a text field where you type commands. The basic structure for spawning anything is:

/summon [mob name] [x] [y] [z]

Replace [mob name] with the actual mob — creeper, zombie, cow, enderman, etc. Replace [x] [y] [z] with coordinates. If you're standing where you want the mob to appear, you can use ~ ~ ~ instead of coordinates, and it will spawn right there. For example: /summon creeper ~ ~ ~ spawns a creeper at your feet.

You can also add properties to the command. /summon zombie ~ ~ ~ {Invulnerable:1b} spawns a zombie that can't take damage. The {Invulnerable:1b} part is called a tag, and different mobs accept different tags. Common ones include Health (how much damage the mob can take), CustomName (what appears above the mob), and Equipment (what armor or weapons it holds).

Powering the command block to make it run

Typing a command into the block doesn't execute it automatically. You have to power the block with redstone. The easiest way is to place a lever next to the command block, then flip the lever. The command runs once.

You can also use a button (runs once per press), a redstone repeater (runs repeatedly if powered), or wire redstone dust to it from a power source. If you want the command to run continuously, place a redstone repeater pointing into the command block and power that repeater with redstone dust or another power source.

Choosing between command block types

When you place a command block, it defaults to "Impulse" mode. Right-click it again and look at the top of the interface — you'll see three options: Impulse, Chain, and Repeat.

Impulse runs the command once each time the block receives power. Use this for one-time spawns or effects. Repeat runs the command every game tick (20 times per second) while the block is powered — useful if you want mobs to keep spawning continuously. Chain runs only if the command block before it in a chain succeeds, which lets you link multiple commands together.

For most spawning tasks, Impulse is what you want. Switch to Repeat only if you need something to spawn over and over.

Common spawn commands and examples

Here are commands you can copy and paste into a command block:

  • /summon zombie ~ ~ ~ — spawns a regular zombie at your location
  • /summon creeper ~ ~1 ~ — spawns a creeper one block above you
  • /summon cow ~ ~ ~ {CustomName:"Bessie"} — spawns a cow with the name "Bessie" floating above it
  • /summon skeleton ~ ~ ~ {Equipment:[{id:"minecraft:bow",Count:1b}]} — spawns a skeleton holding a bow
  • /summon armor_stand ~ ~ ~ {ShowArms:1b} — spawns an armor stand with visible arms

The coordinates after the mob name control where it appears. ~ means your current position, ~5 means five blocks in that direction, and ~-3 means three blocks in the opposite direction. So /summon zombie ~10 ~ ~ spawns a zombie ten blocks to your right (east).

Troubleshooting commands that don't work

If you type a command and nothing happens, check these things first. Make sure the mob name is spelled correctly — "creeper" works, but "Creeper" with a capital C does not. Minecraft commands are case-sensitive for mob names.

Check that the command block is actually powered. If you placed a lever next to it, make sure the lever is in the "on" position. If you're using redstone dust, trace the line back to make sure it connects all the way to a power source.

Look at the command block itself. If it's red, the command has an error. If it's green, the command ran successfully. Click the block again and look at the bottom of the interface — it usually shows an error message explaining what went wrong, like "Unknown command" or "Unexpected token".

Frequently Asked Questions

Can I use command blocks in Survival mode?

No. Command blocks only work in Creative mode or on multiplayer servers where the owner has enabled them in the world settings. Survival mode doesn't allow command blocks to function, even if you somehow place one.

How do I spawn multiple mobs at once?

Use a Repeat command block so the same command runs over and over, or create multiple command blocks side by side, each with a different spawn command. You can also use a Chain command block to run a second spawn command right after the first one succeeds.

What's the difference between /summon and /spawn?

/summon is the command that spawns mobs and entities. /spawn is a different command that teleports you to the world spawn point. For spawning mobs, always use /summon.

Can I spawn items instead of mobs?

Yes. Use /summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1b}} to spawn an item. Replace "diamond" with any item name, and change Count to how many you want in the stack.

How do I make a command block run when a player walks near it?

Place a pressure plate on top of the command block, or use a tripwire hook with string. When a player steps on the pressure plate or walks through the tripwire, it powers the command block and runs the command.