Commands/execute

executes another command but allows changing the executor, changing the position and angle it is executed at, adding preconditions, and storing its result.

Usage
There are fourteen / eleven instructions (aka. subcommands) for the  command. Multiple subcommands can be chained after. Subcommands are divided into 4 / 3 categories: modify subcommands, condition subcommands, store subcommands, and  subcommand.
 * Modify subcommands modify command context variables to change the context the command is executed. Subcommands following it will execute with specific executor(s), execution position(s), execution dimension(s), execution rotation(s) and execution anchor.
 * Condition subcommands are used to test whether certain conditions are met and then output results or limit conditions of execution.
 * Store subcommands can store the return values of the command in a scoreboard or the data of an entity, block entity, or storage, and can also change the maximum or current value of a bossbar.
 * subcommand is used for carrying out another command.

All needed subcommands can be concatenated together. Subcommands other than the  subcommand can be arranged arbitrarily and used multiple times. But the  subcommand can be used only once and must be put at the end of the subcommands chain. A  subcommand or a condition subcommand finalizes the chain, otherwise the command is unparseable $$ or parseable but does nothing (except   subcommand, see also  and ) $$.

Subcommands and forking
The game processes subcommand chain in order from front to end, for example, the following commands are different:
 * All entities move one block forward:
 * All entities are teleported to one block in front of the executor:

Some subcommands can fork the command execution, that is, they cause subcommands following it to be executed multiple times. It is possible to fork with zero branches, that is, terminate. For example, when subcommand selects multiple entities, the subcommand following it will executes once per entity.

If the /execute command hasn't ever forked, we describe it as having only one branch — the main branch.

A branch may terminate halfway and does nothing (including and store subcommands). For example, the condition in a condition subcommand doesn't met, or subcommand selects zero entities. When terminating, an red message is shown $$. If all branches terminated, we describe the /execute command itself as terminating.

Note that  has no effect at all in both  and. For example, the following commands work the same:

However, the way to fork is different in and. (See also and )
 * $$, the game processes subcommands in breadth-first, that is, executes subcommands one by one. So the game processes other subcommands before processing  subcommands, so the   subcommand cannot affect other subcommands.
 * $$, the game processes subcommands in depth-first. That is, after forking, all the following subcommands are considered as a whole and will be executed once for each branch.
 * For example, when there're two armor stands (A and B) in the world, and a player executes, the behaviors of  and  are shown in the following pictures:

$$, depth-first can be achieved via, for example: $$, there is no way to achieve breadth-first.
 * When there're two armor stands (A and B) in the world, and a player executes, and in the function file is:
 * It behaves like  in.
 * It behaves like  in.

Stored values
$$, a branch returns a  value and a   value (see  for details) after it fully executed (if it does not terminate halfway). These two return values come from the last subcommand (may be a condition subcommand or a  subcommand). The  value is always 0 or 1. The  value must be an integer, if not, it is rounded down. If the last subcommand fails, both the two values are 0. The two values can be stored through storage subcommands.

Note that all commands except the execute command have these two return values. The execute command itself does not have them.

If the command execution is forked after a storage subcommand, the storage operation will be applied on each branch. Each branch's return value will be stored. Since the stored values will not be accumulated, after the whole execute command is executed, the stored value is the return value of the last executed branch.

If executing a command after a storage subcommand, the storage operation will be applied on each command in the function file. For each command (except /execute command) in the function file, its return value will be stored after being executed. For commands in the function file, return value of each branch will be stored after being executed. The return value of command itself will be also stored after the whole function file is executed. Since the stored values will not be accumulated, after the whole execute command is executed, the stored value is the return value of the command itself.

Success count
Like amost commands,  command itself also has a success count (whether or not terminates halfway), which is different from   and   value. It is similar to the  value, but is accumulated. This is usually  or. If the command is forked or a function is executed, success count can be a number higher than. 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 or be read with a redstone comparator.

Syntax
There are fourteen / eleven instructions (aka. subcommands) for the  command, and each has its own special syntax, so describing syntax takes a large branching tree.


 * Full syntax tree:
 * Java Edition
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.


 * Bedrock Edition
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.
 * where  represents the start of another subcommand.

