![]() |
VOOZH | about |
/execute| Permission level required |
|
|---|---|
| Restrictions | Cheats only[BE only] |
{
"title": "<code>/execute</code>",
"rows": [
{
"field": "\n* 2 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Java Edition\">(link to Java Edition article, displayed as JE) only</span></i>]</sup>\n* 1 <sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Cheats article, displayed as Cheats) only<sup class=\" nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Executes another command but allows changing the executor, changing the position and angle it is executed at, adding preconditions, and storing its result.
There are fourteen[JE only] / eleven[BE only] subcommands (aka. instructions) for the /execute command. Multiple subcommands can be chained after /execute. Subcommands are divided into 4[JE only] / 3[BE only] categories: modifier subcommands, condition subcommands, store subcommands[JE only], and the run subcommand.
run subcommand is used for carrying out another command.All needed subcommands can be concatenated together. Subcommands other than the run subcommand can be arranged arbitrarily and used multiple times. The run subcommand can be used only once, at the end of the chain. Only a run subcommand or a condition subcommand may finalize the chain; otherwise, the command is unparseable.
The game processes the subcommand chain in order — from left to right. For example, the following commands are different:
execute as @e at @s run tp ^ ^ ^1execute at @s as @e run tp ^ ^ ^1Some subcommands can fork the command execution into multiple branches, causing subcommands following it to be executed multiple times. For example, when the as subcommand selects multiple entities, the subcommands following it execute once per entity.
If the /execute command doesn't fork, it has only one branch — the main branch.
A branch may terminate halfway if, for example, the condition in a condition subcommand isn't met, or the as subcommand selects zero entities. When terminating, a red message is shown.[BE only] If all branches terminate, the /execute command is said to have terminated.
Forking is different between Java Edition and Bedrock Edition (see also MC-125067 – resolved as "Won't Fix". and MCPE-165278 – resolved as "Unresolved".):
run subcommands, so the run subcommand cannot affect other subcommands.execute as @e[type=armor_stand] as @e[type=armor_stand] run summon armor_stand, the behaviors of Java Edition and Bedrock Edition are shown in the following pictures:Note that ... run execute ... has no overall effect in both versions. For example, the following commands are identical:
execute as @e[type=armor_stand] as @e[type=armor_stand] run summon armor_standexecute as @e[type=armor_stand] run execute as @e[type=armor_stand] run execute run execute run summon armor_standIn Java Edition, depth-first can be achieved via /function, for example:
execute as @e[type=armor_stand] run function test, and in the function file is:
execute as @e[type=armor_stand] run summon armor_stand/execute as @e[type=armor_stand] as @e[type=armor_stand] run summon armor_stand in Bedrock Edition.In Bedrock Edition, there is no way to achieve breadth-first.
In Java Edition, a branch outputs a success value and a result value (see also Commands#Output) after it is fully executed (does not terminate halfway). These two output values:
/execute command itself;run subcommand).success value is always 0 or 1. The result value is rounded down if not an integer.Note that these two values are from the conditional subcommand at the end or from the command in the run subcommand, and are the output values of each branch, rather than of the whole /execute command.
If executing /function command in the run subcommand, these two output values are not available under certain conditions. See the /function for details.
If the command execution is forked after a store subcommand, the storage operation is applied on each branch. The output value of each branch is stored after the branch is fully executed. If the store locations are the same between all branches, the output value of a later-executing branch directly overwrites the output value of the earlier-executed branch, rather than being accumulated. So, after the whole /execute command is executed, the value at this storage location is the output of the last branch executed.
Like most commands, /execute command itself also has a success count (whether or not terminates halfway):
/execute command itself, rather than of each execution branch.run subcommand).There are fourteen[JE only] / eleven[BE only] instructions (aka. subcommands) for the /execute command, and each has its own special syntax, so describing syntax takes a large branching tree.
/execute ...
... align <axes> -> execute... anchored <anchor> -> execute... as <targets> -> execute... at <targets> -> execute... facing (<pos>|entity <targets> <anchor>) -> execute... in <dimension> -> execute... on <relation> -> execute... positioned (<pos>|as <targets>|over <heightmap>) -> 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... summon <entity> -> execute... (if|unless) ...
... biome <pos> <biome> -> [execute]... block <pos> <block> -> [execute]... blocks <start> <end> <destination> (all|masked) -> [execute]... data ...
... block <sourcePos> <path> -> [execute]... entity <source> <path> -> [execute]... storage <source> <path> -> [execute]... dimension <dimension> -> [execute]... entity <entities> -> [execute]... function <function> -> execute... items ...
... block <sourcePos> <slots> <item_predicate> -> [execute]... entity <source> <slots> <item_predicate> -> [execute]... loaded <pos> -> [execute]... predicate <predicate> -> [execute]... score <target> <targetObjective> ...
... (<|<=|=|>|>=) <source> <sourceObjective> -> [execute]... matches <range> -> [execute]... run <command>-> execute represents the start of another subcommand that is required; -> [execute] represents the start of another subcommand that is optional./execute ...
... align <axes: string> <chainedCommand: ExecuteChainedOption_0>... anchored <eyes|feet> <chainedCommand: ExecuteChainedOption_0>... as <origin: target> <chainedCommand: ExecuteChainedOption_0>... at <origin: target> <chainedCommand: ExecuteChainedOption_0>... facing ...
... <position: x y z> <chainedCommand: ExecuteChainedOption_0>... entity <origin: target> <eyes|feet> <chainedCommand: ExecuteChainedOption_0>... in <dimension: Dimension> <chainedCommand: ExecuteChainedOption_0>... positioned ...
... <position: x y z> <chainedCommand: ExecuteChainedOption_0>... as <origin: target> <chainedCommand: ExecuteChainedOption_0>... rotated ...
... <yaw: value> <pitch: value> <chainedCommand: ExecuteChainedOption_0>... as <origin: target> <chainedCommand: ExecuteChainedOption_0>... <subcommand: Option_If_Unless> ...
... block <position: x y z> <block: Block> ...
... <blockStates: block states> [chainedCommand: ExecuteChainedOption_0]... [chainedCommand: ExecuteChainedOption_0]... blocks <begin: x y z> <end: x y z> <destination: x y z> <scan mode: BlocksScanMode> [chainedCommand: ExecuteChainedOption_0]... entity <target: target> [chainedCommand: ExecuteChainedOption_0]... score <target: target> <objective: string> ...
... <operation: compare operator> <source: target> <objective: string> [chainedCommand: ExecuteChainedOption_0]... matches <range: integer range> [chainedCommand: ExecuteChainedOption_0]... run <command: command>chainedCommand: ExecuteChainedOption_0 represents the start of another subcommand.align <axes> -> executealign <axes: string> <chainedCommand: ExecuteChainedOption_0><axes>: swizzleaxes: string: basic_string
x, xz, zyx, or yz.)execute align xz changes the position to (-2, 2.3, 5).execute align yxz run spawnpoint @p ~ ~ ~ sets the player's spawnpoint to (2, -2, 3).positioned <pos> -> execute resets to feet.facing subcommand (of /execute and /teleport) works off of.anchored <anchor> -> executeanchored <eyes|feet> <chainedCommand: ExecuteChainedOption_0><anchor>: entity_anchoreyes|feet
eyes or feet./tp is to move a target by placing its feet at the given position.execute anchored eyes run tp ^ ^ ^ effectively teleports the executor's feet to where its eyes are.execute anchored eyes run tp ^5 ^ ^ means "place the executor's feet 5 blocks left of where its eyes are"as <targets> -> executeas <origin: target> <chainedCommand: ExecuteChainedOption_0><targets>: entityorigin: target: CommandSelector<Actor>
@s).<targets> or origin: target selects multiple entities.<targets> or origin: target fails to resolve to one or more entities (named players must be online).execute as @e[type=sheep] run kill @sexecute as @e[type=villager] run data merge entity @s {Invulnerable:1}[Java Edition only]at <targets> -> executeat <origin: target> <chainedCommand: ExecuteChainedOption_0><targets>: entityorigin: target: CommandSelector<Actor>
<targets> or origin: target selects multiple entities.<targets> or origin: target fails to resolve to one or more entities (named players must be online).execute as @e[type=sheep] at @s run tp ~ ~1 ~at" does not change the executor: execute at @e[type=sheep] run kill @sfacing <pos> -> executefacing entity <targets> <anchor> -> executefacing <position: x y z> <chainedCommand: ExecuteChainedOption_0>facing entity <origin: target> <eyes|feet> <chainedCommand: ExecuteChainedOption_0>facing <pos> and facing <position: x y z>
<pos>: vec3position: x y z: CommandPositionFloat
facing entity <targets> <anchor> and facing entity <origin: target> <eyes|feet>
<targets>: entityorigin: target: CommandSelector<Actor>
<anchor>: entity_anchoreyes|feet: enum
eyes or feet.<targets> or origin: target selects multiple entities.<targets> or origin: target fails to resolve to one or more entities (named players must be online).execute facing ^1 ^ ^ run tp @s ~ ~ ~ ~ ~execute as @e at @s facing 0 64 0 run tp @s ^ ^ ^1execute as @e at @s facing 0 64 0 run tp ^ ^ ^1 ~ ~execute as @e[type=!player] at @s facing entity @p feet run tp @s ^ ^ ^1in <dimension> -> executein <dimension: Dimension> <chainedCommand: ExecuteChainedOption_0><dimension>: dimensiondimension: Dimension: enum
overworld, nether, or the_end.execute in minecraft:the_end run locate structure minecraft:end_city[Java Edition only]execute in the_end run locate structure end_city[Bedrock Edition only](16,64,16) in Overworld runs the following command, the player is teleported to (16,64,16) in the Nether:
execute in minecraft:the_nether positioned as @s run tp ~ ~ ~[Java Edition only]execute in nether positioned as @s run tp ~ ~ ~[Bedrock Edition only](16,64,16) in Overworld runs the following command, the player is teleported to (2,64,2) in the Nether.
execute in minecraft:the_nether run tp ~ ~ ~[Java Edition only]execute in nether run tp ~ ~ ~[Bedrock Edition only](80,64,80) in Overworld runs the following command, the player is teleported to (10,64,15) in the Nether.
execute in minecraft:the_nether run tp ~ ~ ~5[Java Edition only]execute in nether run tp ~ ~ ~5[Bedrock Edition only]on <relation> -> execute<relation>
attacker: the last entity that damaged the current executor entity in the previous 5 seconds. Note that damage types in minecraft:no_anger tag bypass the record of attacker. Interaction entities do not forget attacker after 5 seconds. Some mobs forget the attacker when ceasing their aggression.controller: the entity that is riding and controlling the current executor entity. See Riding#Controlling for details.leasher: the entity leading the current executor entity with a leash.origin: the entity that causes the summon of the current executor entity. For example, the shooter of an arrow, the primer of a primed TNT entity.owner: the owner of the current executor entity if it is a tameable animal.passengers: all entities that are directly riding the current executor entity, no sub-passengers.target: the target that the current executor entity intends on attacking. Interaction entities can select the last entity that interacted with them.vehicle: the entity ridden by the current executor entity.@s).passengers selects multiple entities. (Other relations can select only at most one entities.)execute as @e[type=cat] on leasher run damage @s 2 genericexecute as @e[type=boat] on passengers run give @s fishing_rodpositioned <pos> -> executepositioned as <targets> -> executepositioned over <heightmap> -> executepositioned <position: x y z> <chainedCommand: ExecuteChainedOption_0>positioned as <origin: target> <chainedCommand: ExecuteChainedOption_0>positioned <pos> or positioned <position: x y z>
<pos>: vec3position: x y z: CommandPositionFloat
positioned as <targets> or positioned as <origin: target>
<targets>: entityorigin: target: CommandSelector<Actor>
positioned over <heightmap>
positioned <pos> also resets execution anchor to feet.<targets> or origin: target selects multiple entities.<targets> or origin: target fails to resolve to one or more entities (named players must be online), or over <heightmap> is specified when current execution position is not loaded.execute positioned 0 64 0 run locate structure #village[Java Edition only]execute positioned 0 64 0 run locate structure village[Bedrock Edition only]rotated <rot> -> executerotated as <targets> -> executerotated <yaw: value> <pitch: value> <chainedCommand: ExecuteChainedOption_0>rotated as <origin: target> <chainedCommand: ExecuteChainedOption_0>rotated <rot> or rotated <yaw: value> <pitch: value>
<rot>: rotation (<yaw> <pitch>)yaw: value: RelativeFloat and pitch: value: RelativeFloat
rotated as <targets> or rotated as <origin: target>
<targets>: entityorigin: target: CommandSelector<Actor>
<targets> or origin: target selects multiple entities.<targets> or origin: target fails to resolve to one or more valid entities (named players must be online).execute as @e[type=sheep] at @s rotated as @p run tp @s ^ ^ ^1execute as @e[type=sheep] positioned as @s rotated as @p run tp @s ^ ^ ^1summon <entity> -> execute<entity>: resource
minecraft:entity_type registry./execute command if the specified entity is minecraft:player or minecraft:fishing_bobber.execute summon sheep run tag @s add Testexecute summon block_display run data merge entity @s {transformation:{scale:[4.0,4.0,4.0]},block_state:{Name:"minecraft:dirt"}}The particular use of the if and unless subcommands are to restrict command execution to happen only under specified conditions. In most cases, unless is a negation of if, equivalent to "if not...". The two subcommands have identical argument structures.
if and unless terminates or fails.There are eleven[JE only] / four[BE only] different types of conditions:
(if|unless) biome <pos> <biome> -> [execute]<pos>: block_pos
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation.<biome>: resource_or_tag
minecraft:worldgen/biome registry.<pos> is unloaded or out of the world.success value and result value are 1.(if|unless) block <pos> <block> -> [execute]<subcommand: Option_If_Unless> block <position: x y z> <block: Block> [chainedCommand: ExecuteChainedOption_0]<subcommand: Option_If_Unless> block <position: x y z> <block: Block> <blockStates: block states> [chainedCommand: ExecuteChainedOption_0]<pos>: block_posposition: x y z: CommandPosition
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation. In Bedrock Edition, must be a three-dimensional coordinates composed of <X>, <Y> and <Z>, each of which must be a single-precision floating-point number or tilde and caret notation.<block>: block_predicateblock: Block: enum
block_id[block_states]{data_tags}(accepts block tags), in which block states and data tags can be omitted when they are not needed. In Bedrock Edition, must be a block id.blockStates: block states: BlockStateCommandParam
["<state1>"=<value1>,"<state2>"=<value2>,...]. For example: ["old_leaf_type"="birch","persistent_bit"=true].<pos> or position: x y z is unloaded or out of the world.success value and result value are 1.(if|unless) blocks <start> <end> <destination> (all|masked) -> [execute]<subcommand: Option_If_Unless> blocks <begin: x y z> <end: x y z> <destination: x y z> <scan mode: BlocksScanMode> [chainedCommand: ExecuteChainedOption_0]<start>: block_posbegin: x y z: CommandPosition<end>: block_posend: x y z: CommandPosition
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation. In Bedrock Edition, must be a three-dimensional coordinates composed of <X>, <Y> and <Z>, each of which must be a single-precision floating-point number or tilde and caret notation.<destination>: block_posdestination: x y z: CommandPosition
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation. In Bedrock Edition, must be a three-dimensional coordinates composed of <X>, <Y> and <Z>, each of which must be a single-precision floating-point number or tilde and caret notation.(all|masked)scan mode: BlocksScanMode: enum
all or masked.<start> / begin: x y z, <end> / end: x y z, or <destination> / destination: x y z is unloaded or out of the world.success value is 1.if mode, result value is the number of matching blocks (the total number of blocks in all mode, or the number of source region non-air blocks in masked mode).unless mode, result value is 1.(if|unless) data block <pos> <path> -> [execute] – for data checking a block(if|unless) data entity <target> <path> -> [execute] – for data checking an entity(if|unless) data storage <source> <path> -> [execute] – for data checking a storage(if|unless) data block <pos> <path>
<pos>: block_pos
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation.<path>: nbt_path
(if|unless) data entity <target> <path>
<target>: entity
<path>: nbt_path
(if|unless) data storage <source> <path>
<source>: resource_location
<path>: nbt_path
<pos> is unloaded or out of the world.<pos> isn't a block entity.<target> fails to resolve to one or more valid entities (named players must be online).success value is 1.if mode, result value is the number of matching data tags.unless mode, result value is 1.(if|unless) dimension <dimension> -> [execute]<dimension>: dimension
success value and result value are 1.(if|unless) entity <entities> -> [execute]<subcommand: Option_If_Unless> entity <target: target> [chainedCommand: ExecuteChainedOption_0]<entities>: entitytarget: target: CommandSelector<Actor>
success value is 1.if mode, result value is the number of matching entities.unless mode, result value is 1.(if|unless) function <function> -> execute<function>: function
#, which resolves into a function or a function tag during command execution./execute command.if does nothing and unless terminates current branch.if terminates current branch and unless does nothing.if terminates current branch and unless does nothing.if terminates current branch and unless does nothing.if does nothing and unless terminates current branch.(if|unless) items block <sourcePos> <slots> <item_predicate>(if|unless) items entity <source> <slots> <item_predicate><sourcePos>: block_pos
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation.<source>: entity
<slots>: item_slots
<slot_type>, <slot_type>.<slot_number> or <slot_type>.*. See Slot for details.<item_predicate>: item_predicate
item_id[tests](accepts item or block tags), in which tests can be omitted when they are not needed. See minecraft:item_predicate for details.<source_pos> is unloaded or out of the world.<source_pos> isn't a block entity.<source> fails to resolve to one or more valid entities (named players must be online).success value is 1.if mode, result value is the number of matching items.unless mode, result value is 1.(if|unless) loaded <pos> -> [execute]<pos>: block_pos
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation.<pos> is out of the world.success value and result value are 1.(if|unless) predicate <predicate> -> [execute]<predicate>: resource_location or inline definition
success value and result value are 1.(if|unless) score <target> <targetObjective> (<|<=|=|>=|>) <source> <sourceObjective> -> [execute] – for comparing two scores(if|unless) score <target> <targetObjective> matches <range> -> [execute] – for comparing one score against a range<subcommand: Option_If_Unless> score <target: target> <objective: string> <operation: compare operator> <source: target> <objective: string> [chainedCommand: ExecuteChainedOption_0] - for comparing two scores<subcommand: Option_If_Unless> score <target: target> <objective: string> matches <range: integer range> [chainedCommand: ExecuteChainedOption_0] - for comparing one score against a range<target>: score_holdertarget: target: CommandSelector<Actor>
* for all score holders being tracked by the scoreboard system. Player names don't need to be of a player that is online or a player that exists and can use almost all unicode characters[more information needed].<targetObjective>: objectiveobjective: string: basic_string
-, +, ., _, A-Z, a-z, and 0-9) In Bedrock Edition, it must be a single word that has no space or a double-quoted string (When quoted, \ can be used to escape characters). It resolves into a scoreboard objective during command execution.(if|unless) score ... (<|<=|=|>=|>) ... or <subcommand: Option_If_Unless> score ... <operation: compare operator> ...
(<|<=|=|>=|>)operation: compare operator: CommandCompareOperator
<, <=, =, >=, and >.<source>: score_holdersource: target: CommandSelector<Actor>
* for all score holders being tracked by the scoreboard system. Player names don't need to be of a player that is online or a player that exists and can use almost all unicode characters[more information needed].<sourceObjective>: objectiveobjective: string: basic_string
-, +, ., _, A-Z, a-z, and 0-9) In Bedrock Edition, it must be a single word that has no space or a double-quoted string (When quoted, \ can be used to escape characters). It resolves into a scoreboard objective during command execution.(if|unless) score ... matches ... or <subcommand: Option_If_Unless> score ... matches ...
<range>: int_rangerange: integer range: CommandIntegerRange
0 - exact match of 0. ..0 - less than or equal to 0. 0.. - more than or equal to 0. 0..1 - from 0 to 1, both inclusive.)<target> / target: target or <source> / source: target is *.success value and result value are 1.execute as @a at @s if block ~ ~-1 ~ #wool run kill @s[Java Edition only]execute as @a at @s if block ~ ~-1 ~ wool run kill @s[Bedrock Edition only]execute if score @s A = @s BStores the final subcommand's result or success value somewhere. It is first processed along with other subcommands in the subcommand chain, recording the location to store in. After the last subcommand (may be a condition subcommand or a run subcommand) is executed, output values are stored in the recorded location. Note that the output values of commands are always an integer. If not, they are rounded down.
There are five different modes of storage:
<scale>.store (result|success) block <targetPos> <path> <type> <scale> -> execute<targetPos>: block_pos
<X>, <Y> and <Z>, each of which must be an integer or a tilde and caret notation.<path>: nbt_path
<type>
byte, short, int, long, float, and double.<scale>: double
store (result|success) bossbar <id> (value|max) -> execute<id>: resource_location
value|max
<scale>. Like the /data command, "/execute store" cannot modify player NBT.store (result|success) entity <target> <path> <type> <scale> -> execute<target>: entity
<path>: nbt_path
<type>
byte, short, int, long, float, and double.<scale>: double
<targets> on the given <objective> with the final command's output value.store (result|success) score <targets> <objective> -> execute<targets>: score_holder
* for all score holders being tracked by the scoreboard system. Player names don't need to be of a player that is online or a player that exists and can use almost all unicode characters[more information needed].<objective>: objective
-, +, ., _, A-Z, a-z, and 0-9) It resolves into a scoreboard objective during command execution.<path> within storage <target> to store the output value in. Store as a byte, short, int, long, float, or double. If the output value is a decimal, it is rounded first and then multiplied by <scale>. If the storage does not yet exist, it gets created.store (result|success) storage <target> <path> <type> <scale> -> execute<target>: resource_location
<path>: nbt_path
<type>
byte, short, int, long, float, and double.<scale>: double
The run command's single argument is the command to be executed, the context variables of which may be modified by the subcommands used.
run --><command>run <command: command><command>command: command: unique_ptr<Command>
/).<command> or command: command is failure./execute as @a if data entity @s Inventory[{Slot:0b}].tag.Enchantments[{id:"minecraft:efficiency"}] run tp @s 0 64 0[Java Edition only]/execute as @a at @s anchored eyes run particle smoke ^ ^ ^3[Java Edition only]/execute as @e[type=pig] at @s store success entity @s Saddle byte 1 if entity @p[distance=..5][Java Edition only]/execute as @a at @s if block ~ ~ ~ water run say "My feet are soaked!"test is not set, eg by doing "scoreboard players reset @s test":
/execute as @a unless score @s test = @s test run say "Score is reset"/execute at @p as @e[type=skeleton,distance=..3] run data merge entity @s {Motion:[0.0,2.0,0.0]}[Java Edition only]/execute as @e[type=zombie] unless data entity @s ArmorItems[3].id run kill @s[Java Edition only]nearbyRedSheep scoreboard objective equal to the amount of red sheep within twenty blocks:
/execute as @a at @s store result score @s nearbyRedSheep if entity @e[type=sheep,nbt={Color:14},distance=..20]| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.13 | 17w45a | Reworked /execute. The syntax of /execute has been split off. See Commands/execute (old) for old syntax. | |||||
| 17w45b | Reworked /execute store. | ||||||
| 18w02a | Added new subcommands to /execute to allow for more control over commands. | ||||||
| 18w05a | Added /execute store (result|success) bossbar. | ||||||
| 1.14 | 18w43a | Added /execute (if|unless) data. | |||||
| 1.15 | 19w38a | Added /execute (if|unless) predicate.
| |||||
Added /execute store (result|success) storage. | |||||||
| 1.19.3 | 22w46a | Added /execute (if|unless) biome. | |||||
| 1.19.4 | 23w03a | Added /execute on. | |||||
Added /execute (if|unless) dimension and /execute (if|unless) loaded. | |||||||
| 23w04a | Added a new relation origin for /execute on. | ||||||
| 23w06a | Added /execute summon. | ||||||
Now /execute if loaded is a condition subcommand instead of a modifier-like subcommand.[2] | |||||||
| Pre-release 1 | Added /execute positioned over. | ||||||
| 1.20.2 | 23w31a | Added /execute (if|unless) function. | |||||
| 1.20.2 Pre-release 1 | Temporarily removed syntax /execute (if|unless) function. | ||||||
| 1.20.3 | 23w41a | Reintroduced syntax /execute (if|unless) function. | |||||
| 23w44a | /execute (if|unless) function no longer always fails if all functions had no return. | ||||||
| 1.20.5 | 24w10a | Added /execute (if|unless) items. | |||||
| 1.21.11 | 25w41a | Added new syntax /execute (if|unless) stopwatch <id> <range>. | |||||
| 26.2 | pre1 | /execute on owner will now consider vexes as owned by their evoker. | |||||
| Upcoming Java Edition | |||||||
| 26.3 | snapshot1 | Added new slots condition sub-command. | |||||
| The items condition sub-command now takes a slot source as argument instead of a slot. | |||||||
| Bedrock Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.19.10 Experiment | Preview 1.19.10.20 | Added new /execute syntax to closer resemble that of Java Edition. | |||||
| 1.19.40 Experiment | Preview 1.19.40.20 | Implemented the /execute rotated command. | |||||
| Preview 1.19.40.21 | Implemented the /execute facing and /execute align commands. | ||||||
| Preview 1.19.40.23 | Implemented the /execute anchored and /execute in commands. | ||||||
| 1.19.50 | Preview 1.19.50.23 | The new /execute syntax is no longer behind the "Upcoming Creator Features" experimental toggle. | |||||
| 1.19.70 | Preview 1.19.70.21 | Removed data: int argument from /execute <if|unless> block. | |||||
/execute Command" – Microsoft Learn, July 17, 2024.