How to create a command block in minecraft

Minecraft is a surprisingly complex game. On the surface, it just looks like a big Lego simulator — but dig deep enough, and you can build sprawling rail systems, paint pictures, and even program in-game computers.

Command blocks are one of those complex features. Powered by redstone, command blocks let you automate the world, control players, set server rules, and more.

But unlike other items, you can't find command blocks out in the world, or in the full list of items. Instead, you'll need to spawn it into the game using cheats.

Here's how to get a command block in Minecraft, using either Java or Bedrock edition.

How to get a command block in Minecraft

The method to get a command block is pretty much the same in both Java and Bedrock.

1. Firstly, make sure that your world or Realms server has cheats turned on, and that you're playing in Creative Mode.

Turn on both Creative Mode and cheats. Mojang; William Antonelli/Insider

2. Open the chat box by pressing T on your keyboard, or the right d-pad button on a controller.

3. In the chat box, type:

/give [your username] minecraft:command_block

In place of "[your username]," insert your Minecraft username.

If you want to give the command block to another player on your server, you can insert their name instead. Mojang; William Antonelli/Insider

4. The command block will appear in your inventory. While it's in your hand, you can place it down on any solid surface.

You'll be given an infinite amount of command blocks. Mojang; William Antonelli/Insider

Using the command block

Once you've placed your command block, you can set the block up with codes so it performs automatic tasks. These tasks include killing enemies as soon as they spawn, giving players items, and more.

1. Select the command block that you placed.

2. In the menu that opens, you'll have a few options. Use the first option to choose how often the command block should run: Impulse will run the command once and then stop, Repeat/Current will run the command indefinitely, and Chain will require any connected command block to run before it does.

Quick tip: You can connect multiple command blocks together using redstone circuits.

3. The second option, Conditional or Unconditional, determines whether a connected command block needs to run successfully for this block to run.

4. The third option lets you choose whether the command block can run on its own — Always Active — or Needs Redstone to power it.

5. Finally, type your command into the text field. For example, if you want to kill every creeper in the area, you'll type:

/kill @e[type=minecraft:creeper]

You can find a list of common codes here.

Set up your command block with an action and conditions. Mojang; William Antonelli/Insider

6. When you're ready for the command block to start running, click Done.

Have you ever tried using cheats or commands in Minecraft? They are powerful, unique, and literally game-changing. But at the same time, there are also limited in so many ways. For starters, you can’t use multiple commands at once. You have to retype each command whenever you want to repeat it. Moreover, the chatbox where you input the commands doesn’t even have a separate UI. We can easily make an article on ways to improve commands in Minecraft, but there is already a solution. If you know how to get a command block in Minecraft, your life can be much easier. It is a unique block that allows you to specify commands that can be triggered at your convenience. Moreover, it is the secret behind the success of some of the best Minecraft adventure maps. With that said, let’s figure out how to get a command block in Minecraft.

Command Blocks in Minecraft: Explained (2022)

We have divided the guide into separate sections for your ease, covering everything from what is a command block to the different types of command blocks and how to use them. Use the table below to explore each section at your convenience.

What is a Command Block in Minecraft

As the name suggests, the command block is an in-game block that you can use to execute commands in Minecraft. But it can’t be obtained in survival or adventure mode if you are not using cheats. It is compatible with the in-game Redstone system. So, you can use the command block with levers, mechanisms, and other items.

How to create a command block in minecraft

In survival mode, the command block can’t be mined, blasted, or broken in any way. But you can still deactivate or modify it. As for the creative mode, you can easily break, spawn, duplicate and deactivate a command block.

Types of Command Blocks in Minecraft

Depending upon the state of blocks, there are three types of command blocks in Minecraft:

  • Orange impulse command block
  • Green chain command block
  • Purple repeat command block

How to create a command block in minecraft
Left: Green Chain Block; Middle: Orange Impulse Block; and Right: Purple Repeat Block

Impulse Command Block

This default command block automatically runs and stops the entered command. So, when you power it up, the entered command is only executed once. It’s similar to using commands in the chatbox.

Chain Command Block

Chain command block is useful in combing commands. When placed in a series, it runs the entered command only if the command block attached to it has executed its command. So, these blocks run one command after another in a chain when placed in series.

Repeat Command Block

As the name suggests, this block runs infinitely and repeats the entered commands. Thanks to the fast in-game speed, you can repeat a command up to around 20 times in just a single second.

Get Command Block On Minecraft Java (Windows, macOS, & Linux)

Command blocks have world-changing impacts, so it’s best to create a new world while testing them. But you can also use them in your existing world. With that said, follow these steps to obtain a command block in Minecraft Java on Windows, macOS, and Linux.

1. To begin, click on the “Singleplayer” option on the home screen.

How to create a command block in minecraft

2. Then, choose the “Create New World” option located in the bottom right corner.

How to create a command block in minecraft

