Command blocks are Minecraft blocks that execute console commands when activated by redstone. This is useful for worlds and servers that do not have access to plugins or datapacks.
Placing the block requires you to be in the Creative gamemode, and if you're on a server, you must also be opped (see our guide on how to op yourself here). You can give yourself a Command Block by running this command give <username> minecraft:command_block in your server console, or in-game.
Once you have the block, you just place it and right-click it. Right-clicking it also requires you to be opped and in Creative gamemode.
How to enable command blocks on your server
- Go to your host's game panel.
- Click
Config Files. - Click on
Server Settings, which should be at the top of the page. - Find the
Enable Command Blockssetting and set it toEnabled. - Click save at the bottom.
- Restart the server.
How to disable command blocks on your server
- Go to your host's game panel.
- Click
Config Files. - Click on
Server Settings, which should be at the top of the page. - Find the
Enable Command Blockssetting and set it toDisabled. - Click save at the bottom.
- Restart the server.
How to toggle command blocks through files
This is useful if your host doesn't have a game panel, or if you're self-hosting the server.
- Go to your folder with all of the server files
- Find the
server.propertiesfile and open it. - Find
enable-command-blockand set the value to true if you want command blacks enabled, and false if you don't. - Save the file.
- Restart the server.
