Skip to content
[/craft]

Execute Command Builder

Build /execute command chains for Java or Bedrock Minecraft. Add as, at, if, unless, positioned, rotated, and facing subcommands visually — without memorising the syntax.

JavaSwitch edition using the selector in the header.

Quick templates

Subcommands

as
Target
at
Target

run — leave blank to use /execute purely as a condition check

run
/execute as @a at @s run say Hello!

Example commands

Kill zombies near players

Java
/execute as @a at @s run kill @e[type=zombie,distance=..10]
Bedrock
/execute as @a at @s run kill @e[type=zombie,r=10]

Give effect only to players in a certain area

Java
/execute as @a[x=0,y=64,z=0,dx=20,dy=20,dz=20] run effect give @s minecraft:speed 30 1
Bedrock
/execute @a[x=0,y=64,z=0,dx=20,dy=20,dz=20] ~ ~ ~ effect @s speed 30 1

Summon lightning at each player

Java
/execute as @a at @s run summon lightning_bolt ~ ~ ~
Bedrock
/execute @a ~ ~ ~ summon lightning_bolt ~ ~ ~

Frequently asked questions

What is the difference between 'as' and 'at' in /execute?
'as' changes the executor (who @s refers to) without moving the execution point. 'at' moves the execution point to the target's position without changing the executor. You usually combine them: 'as @a at @s run ...' means run the command as each player and at their position.
Does /execute work on Bedrock Edition?
Yes, but the syntax differs significantly. Java Edition uses chained subcommands (as, at, if, run). Bedrock uses the older syntax where the target and position come immediately after /execute, like: /execute @p ~ ~ ~ <command>. The builder shows both.
What is the 'if' subcommand used for?
'if' conditionally runs the rest of the execute chain only when a condition is true. Common conditions: 'if entity @e[type=zombie]' (only if zombies exist), 'if block ~ ~-1 ~ air' (only if the block below is air), 'if score @s kills matches 10..' (only if a scoreboard score is 10 or more).

Related