align

 * Updates the execution position, aligning to its current block position (an integer). Applies only along specified axes.
 * This is akin to the coordinates – i.e. rounding them downward.
 * Syntax
 * Arguments
 * Result
 * Execution position in the given axes are floored, changing by less than 1 block.
 * Unparseable if the argument is not specified correctly.
 * Example
 * Given (-1.8, 2.3, 5.9),  changes the position to (-2, 2.3, 5).
 * Given (2.4, -1.1, 3.8),  sets the player's spawnpoint to (2, -2, 3).
 * Result
 * Execution position in the given axes are floored, changing by less than 1 block.
 * Unparseable if the argument is not specified correctly.
 * Example
 * Given (-1.8, 2.3, 5.9),  changes the position to (-2, 2.3, 5).
 * Given (2.4, -1.1, 3.8),  sets the player's spawnpoint to (2, -2, 3).

anchored

 * Sets the execution anchor to the eyes or feet. Defaults to feet.
 * Running  resets to feet
 * Effectively recenters local coordinates on either the eyes or feet, also changing the angle the  subcommand (of  and ) works off of.
 * See also and  for issues about.
 * Syntax
 * Arguments
 * Whether to anchor the executed command to eyes or feet
 * Must be either  or.
 * Result
 * Execution anchor is set to either the eyes or the feet.
 * Unparseable if the argument is not specified correctly.
 * Example
 * The effect of is to move a target by placing its feet at the given position.
 * effectively teleports the executor's feet to where its eyes are.
 * means "place the executor's feet 5 blocks left of where its eyes are"
 * Unparseable if the argument is not specified correctly.
 * Example
 * The effect of is to move a target by placing its feet at the given position.
 * effectively teleports the executor's feet to where its eyes are.
 * means "place the executor's feet 5 blocks left of where its eyes are"

as

 * Sets the executor to target entity, without changing execution position, rotation, dimension, and anchor.
 * Syntax
 * Arguments
 * Target entity/entities to become the new executor.
 * Result
 * Executor is updated to target entity (which changes the meaning of ).
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Kill all sheep:
 * Make all villagers in loaded chunks invincible:
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Kill all sheep:
 * Make all villagers in loaded chunks invincible:

at

 * Sets the execution position, rotation, and dimension to match those of an entity; does not change executor.
 * Syntax
 * Arguments
 * Target entity/entities to match position, rotation, and dimension with.
 * Result
 * Execution position, rotation, and dimension are updated to match target entity.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Move all sheep upward 1 block:
 * Kill the player running the command, because " " does not change the executor:
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Move all sheep upward 1 block:
 * Kill the player running the command, because " " does not change the executor:

facing

 * Sets the execution rotation to face a given point, as viewed from its anchor (either the eyes or the feet).
 * Syntax
 * Arguments
 * Option:   and  
 * Coordinates to rotate toward
 * Option:   and  
 * The target(s) to rotate toward
 * Whether to point at the target's eyes or feet
 * Must be either  or.
 * Result
 * Execution rotation is updated to face given position or targets.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Executor rotates once to the left:
 * All entities move one block in the direction of (0, 64, 0) (without changing their rotation):
 * All entities move one block in the direction of (0, 64, 0) (with changing their rotation):
 * All non player entities move one space in the direction of their nearest player (without changing their rotation):
 * Must be either  or.
 * Result
 * Execution rotation is updated to face given position or targets.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Executor rotates once to the left:
 * All entities move one block in the direction of (0, 64, 0) (without changing their rotation):
 * All entities move one block in the direction of (0, 64, 0) (with changing their rotation):
 * All non player entities move one space in the direction of their nearest player (without changing their rotation):

in

 * Sets the execution dimension and position.
 * It respects dimension scaling for relative and local coordinates: the execution position (only the X/Z part) is divided by 8 when changing from the Overworld to the Nether, and is multiplied by 8 when vice versa. Applies to custom dimensions as well.
 * Syntax
 * Arguments
 * Name of the new execution dimension
 * Result
 * Execution dimension and position is updated.
 * Unparseable if the argument is not specified correctly.
 * Example
 * Looking for an end city (from the overworld):
 * If a player at position in Overworld runs the followeing command, the player is teleported to  in the Nether:
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * Unparseable if the argument is not specified correctly.
 * Example
 * Looking for an end city (from the overworld):
 * If a player at position in Overworld runs the followeing command, the player is teleported to  in the Nether:
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.
 * If a player at position in Overworld runs the following command, the player is teleported to  in the Nether.