3. Here, make sure that the “Allow Cheats” option is set to On. Then, click on the “Create New World” button. You can also change your game mode to creative for your ease.

How to create a command block in minecraft

4. If you want to turn on cheats in an existing world, use the LAN World options in the pause menu.

How to create a command block in minecraft

5. Once you are in a world with cheats enabled, press the “T” key and type the following command. Then, press Enter.

/give @p minecraft:command_block

Commands in Minecraft are case-sensitive, so make sure to copy and paste or type the same command. If executed properly, a command block will show up in your inventory.

How to create a command block in minecraft

Get Command Block on Minecraft Bedrock (Xbox, PS4, & Switch)

You can use the following steps to get Minecraft Command Block on Switch, PS4, Xbox One/ Series X & S, and the PC edition of Minecraft Bedrock. The controls of each console might differ, but the process is the same.

1. First, open Minecraft and click the “Play” button on the home screen.

How to create a command block in minecraft

2. Then, click the “Create New” button in the “Worlds” tab.

How to create a command block in minecraft

3. Here, within the game section, turn on the “Activate Cheats” toggle in the cheats section, and then click on the “Create” button. Also, make sure to change your game mode to “Creative”. You can edit these game settings within your existing worlds too.

How to create a command block in minecraft

4. Once you are in your world, press the “T” key or your platform’s dedicated chat button. Then within the chat, enter the following command and press enter.

/give @s minecraft:command_block

Minecraft commands are case-sensitive. Make sure to take special notice of the capitalization of the letters while typing.

How to create a command block in minecraft

Get a Command Block in MCPE (Android & iOS)

Thanks to Minecraft’s inclusivity, you can get command blocks on portable consoles like Nintendo Switch. But if you are running MCPE (Minecraft Pocket Edition) on Android, iOS, or iPadOS, the steps might look slightly different. Let’s see how different they are.

1. First, open your Minecraft app and tap on the “play” button.

How to create a command block in minecraft

2. Then tap on the “Create New” button within the worlds menu. You can also use an existing world.

How to create a command block in minecraft

3. In the world’s game settings, make sure to toggle on the “Activate Cheats” button. You can even enable this option in existing worlds via the pause menu. Also, while you are at it, make sure that the world’s game mode is set to “creative”.

How to create a command block in minecraft

4. Finally, in your cheats enabled Minecraft world, tap on the chat icon located at the top of your screen.

How to create a command block in minecraft

5. Then, type the following command in the chatbox and hit the send button.

/give @p minecraft:command_block

This command is case-sensitive. So, copy-pasting might be an easier way to enter it.

How to create a command block in minecraft

How to Place and Use Command Block in Minecraft

Due to its powerful impacts, players can’t use command blocks in survival mode. So, we first need to make sure our world is in the creative game mode. Though, on multiplayer servers, you also need OP permissions to use command blocks.

With that said, you need to run the following command to change your game mode to creative:

/gamemode creative

Then, you can just look at another block and place the command block by right-clicking or using the secondary action key. Now that you know how to get a command block in Minecraft, let’s go over its UI to understand how to use it on Java and Bedrock editions.

Command Block UI on Minecraft Java and Bedrock

How to create a command block in minecraft
UI of Command Block in Java Minecraft

The command block offers the same options in both Java and Bedrock editions. However, its UI varies slightly across the two editions. So, let’s briefly go over the options you get access to:

  • Command Input: Here, you can enter the various in-game commands that Minecraft supports.
  • Block Type: This option allows you to set and change the command block’s type from the default – “impulse” to “repeat” or “chain”.
  • Condition: If a command block is conditional, it only runs a command if the previous command is successfully executed.
  • Redstone: If you want to use the command block in a Redstone machine, you can use this option to make it run only with Redstone power.

Exclusive Options

How to create a command block in minecraft
Command Block UI for Bedrock

The command block on the Bedrock edition has some additional options beyond the regular ones. Here’s what each of them means:

  • Execute on First Tick‌: This option ensures that the command on the repeat block gets executed as soon as the block is activated. There is no time delay.
  • Delay in Ticks‌: On a repeat or chain command block, this option specifies the time delay before a command gets executed. But on a repeat command block, it specifies a delay between each repeated command execution.
  • Hover Note‌: This comparatively simple option allows you to name each command block. Though, you can also use this for message commands to display the name of the sender in the chat.

Get and Use Command Blocks in Minecraft

With that, you can now easily get command blocks in Minecraft Java and Bedrock edition. With them, you can upgrade custom maps, make a private Minecraft server, and make your world better overall. One of the most fun ways to use command blocks is to make a perfect circle in Minecraft. But even with such power, there is no way to use them without learning Minecraft commands. Fortunately, there’s an easier alternative in the form of the best Minecraft mods. You just have to install Forge in Minecraft to run the mods and enjoy even more power than the command block. Having said that, how do you plan on using a command block in your world? Tell us in the comments below!