Free browser tool

Minecraft Execute Command Builder

Build a Java Edition /execute command by chaining subcommands visually. Add as, at, positioned, if, unless, and run steps, then copy the finished command.

Java Edition 1.13 – 26.x syntax · if function (1.20.3+) and if items (1.20.5+) included

Build Your /execute Command

Examples

Generated command /execute run say hello

How the /execute Command Works

The /execute command lets you modify the context before running another command. You can change who runs it (as), where it runs (at, positioned), which dimension (in), or add conditions (if, unless). The final run subcommand specifies what to execute.

Common /execute Patterns

Run as every player at their position

/execute as @a at @s run say Hello from my position!

Conditional: only if a block exists

/execute if block ~ ~-1 ~ minecraft:diamond_block run give @s minecraft:diamond 1

Run in the Nether

/execute in minecraft:the_nether positioned 0 64 0 run setblock ~ ~ ~ minecraft:glowstone

Negated condition

/execute unless entity @a[distance=..5] run say No players nearby

Subcommand Reference

  • as / at / positioned (as) — Change the executor and execution position.
  • positioned over — Move to a heightmap top (1.19.4+).
  • rotated (as) / facing (entity) / align / anchored — Control rotation and the block grid.
  • in <dimension> — Run in another dimension.
  • on <relation> — Run as a related entity (attacker, owner, vehicle, …, 1.19.4+).
  • summon <entity> — Summon and continue as it (1.19.4+).
  • if/unless block(s) / entity / score / data / predicate / biome — Conditions that must pass.
  • store result|success score|storage|block|entity|bossbar — Capture the command's result for later use.
  • if/unless function — Run a datapack function conditionally (1.20.3+).
  • if/unless items — Check an item in a block or entity slot (1.20.5+).
  • run <command> — The final command to execute. Must be last and unique.

Need item or block IDs for your conditions? Browse the Minecraft Item ID List or Minecraft Block IDs page.

Execute Command Builder FAQ

What does the /execute command do in Minecraft?

The /execute command modifies the context of another command — changing who runs it, where it runs, or adding conditions. For example, /execute as @a at @s run say hello makes every player say hello from their own position.

Can I chain multiple execute subcommands?

Yes. You can chain as many subcommands as you need before the final run. For example: /execute as @p at @s if block ~ ~-1 ~ minecraft:diamond_block run give @s minecraft:diamond 1 checks for a diamond block below the nearest player before giving them a diamond.

What is the difference between as and at?

as changes the executor (who runs the command), at changes the execution position (where the command runs). Using both together is common: as @p at @s means run as the nearest player at their location.

Do I need OP to use /execute?

Yes. /execute requires operator permissions or cheats enabled, same as /give and /setblock.