How can I get a command block?

Press T and then /, or just / to bring up the command, then type /give @p command_block and press the enter key ( or Enter).


You will first need to type / to start typing commands, then, after that, type:

/give @p minecraft:command_block

Just for notation, a command block's ID is 137


mc version 1.10:

/give (userid) minecraft:command_block

mc version 1.9 and under:

/give (userid) command_block

To get command blocks in Minecraft, you type /give (Your username) command_block.