How to Use a Command Block

 


What are Command Blocks?

They are special blocks that can execute commands. For example:

/give @a sand 50

The above command will give all players 50 sand blocks.

Command Blocks cannot be crafted, nor are found in the Creative Mode inventory. They can be obtained with cheats. They are mostly used in Creative Mode or Adventure maps. Cheats must be turned on to use Command Blocks.

Open the Chat section, and write, "/give @s command_block". This will give you 1 command block, but if you are in Creative Mode, you can use it infinitely. Place the Command Block. Right-click on it. You will see three buttons, all of which have options, and a text box in it to write commands. I will tell what these options mean later. Write in the text box, "/give @p obsidian 10". Now close the Command Block Interface and place a lever beside it. When you trigger the lever, you will get 10 obsidian! 

Here are some commands that you can use in command blocks:

To change the gamemode:

/gamemode <GameMode> <Target>

To teleport someone or yourself:

/tp <Target> <DestinationCoordinates OR PlayerName>

To set a block to a certain coordinate:

/setblock <Coordinates> <BlockName>

To fill an area with a certain block:

/fill <FirstCoordinates(Lowest-South-West)> <SecondCoordinates(Highest-North-East)> <BlockName>

To summon an entity:

/summon <EntityName>

Etcetera.

The Interface


Now I will tell what the options in the buttons mean:

The First Button:

Impulse means that if it is powered, it will only execute once, even if continues to be powered.

Repeat means that if it is powered, it will execute the command every tick.

Chain means that it will only execute when the previous command block pointing at it has executed its command. It is used in Chains of Command Blocks.

The Second Button:

Unconditional means that the command block in the chain will execute its command, even if the previous command block gave errors.

Conditional means that the command block in the chain will only execute its command, if the previous command block did not give errors.

The Third Button:

Needs Redstone means that it will only execute the command if it is powered.

Always Active means that it does not need to be powered to execute its command.

If it was helpful or had any errors, please comment! Thank you!

Comments

Popular Posts