What a command block does and where to find one

A command block is a Minecraft block that runs commands when activated. Unlike typing commands into chat, a command block executes the same instruction repeatedly or on a schedule, making it useful for spawning mobs, dropping items, or triggering events without typing the same thing over and over. Command blocks only work in Creative mode or in Survival mode on servers where the owner has enabled them.

To get a command block, you need to be in Creative mode. Open your inventory, search for "command block" in the creative menu, and place it in your world. In Survival mode on a multiplayer server, the server owner must enable command blocks in the server settings file (server.properties) and set the op permission level high enough for you to use them.

Once placed, right-click the command block to open its interface. You will see a text field where you type the command, a dropdown menu to choose the block type (Impulse, Chain, or Repeating), and a redstone setting (Needs Redstone or Always Active). The block type and redstone setting determine when and how often the command runs.

Key Takeaways

  • Command blocks are only available in Creative mode or on servers where the owner has enabled them in server.properties.
  • The spawn command syntax is /summon [entity] [x] [y] [z], where the coordinates are optional and default to your current location.
  • Impulse blocks run once when powered by redstone; Repeating blocks run every game tick as long as redstone power is on; Chain blocks run when the block before them in the chain finishes.
  • You can spawn multiple mobs at once by chaining command blocks together or by using a single command with multiple summon lines separated by semicolons in some server versions.

The basic spawn command and how to write it

The command to spawn something is /summon followed by the entity name. The simplest version is /summon creeper, which spawns a creeper at your current location. If you want to spawn it at specific coordinates, add them after the entity name: /summon creeper 100 64 200 spawns a creeper at coordinates X=100, Y=64, Z=200.

Entity names are case-sensitive and must match Minecraft's internal names exactly. Common mobs include creeper, zombie, skeleton, enderman, cow, pig, sheep, and chicken. Hostile mobs spawn in darkness; passive mobs spawn in light. You can also spawn items, armor stands, and even the Ender Dragon using the same /summon command with the correct entity name.

If you do not know the exact entity name, the command will fail silently or show an error in the command block's output. Check the Minecraft wiki or hover over a mob in Creative mode to see its exact name. Names like zombie_villager, cave_spider, and wither_skeleton are hyphenated and must be typed exactly.

Choosing the right command block type for your purpose

Command blocks come in three types, visible in the dropdown menu when you open the block. An Impulse block runs the command once when it receives a redstone signal. This is useful if you want to spawn a mob only when a player steps on a pressure plate or triggers a lever. A Repeating block runs the command every game tick (20 times per second) as long as redstone power is supplied. This is useful for continuous spawning, though it can lag your world if overused.

A Chain block runs when the command block directly before it in a line finishes executing. Chain blocks do not need redstone power if the block feeding them is powered. This lets you run multiple commands in sequence: the first block spawns a mob, the second gives it armor, the third teleports it somewhere. Chain blocks are the most efficient way to spawn complex setups.

Most spawning setups use an Impulse block set to "Needs Redstone" so the spawn happens only once per button press or trigger. If you want mobs to spawn continuously, use a Repeating block, but be aware that spawning hundreds of mobs per second will crash your server or freeze your single-player world.

Adding coordinates and controlling where mobs appear

By default, /summon creeper spawns the mob at your feet. To spawn it elsewhere, add X Y Z coordinates: /summon creeper 100 64 200. The Y coordinate is height (64 is sea level in most Minecraft worlds; higher numbers go up, lower numbers go down). The X and Z coordinates are horizontal position.

You can use relative coordinates by starting with a tilde (~). /summon creeper ~ ~1 ~ spawns a creeper one block above your current location. /summon creeper ~5 ~ ~-3 spawns it five blocks to the east and three blocks to the south. This is useful in command blocks because the block's location stays the same, but relative coordinates adjust based on where the block is placed.

If you want mobs to spawn in a random area, you can chain multiple command blocks with different coordinates, or use a single command block with a randomizer (more advanced). For most purposes, specifying exact coordinates or using relative coordinates from the command block's location is simpler and more reliable.

Spawning mobs with custom properties and equipment

The basic /summon command spawns a mob with default settings. To customize it, add curly braces and properties at the end. For example, /summon zombie ~ ~ ~ {Health:10} spawns a zombie with only 10 health instead of the normal 20. /summon creeper ~ ~ ~ {Fuse:0} spawns a creeper that explodes immediately.

To give a mob equipment, use the HandItems property: /summon zombie ~ ~ ~ {HandItems:[{id:"minecraft:diamond_sword",Count:1}]} spawns a zombie holding a diamond sword. The syntax is strict: you must use the full item ID (minecraft:diamond_sword, not just diamond_sword), and Count must be at least 1. Armor works the same way using ArmorItems instead of HandItems.

You can also set custom names, make mobs invulnerable, change their size, or lock them in place. These commands get long quickly, so many players use online command generators to build the syntax correctly. Copy the full command into your command block, and the mob will spawn with all the properties you specified.

Powering the command block with redstone

A command block set to "Needs Redstone" only runs when it receives a redstone signal. You can power it with a lever, a button, a pressure plate, a redstone wire, or any other redstone component. Place the redstone power source next to the command block or connect it with redstone dust (the red powder you place on the ground).

If you want the command block to run automatically without a player triggering it, set it to "Always Active" instead. The command will run every tick (20 times per second) if it is a Repeating block, or once if it is an Impulse block. Always Active Impulse blocks are rare because they run only once when the world loads, then never again unless you reload the chunk.

For most spawning setups, use an Impulse block set to "Needs Redstone" and connect a button or lever. This gives you full control over when the spawn happens and prevents accidental mob spam. If you want continuous spawning, use a Repeating block set to "Always Active," but monitor your server performance because spawning too many mobs will cause lag.

Chaining multiple command blocks for complex spawns

A single command block can spawn one mob with one set of properties. To spawn multiple mobs or to give a mob equipment and then teleport it, chain command blocks together. Place an Impulse block, then place Chain blocks in a line behind it. Set the Impulse block to "Needs Redstone" and the Chain blocks to "Always Active."

When you power the Impulse block, it runs its command, then the first Chain block runs, then the second, and so on. For example: the first block spawns a zombie, the second gives it a sword, the third teleports it to a specific location. Each command runs in order, and the chain stops if any command fails.

Chain blocks are more efficient than Repeating blocks for complex setups because they run only once per trigger instead of every tick. They also let you see the order of operations clearly by looking at the block placement. If a command fails, the chain stops, so test each command individually before chaining them together.

Frequently Asked Questions

Why does my spawn command not work?

The most common reasons are a typo in the entity name, missing redstone power, or the command block not being set to the right type. Check that the entity name matches exactly (zombie_villager, not zombie villager), that the command block is powered if it needs redstone, and that you are in Creative mode or on a server with command blocks enabled. The command block will show an error message if the syntax is wrong.

Can I spawn the Ender Dragon with a command block?

Yes, use /summon ender_dragon. However, the Ender Dragon is a boss mob and will attack immediately. It also cannot be spawned in the Nether or the End without special setup. Spawning it in the Overworld is usually only done in Creative mode for testing or building purposes.

How do I spawn a mob that does not attack players?

Add the NoAI property to the spawn command: /summon zombie ~ ~ ~ {NoAI:1}. This makes the mob stand still and ignore players. You can also use the PersistenceRequired property to keep the mob from disappearing when you leave the area: /summon zombie ~ ~ ~ {PersistenceRequired:1}.

Can I spawn items instead of mobs?

Yes, use /summon item ~ ~ ~ {Item:{id:"minecraft:diamond",Count:1}}. Replace diamond with any item ID. The item will drop on the ground as if you threw it. You can spawn multiple items by chaining command blocks or by adjusting the Count value, though Count is limited to 64 for most items.

What is the difference between Impulse and Repeating blocks?

An Impulse block runs once per redstone signal, so it spawns one mob each time you press a button. A Repeating block runs every tick while powered, so it spawns 20 mobs per second. Use Impulse for single spawns and Repeating for continuous spawning, but watch for lag if you spawn too many mobs at once.