Execute Command Generator

Run another command as a target, at another position, or only when a condition is true — the most powerful command for maps and in-game systems

Enter the command without the leading / (if you include one, it will be stripped automatically).

The command runs as if this target were the executor (@s inside the command will refer to it).

What Execute can do

/execute does not do anything by itself — it changes the "context" before running another command, turning an ordinary command into an automated system.

  1. as — changes who the executor is, affecting @s inside the command.
  2. at — changes which position the command runs from, affecting relative coordinates ~
  3. positioned — specifies an exact position to run at.
  4. if / unless — runs only when a condition is true/false.

Example: /execute as @e[type=zombie] at @s run tp @s ~ ~10 ~ means "teleport every zombie 10 blocks up from wherever it is standing."

Worked examples

The examples below come out of the same generator as the form above, so the commands and explanations always match what the tool produces. Copy one and adjust it from there

1. Run a command as every player

as changes *who* runs it, at changes *where* it runs — most of the time you need both together

/execute as @a at @s run say พร้อมแล้ว

What it does Will run the command "say พร้อมแล้ว" on behalf of all players at the position of themselves (whoever runs the command) (adjust the executor, position, and condition before the actual command runs).

2. Only act when standing on a certain block

The if_block condition only lets the command through when the block at that position matches — the basis of pressure-plate style triggers

/execute as @a at @s if block ~ ~-1 ~ minecraft:gold_block run effect give @s minecraft:jump_boost 5 1

What it does Will run the command "effect give @s minecraft:jump_boost 5 1" on behalf of all players at the position of themselves (whoever runs the command) only when the block at ~ ~-1 ~ is "Block of Gold" (adjust the executor, position, and condition before the actual command runs).

3. Run a command at a different position

positioned moves the anchor point of the command that follows, without teleporting you there

/execute positioned ~ ~5 ~ run summon minecraft:armor_stand

What it does Will run the command "summon minecraft:armor_stand" at coordinates ~ ~5 ~ (adjust the executor, position, and condition before the actual command runs).

How this command differs by edition and version

This is the first example above, run through every edition and version this tool supports. Versions that produce the same result share a row

Java Edition 1.21.5 and up Java Edition 1.20.5 - 1.21.4 Java Edition 1.13 - 1.20.4 (legacy NBT)
/execute as @a at @s run say พร้อมแล้ว
Bedrock Edition (stable)
/execute as @a at @s run say พร้อมแล้ว
  • Bedrock supports this new execute syntax starting from version 1.19.50 — earlier versions use a different format

Before you use these