Command Blocks are special blocks in Minecraft that you can use to execute commands. These can be customized to do a variety of things to automate things on your Minecraft server.
Players can do fairly complex things with Command Blocks, and they can be placed in a connecting chain to activate a series of commands to automate processes.
How to get a Command Block
Note that only server admins can make Command Blocks.
For Minecraft Bedrock Edition, you’ll need to do the following:
- Enable cheats in your world or Realm settings.
- Turn on Creative Mode in your world or Realm settings.
- Open the chat box and enter “/give [your username] command_block”
- Place the block where you want it.
You can turn off cheats and Creative Mode after you’re doing placing the blocks in your desired location.
For Minecraft Java Edition, you’ll need to do the following:
- Go to the “server.properties” file in your server’s config files.
- Change the line that says “enable-command-block=false” to “enable-command-block=true”
- Give yourself a Command Block by opening the chat box and entering “/give [your username] minecraft:command_block”
- Turn on Creative Mode by typing “/gamemode c” in your chat box.
- Place the Command Block where you want it.
You can turn the game back to Survival Mode by typing “/gamemode s” in the chat box after you place the block.
How to set up a Command Block
Once your Command Block is placed, there’s a couple settings you’ll see when you interact with it.
Choosing between “Impulse”, “Current” or “Repeat”, and “Chain” will decide when your Command Block activates.
Impulse will make the command run once and stop.
Current or Repeat (depending on your version) will make the command repeat consistently while powered.
Chain will make it so the block will only run after the connecting Command Block runs, allowing players to set up more complex systems.
A Command Block set at “Unconditional” will run no matter if the previous Command Block ran successfully. “Conditional” makes it so it’ll only run if the previous Command Block ran.
You can also set your Command Block up to be powered by Redstone. Selecting “Needs Redstone” will make it only activate if the block has Redstone. Selecting “Always Active” makes the command run regardless.
Whatever command you want set up goes into the “Command Input” section. You can use it to kill enemies if you don’t like a particular one or other things. Minecraft commands can be a little complicated at times, especially when using it in Command Blocks, but you can check out a list of commonly used commands here so you don’t have to do the heavy lifting yourself.