This article describes how to create command blocks in Minecraft, that is, blocks capable of carrying out specific commands, on computers and the Pocket Edition. To create a usable block, the world must be in creative mode and cheats must be enabled. These blocks cannot be created in the console version of the game.
Steps
Method 1 of 2: On Minecraft for Computer
Step 1. Open Minecraft
Double-click the game icon to start it, then click Plays in the launcher window if asked.
Step 2. Click Single Player
It's the first entry on the Minecraft home screen.
You can also select "Multiplayer", but you will need to set up a multiplayer game on your own server before continuing
Step 3. Click Create New World
You will find this entry in the lower right part of the window.
If you already have a creative world with cheats enabled, click on it, then click Play selected world and jump to the "Press /" step.
Step 4. Name the world
You can do this in the "World name" field.
Step 5. Double click on Game Mode: Survival
The option will change to first Game mode: Hardcore, then in Game mode: Creative. This step is critical, as command blocks can only be used in creative mode.
While it is possible to create command blocks in survival mode, you cannot place or use them
Step 6. Click More world options…
It is located in the lower part of the window.
Step 7. Click Allow Cheats: NO
The option will change to Allow cheats: Yes, enabling the cheats for the match.
If the option is already Allow cheats: Yes, the cheats are already enabled in the world.
Step 8. Click Create New World
You will find the button in the lower left corner of the screen.
Step 9. Press /
You should find the "slash" key on your computer keyboard; press it and the command console will appear at the bottom of the Minecraft screen.
Step 10. Type give player command_block into the console
Make sure you substitute your character's name for "player".
For example, if your in-game name is "Patatone", you should type give Patatone command_block
Step 11. Press Enter
This way the command will be executed and a command block will be added to your character's hand.
Step 12. Place the command block on the ground
Right-click on the ground with the block equipped.
Step 13. Right click on the command block
The command block window will open.
Step 14. Enter a command
Type the command you want the block to execute in the text field at the top of the window.
Step 15. Change the conditions of the command block
Click on any of the following options to change the conditions of the block:
- Impulse: the block will execute the command once following a right click. Click Impulse to switch to Chain, which configures the block to execute its order after the block behind it is activated. Click Chain to switch to Repeat, so that the block executes the command 20 times per second.
- No conditions: the block has no operation conditions. Click No conditions to switch to Condition, which prevents the block from executing the command until the block behind it has activated.
- Pietrarossa necessary: the block is powered by redstone and cannot execute the command without this material. Click on the option to switch to Always active, if you prefer not to use redstone for activation.
Step 16. Click Done
The control block is configured.
If you have set the command block to require redstone, you need to apply redstone dust to it to make it work
Method 2 of 2: On Minecraft Pocket Edition
Step 1. Open Minecraft Pocket Edition
Press the Minecraft app icon, which looks like a block of dirt with a tuft of grass.
Step 2. Press Play in the center of the screen
Step 3. Press Create New
This item is located at the top of the screen.
If you already have a Minecraft world in creative mode with cheats enabled, press it, then skip to the "Enter command for block" step
Step 4. Press Generate Random
This is one of the first items on the screen.
Step 5. Name the world
Click on the "World name" field, then type in whatever you prefer.
Step 6. Select "Creative" as the game mode
Press the drop-down menu Survival, then the voice Creative.
Step 7. Press Continue when prompted
This way you will enable creative mode and cheats in your world.
Step 8. Press Play
This button is on the left side of the screen. Press it and the match will be created.
Step 9. Press the "Chat" icon
This is the balloon icon at the top of the screen, directly to the left of that Pause.
Step 10. Enter the command for the block
Type / give player command_block, making sure to substitute your character's name for "player".
Step 11. Press the right arrow
It is located on the right side of the console. This will execute the command and place a command block in the character's inventory.
Step 12. Equip the lock command
Awards ⋯ At the bottom right of the screen, press the chest-shaped tab on the left side of the screen, then press the command lock icon.
Step 13. Place the command block on the ground
Press on the ground to do this.
Step 14. Press the command block
Its interface will open.
Step 15. Change the conditions of the command block
If you want to change the following options on the left side of the screen:
- Block type: leaves Impulse if you want the block to execute the command when you press it, press Impulse and go to Chain to have the block only activate when another one behind it has been activated, or press' Impulse and go to Repeat to activate the lock 20 times per second.
- Condition: leaves No conditions' if you want the block to activate regardless of the neighboring ones, or press No conditions and go to Conditional to allow the block to fire only when another block is executed behind it.
- Red Rock: leave the option Pietrarossa necessary to activate the block only when it is in contact with the redstone, or press the item and select Always active if you prefer the command to run regardless of that requirement.
Step 16. Enter a command
Awards + at the top right of the window, type the command you want, then press - in the upper right corner of the screen.
Step 17. Close the block page
Awards x in the upper right corner of the screen. The command block is now configured correctly.