Command blocks are special Minecraft blocks that can run server commands when activated. They are often used in adventure maps, minigames, custom worlds, and servers that want command-based features without using plugins or datapacks.
On a Minecraft server, command blocks are disabled by default on many hosts. Before you can use them, you need to enable command blocks in your server settings or by editing the server.properties file.
To place and edit a command block, you must be in Creative mode. On a server, you also need operator permissions.
You can give yourself a command block by running this command in the server console or in-game:
/give <username> minecraft:command_block
Replace <username> with your Minecraft username. If you're running it in console, then do not include the /.
Once you have the command block, place it down and right-click it to open the command block menu. If you cannot open or edit it, make sure you are opped, in Creative mode, and that command blocks are enabled on the server.
How to Enable Command Blocks on a Minecraft Server
Many Minecraft server hosts let you enable command blocks directly from the game panel.
- Open your server hosting panel.
- Find the server settings or configuration section.
- Look for a setting called
Enable Command BlocksorCommand Blocks. - Set the option to
Enabled. - Save your changes.
- Restart the Minecraft server.
After the restart, command blocks should work on your server.
How to Disable Command Blocks on a Minecraft Server
You can also disable command blocks from your server panel.
- Open your server hosting panel.
- Go to the server settings or configuration section.
- Find the
Enable Command BlocksorCommand Blocksoption. - Set the option to
Disabled. - Save your changes.
- Restart the server.
Once disabled, command blocks will no longer run commands on the server.
How to Enable or Disable Command Blocks Using server.properties
If your host does not have a game panel, or if you are self-hosting your Minecraft server, you can enable or disable command blocks by editing the server.properties file.
- Stop your Minecraft server.
- Open your server folder.
- Find the
server.propertiesfile. - Open the file in a text editor.
- Find this line:
enable-command-block=false
To enable command blocks, change it to:
enable-command-block=true
To disable command blocks, change it back to:
enable-command-block=false
- Save the file.
- Start the server again.
The change will only apply after the server has been restarted.
Why Are Command Blocks Disabled by Default?
Command blocks can run powerful commands, so they should only be used by trusted players and server owners. If someone has access to command blocks, they may be able to change the world, give items, teleport players, or run other server commands.
For public Minecraft servers, it is usually best to keep command blocks disabled unless you specifically need them for maps, minigames, or custom server features.
Command Blocks Still Not Working?
If command blocks are not working after you enabled them, check the following:
- Make sure
enable-command-block=trueis set inserver.properties. - Restart the server after changing the setting.
- Make sure you are in Creative mode.
- Make sure you are opped on the server.
- Make sure you are using the correct command block syntax.
- Check that your server software or plugins are not blocking command block usage.
Once these settings are correct, command blocks should be enabled and ready to use on your Minecraft server.
