NapNodes

← Minecraft guides

Minecraft · updated 5 November 2026

Command Blocks on a Minecraft Server: How to Enable Them and Why They Don't Work

You place a command block, type the command, flip the lever… and nothing happens. On a server it's almost always one of four things: the rule that turns them on, permissions, spawn protection, or a plugin taking over the command. Here's how to enable them on today's version, how to use them and how to fix each failure.

Enable them: it's no longer enable-command-block

Up to 1.21.8, command blocks were turned on with enable-command-block=true in server.properties and a restart. Since 1.21.9 that line is no longer read: it's now a game rule, command_blocks_work. If your server.properties still has enable-command-block, changing it does nothing on an up-to-date server.

With the server on, type gamerule command_blocks_work true in the panel's “Console” (no slash; from the in-game chat, with a slash). It takes effect at once, without restarting, and is saved with the world. If you type gamerule command_blocks_work with no value, the server tells you how it's set.

If your server is on a version older than 1.21.9 (an old modpack, for example), enable-command-block=true in server.properties still applies there, and you have to restart for it to be read.

Rather not set it up yourself? Minecraft servers from €6 a month, no contract and a full refund within 72 hours. Or create a free Minecraft server, no card needed.

Get them and place them

A command block isn't in the creative inventory and can't be crafted: it's given with a command. And only operators in creative mode can place and edit it; a normal player can't even open it.

  1. Make yourself an operator

    In “Console”: op YourName. The admin commands guide explains the levels; command blocks need level 2 or higher, and by default operators have 4.

  2. Switch to creative

    gamemode creative YourName, or /gamemode creative from chat.

  3. Give yourself the blocks

    /give @s minecraft:command_block (the orange one, impulse). There's also minecraft:chain_command_block (green, chain) and minecraft:repeating_command_block (purple, repeat), though any of them can change type when you open it.

  4. Place it and open it

    Right-click the block to open its window: type the command (the slash is optional), choose the type and whether it needs redstone, and press “Done”.

The three types and their options

Impulse (orange): runs the command once each time it gets a redstone signal. It's the one for buttons: give an item, teleport, show a title.

Repeat (purple): runs the command every tick (20 times a second) while it's active. It's the one for things that “always” happen: giving an effect to anyone in an area, checking whether someone steps on a spot.

Chain (green): runs right after the block whose arrow points at it. It's for doing several things in a row from one signal: make the first one impulse or repeat and put the chain ones behind it, in a line and facing the same way.

“Needs Redstone” or “Always Active”: the first only runs with a signal; the second, without one (the usual choice for chain blocks and for a repeat that must always run). “Conditional” makes a block run only if the previous one in the chain succeeded.

Examples that work on a server

In a command block, @p is the player nearest the block (almost always whoever pressed the button), @a is everyone and @a[distance=..5] those within 5 blocks. That's how to read the examples.

  1. Button that gives a kit

    Impulse, needs redstone, with a button next to it: give @p minecraft:bread 16. For items with enchantments or a name, the /give generator writes the command for your version.

  2. Button that teleports

    Impulse, needs redstone: tp @p 120 70 -340. The coordinates are the destination's (F3 tells you where you are).

  3. Healing zone

    Repeat, always active: effect give @a[distance=..5] minecraft:regeneration 2 1 true. It heals anyone near the block; the true hides the particles.

  4. On-screen welcome message

    Impulse with a pressure plate at the entrance: title @p title {"text":"Welcome","color":"gold"}. Text with colours and clicks comes ready from the tellraw generator.

If they don't work: the causes, most frequent first

  1. The rule is off

    gamerule command_blocks_work in the console. If it says false, set it to true. Remember that enable-command-block in server.properties no longer counts since 1.21.9.

  2. It won't let you open or place it

    You need to be an operator and in creative. With op-permission-level below 2 in server.properties, not even operators can: leave it at 2 or higher.

  3. Players can't press the button

    If the button is near spawn, spawn protection (spawn-protection, 16 blocks by default) stops non-operators using buttons and levers. A pressure plate does work; or lower spawn-protection to 0 and protect the area with a plugin.

  4. A plugin takes over the command

    If EssentialsX or another plugin has a command with the same name (tp, give…), the block may run the plugin's, which sometimes only works for players. Write Minecraft's with its prefix: minecraft:tp, minecraft:give. For all of them at once, Paper has command-block-overrides in commands.yml.

  5. Nobody's nearby

    A command block only works if its chunk is loaded: if everyone leaves that area, it stops. For something that must keep running, forceload add with the coordinates keeps that chunk loaded (in moderation: every loaded chunk costs the server).

  6. Chat fills up with notices

    Operators see every run in chat. gamerule command_block_output false silences it; gamerule send_command_feedback false also silences the response to commands you type.

When a datapack or plugin is better

For two or three buttons, command blocks. For a whole minigame or lots of chains, a datapack with functions (.mcfunction) is easier to maintain and to copy to another world, and doesn't depend on someone being nearby; the datapacks guide explains how to install them. For kits, warps or shops that already exist, a plugin usually saves you the work.

A repeat with a broad selector (@e with no limits) every tick does show in performance with many players. If the server stutters, spark tells you whether it's the command blocks.

How it's done on NapNodes

In the panel, inside your Minecraft server, “Settings” → “Game rules” → “Commands and messages” has “Enable Command Blocks” and “Broadcast command block output”. They change with the server on and apply to the world, the Nether and the End at once (a gamerule typed in the console only changes the main world).

In the same “Settings”, among the server.properties options, are “Admin permission level” (op-permission-level) and “Spawn protection” (spawn-protection), the two reasons someone can't use them. And the server comes on Paper on the latest version: the rule names in this guide are the ones that work on it.

Frequently asked questions

How do I enable command blocks on my Minecraft server?

Since 1.21.9, with the game rule: gamerule command_blocks_work true in the server console. On older versions, with enable-command-block=true in server.properties and a restart.

Why does enable-command-block=true do nothing?

Because since Minecraft 1.21.9 that server.properties line is no longer read. It's now the command_blocks_work rule.

How do I get a command block?

It isn't in the creative inventory: as an operator in creative, type /give @s minecraft:command_block.

Why can't I open the command block?

You have to be an operator (level 2 or higher) and in creative mode. If you're op and it still won't open, check op-permission-level in server.properties.

How do I remove command block messages from chat?

gamerule command_block_output false in the console.

Shall we set it up for you?

Minecraft servers from €6 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Minecraft server, no card needed.

Your server doesn't show up in the game? Check it in a second with “Is my Minecraft server online?”: players, version and MOTD, free. Need a player's UUID for the whitelist or permissions? Look it up here. Handing out enchanted items? Build the command with the /give generator.

Free tool: /give command generator. Items with enchantments, a coloured name and lore: the /give command written right for your Minecraft version.

Free tool: /tellraw and /title generator. Messages with colours, bold and click actions in chat or across the screen: the /tellraw or /title command ready to copy.

Free tool: Minecraft item IDs. Search any block or item by its in-game name and copy its ID or the /give. Every one from the latest version.

Keep reading

All Minecraft guides, sorted →