GameplayJavaBedrock

/execute

The most powerful command in Minecraft. /execute lets you change who runs a command, where it runs from, and conditional checks (if/unless), then runs another command. Chains multiple subcommands.

What is /execute used for?

What /execute is for

Runs another command in a modified context — as a different entity, at a different position, rotation, or dimension, and only if (or unless) a condition is met.

When to use /execute

It's the engine behind almost every advanced command setup: detect players in a region, run logic per entity, check blocks or scores, and store command results into NBT or scoreboards.

How the subcommands chain

Stack modifiers like as @a at @s if block ~ ~-1 ~ stone run … — each clause refines who/where/whether, and the final 'run' executes the command for every matching context.

Syntax

Parameters

subcommand
literal
as / at / positioned / facing / rotated / in / on / if / unless / store / align / anchored / summon
command
command
The command to run with the modified context.

Command builder

Configure the options below to generate a ready-to-paste /execute command.

/execute chains context modifiers before running a command. This builder covers the most common clauses; subcommands can be nested far deeper in-game.

Examples

  • Spawn a firework at each player.

  • Conditional run based on scoreboard.

  • Mark players with 10+ kills as glowing.

Common questions

What does /execute do in Minecraft?

It runs another command in a changed context — as a different entity, at another location or rotation, or only if a condition is true. It's the foundation of most advanced command setups.

How do I run a command only if a player stands on a block?

Use /execute as @a at @s if block ~ ~-1 ~ <block> run <command> — it checks the block beneath each player before running.

Permission level

/execute requires Cheats (op level 2). In single-player you need the world's "Allow Cheats" toggle on. On a multiplayer server you need to be opped — see /op.