on

 * Updates the executor, selecting entities based on relation to the current executor entity (changing the original executor), without changing execution position, rotation, dimension, and anchor.
 * Syntax
 * Arguments
 * : (attacker
 * A relation of the current executor entity
 * : the last entity that damaged the current executor entity in the previous 5 seconds. Note that damage types in  tag bypass the record of attacker. Interaction entities do not forget attacker after 5 seconds. Some mobs forget the attacker when stoping angry.
 * : the entity that is riding and controlling the current executor entity. See Riding for details.
 * : the entity leading the current executor entity with a leash.
 * : the entity that cause the summon of the current executor entity. For example, the shooter of an arrow, the primer of a primed TNT entity.
 * : the owner of the current executor entity if it is a tameable animal.
 * : all entities that are directly riding the current executor entity, no sub-passengers.
 * : the attack target of the current executor entity.
 * : the entity ridden by the current executor entity.
 * Result
 * Executor is updated based on the relation with the executor entity (which changes the meaning of ).
 * Forks if  selects multiple entities. (Other relations can select only at most one entities.)
 * Terminates if current executor is not an entity.
 * Terminates if the relation is not applicable to the current executor entity or there are no entities matching it.
 * Example
 * Damage 1 heart the entity that is leashing a cat:
 * Example
 * Damage 1 heart the entity that is leashing a cat:

positioned

 * Sets the execution position, without changing execution rotation or dimension; can match an entity's position, or at one block above the Y-level stored in the specified heightmap.
 * Syntax
 * Arguments
 * Option:   or  
 * New position
 * Option:   or  
 * Target entity/entities to match position with
 * Option:'' 
 * Specifies the heightmap
 * Must be one of,  ,  , and.
 * Result
 * Execution position is updated. And  also resets execution anchor to feet.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * When multiple entities are selected, next sub-command is executed once in each execution position.
 * Example
 * Look for a village near (0, 64, 0):
 * Option:'' 
 * Specifies the heightmap
 * Must be one of,  ,  , and.
 * Result
 * Execution position is updated. And  also resets execution anchor to feet.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * When multiple entities are selected, next sub-command is executed once in each execution position.
 * Example
 * Look for a village near (0, 64, 0):
 * Look for a village near (0, 64, 0):

rotated

 * Sets the execution rotation; can match an entity's rotation.
 * Syntax
 * Arguments
 * Option:   or  
 * : and
 * Angles of rotation
 * Option:   or  
 * Target entity/entities to match rotation with
 * Result
 * Execution rotation is updated.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Move every sheep 1 block in the direction that the player closest to it is facing:
 * Target entity/entities to match rotation with
 * Result
 * Execution rotation is updated.
 * Unparseable if the argument is not specified correctly.
 * Forks if  or   selects multiple entities.
 * Terminates if  or   fails to resolve to one or more valid entities (named players must be online).
 * Example
 * Move every sheep 1 block in the direction that the player closest to it is facing:
 * Example
 * Move every sheep 1 block in the direction that the player closest to it is facing:

summon

 * Summons an new entity at execution position and changes the executor to this summoned entity.
 * Syntax
 * Arguments
 * Entity to be summon and the new executor
 * Result
 * Summons the entity and changes the executor.
 * Unparseable if the argument is not specified correctly.
 * Example
 * Summon a sheep with the tag "Test":
 * Summon a block display entiy and scale it:
 * Unparseable if the argument is not specified correctly.
 * Example
 * Summon a sheep with the tag "Test":
 * Summon a block display entiy and scale it:

Condition subcommands
The particular use of the  and   subcommands are to restrict command execution to happen only under specified conditions. In most cases,  is a negation of , equivalent to "if not...". The two commands have identical argument structures.


 * Result of condition subcommands:
 * Unparseable if the argument is not specified correctly.
 * In some cases, for example, testing a block outside the world, both  and   terminates or fails.
 * When not at the end of the subcommands chain, only if the condition tests pass does the branch continue; otherwise it terminates.
 * $$, if it is executed in multiple branches, it acts as a context filter - Only branchs with a context that matches the condition continues.
 * When at the end of the subcommands chain, it checks whether the condition is met and then outputs. $$, it has output values that can be stored by store subcommands.

There are nine / four different types of conditions:
 * 1) (if|unless) biome – Tests a biome area
 * 2) (if|unless) block – Tests a single real block
 * 3) (if|unless) blocks – Tests a real 3D rectangular volume against another
 * 4) (if|unless) data – Tests the data held by a real block, entity, or a storage
 * 5) (if|unless) dimension - Tests the dimension of the execution
 * 6) (if|unless) entity – Tests whether an entity like the one given is real
 * 7) (if|unless) loaded - Tests if a given position is loaded in the world
 * 8) (if|unless) predicate – Tests a predicate
 * 9) (if|unless) score - Tests a target's score

