Command Blocks are these cool-looking blocks added in Minecraft 1.4. You can get a command block into your Minecraft game by typing this command in chat:
/give [Player name] minecraft:command_block
or
/give @p minecraft:command_block
According to 1.9+, there are 3 types of command blocks: Impulse, Chain, and Repeat. Impulse is kinda a tannish color, and is the most basic one: when it gets powered by redstone, it executes a command only once until it gets powered again. Here are some examples of Impulse command blocks.
/give [Player name] minecraft:command_block
or
/give @p minecraft:command_block
According to 1.9+, there are 3 types of command blocks: Impulse, Chain, and Repeat. Impulse is kinda a tannish color, and is the most basic one: when it gets powered by redstone, it executes a command only once until it gets powered again. Here are some examples of Impulse command blocks.
Chain command blocks, well, basically, are these light blue-green command blocks, and, if it is powered by redstone, it will not execute the command, but when a command block that is pointing to it gets powered, the Chain command block gets powered too, and if it is pointing to another chain command block, that one will get powered and so on. Note that chain command blocks need to be powered in order to execute a command. Here are examples of chain command block.
A repeating command block is a blue-purple color, and, well, you probably guessed it, when it is powered by a redstone, it executes the command and repeats about 20 times per second, and keeps executing the command until the command block is not powered anymore. Here are some examples of a repeating command block:
However, in 1.8 and below, the only command block you can get is Impulse. If you want to get a command block chain, you need to do something like this:
To get a repeating command block in 1.8, it is a bit more complicated. Instead of 1 command, you have to do 3 commands. Follow the list for instructions:
1. In chat, you need to type the following command:
/gamerule doTileDrops false
1. In chat, you need to type the following command:
/gamerule doTileDrops false
However, this is optional. If you don't though, you will get major lag.
2. Set down a command block. Open it and type in this command:
/setblock ~ ~1 ~ minecraft:redstone_block 0 destroy
2. Set down a command block. Open it and type in this command:
/setblock ~ ~1 ~ minecraft:redstone_block 0 destroy
3. Set a redstone block on top of it and watch the magic happen...
4. Set a command block on top of it and type the command you want.
5. You have now got yourself a repeating command block.