Directive Block – Official Minecraft Wiki

Instruction Block

A instruction block is a block that can execute instructions. Because it cannot be obtained in Survival mode without cheats, it is primarily used on multiplayer servers and in custom-built maps.

Directive blocks can be obtained by using the pick block control or with various directions, such as /give @p minecraft:command_block .

Just like other blocks that can store NBT data, using pick block + ctrl will copy the instruction and options inwards the guideline block. This permits it to be placed elsewhere without having to re-enter the the data inwards.

Instruction blocks are not available in the Creative inventory, cannot be violated in Survival mode or if you do not have operator permissions, are not flammable, and have the same blast resistance as bedrock. Guideline blocks cannot be moved by a piston.

A directive block can execute directives when activated by redstone power. It always has all permissions, so it can be used to permit a specific use of a instruction by players who can’t use that guideline in general (for example, permitting anyone to obtain a specific item with /give , without permitting everyone to /give themselves whatever they want).

A directive block has an orientation (“facing”) which determines which chain directive block will be activated, and which blocks will be checked to see if a instruction block in “Conditional” mode executes.

Modification Edit

To inject or modify the guideline in a instruction block, use the Use Item control on the instruction block to open the directive block GUI (graphical user interface). The GUI will only open if the player is in Creative mode, and has the decent permissions. In singleplayer, cheats must be enabled to edit directive blocks. In multiplayer, instruction blocks can only be edited successfully by operators in Creative mode, and for instruction blocks to work at all the following values must be set in the file:

  • enable-command-block must be set to true
  • op-permission-level must be set to two or above (default is Four)

Console Directive Instructions can be entered in the top text pane. The text limit for guidelines in a directive block is 32,500 characters, but the text pane can only demonstrate a puny portion of this amount at a time. Press Tab ↹ to accomplish words or cycle through options. Instructions in a guideline block do not need to be prefixed with the forward slash ( / ) as they do in the talk window, but doing so will still work. Below the console directive text pane are some reminder tips about how to use target selectors. Previous Output The bottom text pane displays the output message (success or failure) of the last executed directive (originally blank). Its text is not editable. A button to the right of the Previous Output text pane specifies whether the last output should be stored and displayed. It shows O (the default) when the output should be stored and X when the output should not be stored. A directive block that’s tracking its output while executing its instruction will cause a block update, and when you have sixty four of those guideline blocks tracking their output while executing their instruction sharing the same chunk, it will then cause one or more chunk updates because sixty four block updates in one chunk will cause one or more chunk updates. If the amount of chunk updates is high enough, then it can cause fps drops for players if they receiving the chunk updates. To avoid this, simply have all of your instruction blocks not track their output at all. The track output option should only be used temporarily for debugging purposes. Impulse/Chain/Repeat Click the “Impulse/Chain/Repeat” button to switch the guideline block’s type. The default state is “Impulse”, but non-default guideline blocks can be placed. The instruction block also switches color when switching its directive block type:

  • “Impulse” instruction blocks are orange. These execute once every time they are activated.
  • “Chain” guideline blocks are green. These execute only after the instruction block pointing to it is processed. This differs from the Conditional option in that it detects what is pointing to it, instead of simply behind it. The instruction blocks pointing to it also don’t need to be chain directive blocks themselves to trigger the chain.
  • “Repeat” directive blocks are purple. These will execute their directions once per game tick as long as they are activated (20 times per 2nd, barring lag).


Activation Edit

Directive blocks are redstone mechanisms and can be activated by:

  • An adjacent active power component: for example, a redstone torch (except that a redstone torch will not activate a instruction block it is affixed to), a block of redstone, a daylight sensor, a button etc.
  • An adjacent powered block (for example, an opaque block with an active redstone torch under it)
  • A powered redstone comparator or redstone repeater facing the mechanism component
  • Powered redstone dust configured to point at the guideline block (or on top of it) or directionless; a directive block is not activated by adjacent powered redstone dust which is configured to point away from it.

