Skip to main content

/execute

Modifies the execution context of a command. Supports changing the executor, position, dimension, rotation, anchoring, and adding conditions. The most powerful and flexible command in the game.

Category
Execute
Permission Level
Game Master
Version Added
1.13

Syntax

/execute <subcommand> ... run <command>

Parameters

NameTypeRequiredDescription
subcommandsvariousRequiredChain of subcommands: as, at, positioned, rotated, facing, anchored, align, in, if/unless, store, on, summon, run.
commandcommandRequiredThe command to execute with the modified context (after 'run').

Examples

/execute as @a at @s run particle flame ~ ~1 ~ 0.5 0.5 0.5 0 10

Spawns flame particles at every player's position by executing as each player at their location.

/execute if score @p kills matches 10.. run title @p title {"text":"Killer!","color":"red"}

Shows a "Killer!" title to any nearby player with 10+ kills.

/execute in minecraft:the_nether run tp @s ~ ~ ~

Teleports yourself to the same coordinates in the Nether.

Common Mistakes

Notes

Key subcommands: 'as' changes executor, 'at' changes position/rotation/dimension, 'positioned' changes only position, 'in' changes dimension, 'if/unless' adds conditions, 'store' saves results to scoreboards/data/bossbars. Multiple subcommands can be chained for complex logic.

Related Commands

Need a Minecraft server?

Try these commands on Astroworld or host your own server.

Try Astroworld Hosting