MCTOOLBOX
MC ToolboxMC TOOLBOX

/execute Command Builder

Chain modifiers, conditions and a final run subcommand to build a valid /execute command for Java or Bedrock, then copy it into your world or datapack.

Generated Command

/execute as @s run say Hello

This chain is complete.

Command chain

as #1
run #2

What does /execute do?

The /execute command runs another command while changing who executes it, where and how it runs, and optionally adding conditions. This builder chains subcommands in the correct order so you never mix up the syntax again.

How to build an execute chain

  1. Add subcommands in the order you need them. Each one modifies the execution context for everything that follows.
  2. Configure each subcommand: entity selectors, coordinates, conditions, and score comparisons.
  3. Set the run command: the final command that executes with the modified context, at the end of the chain.
  4. Copy the assembled chain and paste it into chat or a command block.

The hard part is the syntax. One chain can easily exceed 200 characters, and a single misplaced keyword breaks the whole command. This builder removes that risk with dropdowns, fields, and a live preview.

Execute subcommands explained

SubcommandWhat it changes
asExecuting entity (who)
atPosition, rotation and dimension
positionedPosition only
rotatedRotation only
facingRotation to face a point or entity
alignSnap position to block grid
anchoredAnchor point (eyes or feet)
inDimension
onPick an entity relation
if / unlessConditional execution
storeSaves result or success to data
runFinal command to execute

Modifier subcommands

as changes the executor to the selected entities, at moves the execution position to them, positioned and rotated set position and rotation directly, facing aims at a point or entity, align snaps to block grid, anchored picks eyes or feet, in changes the dimension, and on picks an entity relation.

Condition subcommands

if and unless test a condition and only continue the chain when it passes. Available tests include entity, block, blocks, data, score, loaded, predicate, biome and function on Java, and entity, block, blocks and score on Bedrock.

Store (Java Edition only)

store result and store success save the output of the final command into a score, block entity, entity NBT, command storage or bossbar. Bedrock does not have store subcommands.

Order matters

Subcommands run from left to right. When as or at selects many entities, the rest of the chain forks once per entity, like execute as @a run say Hi running for every player at once.

Common examples

Say hello as every player: execute as @a run say Hello
Strike lightning on zombies on grass: execute as @e[type=zombie] at @s if block ~ ~-1 ~ minecraft:grass_block run summon lightning_bolt
Store a player health as a score: execute store result score @s health run data get entity @s Health

Common questions

Why is my execute command not working?
The chain must end with a run subcommand or a condition, run can only appear once at the very end, and the syntax changed between versions. If a command block says unparseable, compare your chain with the wiki examples for your version.

Can Bedrock use store?
No. store, on, summon, data, biome, predicate, function and loaded are Java-only. This builder hides them when Bedrock is selected.

How do I run a command for every player?
Use execute as @a run <command>. The as subcommand selects every player and the chain runs once per selected entity.

What is the difference between as and at?
as changes who executes (the executor), at changes where it executes (the position). Use as to act on entities and at to act at their location, or combine both: execute as @e at @s run summon lightning_bolt.

Do I need operator permissions?
Java requires permission level 2 (a command block or an op). Bedrock requires cheats enabled in the world settings.

What is the max command fork count in Minecraft?
The max_command_forks gamerule defaults to 65,536 and limits how many execution contexts a single /execute command can create. If as @e selects more entities than the limit, the command fails. max_command_sequence_length (maxcommandchainlength on Bedrock), also 65,536 by default, limits the total commands in a chain or function.