(if|unless) biome

 * Checks for a specific biome in a given position.
 * Syntax


 * Arguments
 * Position to test
 * Biome(s) to test for
 * Biome(s) to test for
 * Biome(s) to test for
 * Biome(s) to test for


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If  is unloaded or out of the world.
 * If test doesn't pass.
 * When at the end of the subcommands chain, and the command is successful, both  value and   value are 1.

(if|unless) block

 * Compares the block at a given position to a given block ID or block tag.


 * Syntax


 * Arguments
 * Position of a target block to test
 * Specifies the block to test for
 * Specifies the block state for the specified block to test for
 * Specifies the block to test for
 * Specifies the block state for the specified block to test for
 * Specifies the block state for the specified block to test for
 * Specifies the block state for the specified block to test for
 * Specifies the block state for the specified block to test for


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If  or   is unloaded or out of the world.
 * If test doesn't pass.
 * $$, when at the end of the subcommands chain, and the command is successful, both  value and   value are 1.

(if|unless) blocks

 * Compares the blocks in two equally sized volumes.


 * Syntax


 * Arguments
 * Positions of any two diagonal corners of the source volume (the volume to compare)
 * Position of the lower northwest corner of the destination volume (the volume to compare to)
 * Assumed to be of the same size as the source volume
 * : (all
 * Specifies whether all blocks in the source volume should be compared, or if air blocks should be masked/ignored
 * Must be either  or.
 * Assumed to be of the same size as the source volume
 * : (all
 * Specifies whether all blocks in the source volume should be compared, or if air blocks should be masked/ignored
 * Must be either  or.
 * Specifies whether all blocks in the source volume should be compared, or if air blocks should be masked/ignored
 * Must be either  or.


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at end of the subcommands chain; fails when at the end:
 * If  / ,   /  , or   /   is unloaded or out of the world.
 * If the volume of the source region is greater than 32768 (the equivalent of 8 chunk sections)‌.
 * If test doesn't pass.
 * $$, when at the end of the subcommands chain, and the command is successful,  value is 1.
 * For  mode,   value is the number of matching blocks (the total number of blocks in   mode, or the number of source region non-air blocks in   mode).
 * For  mode,   value is 1.

(if|unless) data

 * Checks whether the targeted block, entity or storage has any data tag for a given path.


 * Syntax
 * – for data checking a block
 * – for data checking an entity
 * – for data checking a storage


 * Arguments
 * Option: '
 * Position of the block for data testing
 * Data path to check whether the block has
 * Option: '
 * A single entity for data testing
 * Data path to check whether the entity has
 * Option: '
 * The resource location of the storage for data testing
 * Data path to check whether the storage has
 * A single entity for data testing
 * Data path to check whether the entity has
 * Option: '
 * The resource location of the storage for data testing
 * Data path to check whether the storage has
 * Option: '
 * The resource location of the storage for data testing
 * Data path to check whether the storage has
 * Data path to check whether the storage has
 * Data path to check whether the storage has
 * Data path to check whether the storage has


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If  is unloaded or out of the world.
 * If block at  isn't a block entity.
 * If  fails to resolve to one or more valid entities (named players must be online).
 * If test doesn't pass.
 * When at the end of the subcommands chain, and the command is successful,  value is 1.
 * For  mode,   value is the number of matching data tags.
 * For  mode,   value is 1.

(if|unless) dimension

 * Checks if the execution is in a matching dimension.


 * Syntax


 * Arguments
 * Dimension to test for
 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If test doesn't pass.
 * When at the end of the subcommands chain, and the command is successful, both  value and   value are 1.
 * If test doesn't pass.
 * When at the end of the subcommands chain, and the command is successful, both  value and   value are 1.

(if|unless) entity

 * Checks whether one or more entities exist.


 * Syntax
 * Arguments
 * The target entity/ies to test for
 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If test doesn't pass.
 * $$, when at the end of the subcommands chain, and the command is successful,  value is 1.
 * For  mode,   value is the number of matching entities.
 * For  mode,   value is 1.
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If test doesn't pass.
 * $$, when at the end of the subcommands chain, and the command is successful,  value is 1.
 * For  mode,   value is the number of matching entities.
 * For  mode,   value is 1.

(if|unless) loaded

 * Checks if chunks at a given position is fully loaded (Entity Ticking).


 * Syntax
 * Arguments
 * Position to test
 * Position to test
 * Position to test


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If  is out of the world.
 * If test doesn't pass.
 * When at the end of the subcommands chain, and the command is successful, both  value and   value are 1.

(if|unless) predicate

 * Checks whether the predicate successes. See Predicate for more information.


 * Syntax
 * Arguments
 * The predicate to be checked whether it evaluates to a positive result
 * The predicate to be checked whether it evaluates to a positive result
 * The predicate to be checked whether it evaluates to a positive result


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * If the predicate doesn't exist.
 * If test doesn't pass.
 * When at the end of the subcommands chain, and the command is successful, the  value is 1, and the  value is either 0 or 1 depending on if the predicate passed.

(if|unless) score

 * Check whether a score has the specific relation to another score, or whether it is in a given range.


 * Syntax
 * – for comparing two scores
 * – for comparing one score against a range
 * - for comparing two scores
 * - for comparing one score against a range
 * - for comparing two scores
 * - for comparing one score against a range


 * Arguments
 * A single score holder
 * $$, It can also be quoted unique id to specified non-player entities in the objective.
 * The scoreboard objective to check under. The score of or  in this objective is checked
 * Option:   and  
 * Specifies a compare operator
 * Must be one of,  ,  ,  , and.
 * A single score holder to compare against
 * $$, It can also be quoted unique id to specified non-player entities in the objective.
 * A scoreboard objective. The score of  and  ''
 * Range to compare score against
 * Specifies a compare operator
 * Must be one of,  ,  ,  , and.
 * A single score holder to compare against
 * $$, It can also be quoted unique id to specified non-player entities in the objective.
 * A scoreboard objective. The score of  and  ''
 * Range to compare score against
 * A scoreboard objective. The score of  and  ''
 * Range to compare score against
 * Range to compare score against
 * Range to compare score against


 * Result
 * Unparseable if the argument is not specified correctly.
 * In following conditions, terminates when this subcommand is not at the end of the subcommands chain; fails when at the end:
 * $$, if  /   or   /   is.
 * If test doesn't pass.
 * $$, when at the end of the subcommands chain, and the command is successful, both  value and   value are 1.

Example

 * Kill all players standing on a wool:
 * Check whether scores A and B are equal:
 * Check whether scores A and B are equal:
 * Check whether scores A and B are equal:

Store subcommand
Store the final subcommand's  or   value somewhere. It is first processed along with other subcommands, recording the location to store in. After the last subcommand (may be a condition subcommand or a  subcommand) is executed, return values are stored in the recorded location. Note that the return values of commands must be an integer. If a decimal, it is rounded down.

There are five different modes of storage:
 * 1) store (result|success) block – Store return value under one of a block's NBTs
 * 2) store (result|success) bossbar – Store return value as a bossbar data
 * 3) store (result|success) entity – Store return value under one of an entity's NBTs
 * 4) store (result|success) score – Store return value under a target's score on an objective
 * 5) store (result|success) storage – Store return value under one of a storage's NBTs

