The command block is a special block that is only available in creative mode. It can't be acquired in the game without a special command. Bring up the main menu with the pause button or ESC. Under the Game tab, change Default Game Mode to Creative.
Type in the following command in the Chat menu: "/give @s command_block".
This will put a command block in your inventory. Now you can place command blocks.
Command blocks are indestructible but be cautious as the attached buttons, levers or redstone can be destroyed. Also, if you don't want the text to display commands as they run, run the following command: "/gamerule sendcommandfeedback false".
Command block settings
Once you place the command block, you can bring up its properties by right-clicking.
Here's a list of the properties that can be modified:
Hover note: Displays a name for the command block when you point at it. This is optional but can come in handy if you have multiple command blocks.
Block type: This controls when a command block activates. Options are Impulse, Chain or Repeat:
Impulse: The command block only activates once
Chain: The command block only activates when connected to another command block.
Repeat: The command block is activated over and over.
Condition: Conditional or Unconditional.
Conditional: It only activates if the chained command block before it has a successful command.
Unconditional: It always activates.
Redstone: This controls if a command block needs a power source. It can be set to Redstone or Always active.
Needs redstone: The command block requires a button, lever (You will need to crouch to place a button or lever on a command block) or redstone power source to activate. Redstone is another powerful technique to build in Minecraft but is outside of the scope of this website.
Always active: The command block is always active.
Execute on first tick: If on, a repeating command block will execute right away without a delay.
Delay in ticks: Sets the time between activations on a repeating command block. One tick equals 1/20th of a second.
Command input: This is the command that will be activated.
Previous output: This will display whether the command was completed successfully.
Command examples
Here are a few basic examples of commands. We will go over more examples later in the tutorial. You can search for commands by typing / in the chat menu and type in a partial phrase. The console will bring up a list of commands and their usage. Note that many of the commands for Minecraft Java Edition will not work in Minecraft Bedrock Edition.