Minecraft – How do command blocks work

minecraft-commandsminecraft-java-edition

I'm trying to get started using command blocks. I can't seem to figure out how to do basic things, such as changing game modes, sending messages, and giving items to people using the block ID. Nothing I have tried is working.

How do I use command blocks?

Best Answer

You can use them as you would use a regular command in chat.

Example:

  • /give [user] 1 2

This gives [user] two of item id 1 when the command block is activated with redstone.

  • /gamemode [user] [0, 1, 2]

This will change [user]'s gamemode to either 0 (Survival) 1 (Creative) or 2 (Adventure)

Note and Edit: Buttons S (Survival) C (Creative) and A (Adventure) work as well as SevenSidedDie has noted for /gamemode