top of page

How to get a command block in Minecraft and automate your world

Oct 9, 2021
2 min read



  • You can get a command block in your Minecraft world using a special chat command.

  • You'll need to have both Cheats and Creative Mode enabled in your Minecraft world to get a command block.

  • Once you summon your command block, you can use codes to customize how it works.

  • Visit Insider's Tech Reference library for more stories.

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.


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.




Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating
bottom of page