In addition, when a instruction block is cloned by a directive to a powered location, the fresh instruction block will only execute its directive if the original has never been activated (visible in the F3 debug screen as “triggered”).

Unlike all other redstone components except the note block, a guideline block can be activated every game tick (20 times per 2nd, barring lag). However, if it’s set to Needs Redstone, then activating it two game ticks in a row requires that it transition from powered to unpowered and back during the same tick (for example, with a setblock clock).

A directive block in “Always Active” mode is always activated. The default state is “Needs Redstone”, which means that it runs only when powered.

When activated, a guideline block will attempt to execute its instruction. depending on the instruction block’s type:

  • a directive block (“Impulse”) will attempt to execute its directive once
  • a chain guideline block (“Chain”) will not attempt to execute its instruction until another guideline block facing it executes its own directive
  • a repeating instruction block (“Repeat”) will attempt to execute its guideline every game tick until no longer activated

Chained execution Edit

If any directive block faces a chain guideline block (a directive block in “Chain” mode) when activated, it will notify the chain directive block to also attempt execution. The chain instruction block will only execute its directive if activated and, if in “Conditional” mode, if the guideline block behind it executed successfully (behind in the sense of the direction it is facing, not in the sense of which guideline block chained to it). Whether or not the chain instruction block is activated or executes successfully, if it is facing another chain directive block, it will notify it to attempt execution as well.

Chained instruction blocks execute in the same game tick in the order they are chained. Chained execution cannot be passed to a guideline block which has already executed in that game tick (loops execute only once).

Output Edit

When activated, a instruction block can produce numerous types of output:

Redstone Comparator A instruction block can power a redstone comparator facing away from it (possibly separated by a block) with a signal strength specific to the last executed directive (for example, the number of players affected by the directive). The signal strength always reflects the last instruction executed, even after the instruction block is deactivated. Message The output message describes the success or failure of the executed guideline, and may be written to numerous destinations: Previous Output: The output message is always written to the “Previous Output” text pane of the instruction block GUI. Talk: The output message is written to the talk text in singleplayer mode, or broadcast to all other ops in multiplayer mode, unless it has been suppressed with /gamerule commandBlockOutput false . Some directions may write extra text to the talk as their normal function which won’t be suppressed (for example, the /say guideline will write a message to the talk of all players), separate from the output message. Talk messages which would usually be prefaced by a player’s name (such as from the /me , /say and /tell guidelines) use @ as the player name. If the guideline block had been named in an anvil before placement, that name will be used instead. Logs: The output message is written to multiplayer server logs unless it has been suppressed with /gamerule logAdminCommands false . Guideline Stats Guideline blocks can post various success results to scoreboard objectives, including:

  • SuccessCount: the number of successes (previously also available by redstone comparator output, but not limited to 15)
  • AffectedBlocks: the number of blocks that were altered
  • AffectedEntities: the number of entities that were altered (including players)
  • AffectedItems: the number of items that were altered
  • QueryResult: value returned by guideline

The objectives to be used can be specified by running the /stats instruction or by modifying the instruction block’s NBT data directly with the /blockdata directive.

Notes Edit

The following guidelines are usable but with limited functionality (their output only displays in the directive block’s Previous Output pane rather than being displayed in the talk): /help , /seed , /list , /scoreboard objectives , /scoreboard players , and /scoreboard teams list .

The following instructions use the directive block’s name (defaults to @ ) in their output: /me , /say , and /tell .

Easter eggs Edit

Running “Searge” as the guideline in the instruction block without a preceding ” / ” will now set the previous output to “#itzlipofutzli”. Additionally, if /help is run via guideline block, it gives various messages prefixed with “Searge says: “.

A instruction block has an ID name of minecraft:command_block and is further defined by its block data and block entity. A guideline block also has a block state which is expected to substitute the functionality of block data in 1.13. [ upcoming ]

Related video:

Leave a Reply

Your email address will not be published. Required fields are marked *