store (result|success) block

 * Saves the final command's return value as tag data within a block entity. Store as a byte, short, int, long, float, or double. If the return value is a decimal, it is rounded first and then multiplied by.


 * Syntax


 * Arguments
 * Position of target block
 * Location of the desired tag to hold the value in
 * 
 * Desired data size/type
 * Must be one of,  ,  ,  ,  , and.
 * Multiplier to apply before storing value, may be negative
 * Must be one of,  ,  ,  ,  , and.
 * Multiplier to apply before storing value, may be negative
 * Multiplier to apply before storing value, may be negative


 * Result
 * Unparseable if the argument is not specified correctly.
 * Does not store anything when the path does not exist.

store (result|success) bossbar

 * Saves the final command's return value in either a bossbar's current value or its maximum value


 * Syntax
 * Arguments
 * ID of the bossbar to target for saving
 * (value
 * Whether to overwrite the bossbar's current value or its max value
 * Result
 * Unparseable if the argument is not specified correctly.
 * Result
 * Unparseable if the argument is not specified correctly.

store (result|success) entity

 * Save the final command's return value in one of an entity's data tags. Store as a byte, short, int, long, float, or double. If the return value is a decimal, it is rounded first and then multiplied by . Like the  command, "/execute store " cannot modify player NBT.


 * Syntax


 * Arguments
 * A single entity to store under
 * Location of the desired tag to hold the value in
 * 
 * Desired data size/type
 * Must be one of,  ,  ,  ,  , and.
 * Multiplier to apply before storing value, may be negative
 * Result
 * Unparseable if the argument is not specified correctly.
 * Does not store anything when the path does not exist.
 * Result
 * Unparseable if the argument is not specified correctly.
 * Does not store anything when the path does not exist.

store (result|success) score

 * Overrides the score held by  on the given   with the final command's return value.


 * Syntax


 * Arguments
 * Specifies score holder(s) whose score is to be overridden
 * A scoreboard objective
 * Result
 * Unparseable if the argument is not specified correctly.
 * Result
 * Unparseable if the argument is not specified correctly.

store (result|success) storage

 * Uses the within storage  to store the return value in. Store as a byte, short, int, long, float, or double. If the return value is a decimal, it is rounded first and then multiplied by . If the storage does not yet exist, it gets created.


 * Syntax


 * Arguments
 * (Single word)
 * Target storage container, as a resource location
 * Location of the desired tag to hold the value in
 * 
 * Desired data size/type
 * Must be one of,  ,  ,  ,  , and.
 * Multiplier to apply before storing value, may be negative
 * Multiplier to apply before storing value, may be negative
 * Multiplier to apply before storing value, may be negative


 * Result
 * Unparseable if the argument is not specified correctly.

Run subcommand
The command's single argument is the command to be executed, the context variables of which may be modified by the subcommands used.


 * Syntax


 * Arguments
 * Can be any command
 * Can be any command
 * Can be any command


 * Technical
 * Resets the command node to the root of the command dispatcher
 * Information on modelling commands as chat text:
 * The command dispatcher is what starts when the player begins a message with a forward-slash.
 * A command node is the specific word/entry the cursor is editing, either a command or an argument.
 * The root node comes before the first word in the current command.


 * Result
 * Execute this command. Fails if  or   is failure.

More examples

 * Teleport all players who have an item enchanted with Efficiency in their first hotbar slot to coordinates (0, 64, 0):
 * Create a smoke particle three blocks in front of all players:
 * Place a saddle on pigs located within 5 blocks of the executing player, and remove saddles from pigs located over 5 blocks away from the executing player:
 * Make a player say "My feet are soaked!" in chat if they are located in a block of water:
 * Make a player say "Score is reset" in chat if the score 'test' is not set, eg by doing "scoreboard players reset @s test":
 * Hurl all pigs skyward who are within 3 blocks of the nearest player:
 * Kill all zombies who have no headgear:
 * Make a player say "Score is reset" in chat if the score 'test' is not set, eg by doing "scoreboard players reset @s test":
 * Hurl all pigs skyward who are within 3 blocks of the nearest player:
 * Kill all zombies who have no headgear:
 * Hurl all pigs skyward who are within 3 blocks of the nearest player:
 * Kill all zombies who have no headgear:
 * Kill all zombies who have no headgear: