/execute Command Generator
BetaAdd steps one at a time, see what the chain does in plain English, and copy an /execute command in the syntax your version understands, old or new.
Describe it — AI writes the command
Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.
Checking the AI…
Paste a command— edit it here or move it to another version
- For every zombie within 10 blocksBranches: the rest runs once per match
- At its position
- If the block 1 block below is sand
- Run /say I'm standing on sand
Your command · Java 26.3
98 characters/execute as @e[type=zombie,distance=..10] at @s if block ~ ~-1 ~ sand run say I'm standing on sand
Raw editor
How it works
An /execute command is a chain read from left to right. Each step changes who runs the command, where it runs, or stops the chain if a test fails. The last step is run followed by the command. The usual start is as … at @s: run once for every matching entity, at that entity’s position.
Java 1.13 and later
execute as @e[type=zombie,distance=..10] at @s if block ~ ~-1 ~ sand run say I'm standing on sand
Newer steps need newer versions: if predicate and store … storage (1.15), if biome (1.19.3), on, summon, positioned over, if dimension and if loaded (1.19.4), if function (1.20.2) and if items (1.20.5). Pick an older version and the generator leaves those steps out and says so.
Bedrock 1.19.50 and later
execute as @e[type=zombie,r=10] at @s if block ~ ~-1 ~ sand run say I'm standing on sand
Bedrock has as, at, positioned, rotated, facing, in, anchored, align, if/unless with block, blocks, entity and score, and run. There is no store, on or summon. Selectors use r= instead of distance=; the generator converts them.
Java 1.8 – 1.12 and Bedrock before 1.19.50
execute @e[type=zombie,r=10] ~ ~ ~ detect ~ ~-1 ~ sand -1 say I'm standing on sand
The old form always runs as and at the entity, with one optional detect block test. The generator turns as + at, positioned and if block into this form, chaining a second execute @s when it needs another block test. Anything else (unless, scores, store) has no old equivalent and is left out with a note.
You can also paste an existing /execute command, new or old, to load it into the form and see what it does.
FAQ
What is the difference between execute as and execute at?
as changes who runs the command (so @s means that entity) but keeps the position. at moves the position, rotation and dimension to the entity but keeps who runs it. That is why most commands use both: as @e[…] at @s.
Why does my old /execute command not work any more?
Java 1.13 and Bedrock 1.19.50 replaced execute <entity> <x y z> <command> with the step syntax. The old command becomes execute as <entity> at @s positioned … run <command>, and detect becomes if block. Paste it into the generator and switch the version to convert it.
How do I check the block a player is standing on?
execute as @a at @s if block ~ ~-1 ~ <block> run <command>. ~ ~-1 ~ is the block one below the player's feet.
How do I run a command only if a score is high enough?
Add an if score step with a range: execute as @a if score @s kills matches 10.. run … runs for players with 10 or more. Ranges are 5, 1..10, 10.. or ..3.
Does Bedrock have execute store?
No. Bedrock's /execute has no store, on, summon or the newer Java conditions (predicate, biome, items…). The generator marks those steps Java only.