How to enable command blocks on a Minecraft server
Fix 'Command blocks are not enabled on this server' by turning on enable-command-block, then get and use a command block.
Updated · 2 min read
Command blocks are off by default on servers. Set enable-command-block=true in server.properties, restart the server, and make sure you are an op in creative mode to place and edit them.
Enable command blocks
- Open the file manager and edit
server.properties. - Change:
enable-command-block=true
- Save and restart the server.
If this key is missing from your file, you may be on a very recent Minecraft version where Mojang has moved some settings into game rules. Type /gamerule in-game and press Tab to look for a command block rule. Paper and other platforms may also have their own options; check the console on startup.
Get a command block
Command blocks are not in the creative inventory search by default. As an op, run in-game:
/give @s minecraft:command_block
To place and edit a command block you need:
- op level 2 or higher (see ops and op levels),
- creative mode (see difficulty and game mode).
Right-click the block to open it and type a command without the leading slash.
Command block types
| Type | Behavior |
|---|---|
| Impulse (orange) | Runs once each time it is powered |
| Chain (green) | Runs after the block pointing into it |
| Repeat (purple) | Runs every game tick while powered |
Set Always Active to run without redstone, or Needs Redstone to run only when powered.
Hide the chat spam
Command blocks report their output to ops in chat. Turn it off with:
/gamerule commandBlockOutput false
See gamerules for rule naming on newer versions.
Performance and safety
- Repeating command blocks run 20 times a second. Heavy commands such as large
fill, entity selectors without limits, orexecute as @ecan cause serious lag. Add selectors likelimit=1anddistance=..10where you can. - Anyone who can edit a command block effectively has op powers, because a command block can run nearly any command. Only give op and creative to trusted players.
- On Paper, many simple command block setups can be replaced with plugins or data pack functions, which are easier to manage.
Still says "Command blocks are not enabled"?
- You edited
server.propertiesbut did not restart. - There are two
enable-command-blocklines and the later one isfalse. - You edited a file in the wrong folder. The correct one is in the server root, next to
eula.txt.