Title: Commands/execute – Official Minecraft Wiki
Headings: Commands/execute
Commands/execute
Contents
Java Edition
Full syntax tree
Modify subcommands
align
anchored
as
at
facing
in
positioned
rotated
Condition subcommands
(if|unless) block
(if|unless) blocks
(if|unless) data
(if|unless) entity
(if|unless) predicate
(if|unless) score
Example
Store subcommand
store (result|success) block
store (result|success) bossbar
store (result|success) entity
store (result|success) score
store (result|success) storage
Run subcommand
More examples
Bedrock Edition
Syntax
Arguments
Result
Examples
History

Content: When executing it with a command block, the success count is returned to the command block, which can be checked by a conditional command block for success or be read with a redstone comparator. There are twelve instructions (or sub-commands) for the /execute command, and each has its own special syntax, so describing syntax takes a large branching tree. Command Syntax Tree-Diagram [show]
This section needs to be updated. Please update this section to reflect recent updates or newly available information. Full syntax tree
/execute . . . … align <axes> -> execute
… anchored <anchor> -> execute
… as <targets> -> execute
… at <targets> -> execute
… facing (<pos>|entity <targets> <anchor>) -> execute
… in <dimension> -> execute
… positioned (<pos>|as <targets>) -> execute
… rotated (<rot>|as <targets>) -> execute
… store (result|success) . . . … block <targetPos> <path> <type> <scale> -> execute
… bossbar <id> (max|value) -> execute
… entity <target> <path> <type> <scale> -> execute
… score <targets> <objective> -> execute
… storage <target> <path> <type> <scale> -> execute
… ( if | unless) . . . … block <pos> <block> -> [ execute]
… blocks <start> <end> <destination> (all|masked) -> [ execute]
… data . . . … block <sourcePos> <path> -> [ execute]
… entity <source> <path> -> [ execute]
… storage <source> <path> -> [ execute]
… entity <entities> -> [ execute]
… predicate <predicate> -> [ execute]
… score <target> <targetObjective> . . . … (<|<=|=|>|>=) <source> <sourceObjective> -> [ execute]
… matches <range> -> [ execute]
… run < command >
where -> execute represents the start of another subcommand.