TCLauncher

TCLauncher › All guides

Command blocks in Minecraft: how to get and set them up

How to get a command block, how impulse, chain and repeat blocks differ, how to enable them on a server and how to build your first simple contraption.

Updated:

Command blocks in Minecraft: how to get and set them up — TCLauncher

A command block runs a command when it gets a redstone signal or constantly. You can use it for teleports, mini-games, scoreboards and automatic events in the world.

How to get one

  1. Turn on cheats and switch to creative mode. See Minecraft commands.
  2. Type /give @s minecraft:command_block.
  3. Place the block and right-click it — a field for the command opens.

On a server command blocks are off by default: set enable-command-block=true in server.properties and restart the server. Only operators in creative mode can place and edit them.

Three types

  • Impulse (orange) — runs the command once per signal.
  • Chain (green) — runs right after the block whose arrow points at it. This is how you build command sequences.
  • Repeat (purple) — runs the command every game tick (20 times a second) while active.

Settings

  • Needs Redstone / Always Active — wait for a signal or work constantly.
  • Conditional — runs only if the previous block in the chain succeeded.
  • The slash at the start of the command is optional.

First contraption: a teleport button

  1. Place an impulse block with the command tp @p 0 100 0.
  2. Attach a button to it.
  3. Press it — the nearest player ends up at 0 100 0. See coordinates.

Tips

  • A repeat block with a heavy command (for example, @e without limits) can slow the world down. Narrow your selectors: @e[type=item,distance=..10].
  • To stop command output in chat: /gamerule commandBlockOutput false. See game rules.
  • Experiment in a separate creative world and make backups.

Download TCLauncher — a separate creative instance for experimenting with commands.

FAQ

How do I get a command block?

In creative mode with cheats on, type /give @s minecraft:command_block.

Why doesn't a command block work on my server?

They must be enabled: enable-command-block=true in server.properties, and only operators can edit them.

How do the command block types differ?

Impulse runs once per signal, chain runs after the previous block, repeat runs every tick.

Download TCLauncher