author | ms.author | ms.service | title | description |
---|---|---|---|---|
jakeshirley |
jashir |
minecraft-bedrock-edition |
execute Command |
Description and usage of the execute command |
Executes a command on behalf of one or more entities. See more information in the Popular Commands page and the New Execute Syntax page.
Permission Level | Game Directors |
---|---|
Requires Cheats? | Yes |
/execute in <dimension: Dimension> <chainedCommand: executechainedoption_0>
Executes a command using the context of an entity returned by the chosen selector.
/execute positioned <position: x y z> <chainedCommand: executechainedoption_0>
Executes a command from the position of an entity returned via the selection.
/execute positioned as <origin: target> <chainedCommand: executechainedoption_0>
Executes a command within a particular dimension.
/execute rotated <yaw: rotation> <pitch: rotation> <chainedCommand: executechainedoption_0>
Execute a given command from a position
and specified origin
target, while checking for a specific block
and block id.
/execute rotated as <origin: target> <chainedCommand: executechainedoption_0>
Execute a given command from a position
and specified origin
target.
/execute facing <position: x y z> <chainedCommand: executechainedoption_0>
Runs a command with the specified rotation as yaw and pitch.
/execute facing entity <origin: target> <anchor: ActorLocation> <chainedCommand: executechainedoption_0>
Runs a command using the rotation from another entity as specified by the selector
/execute align <axes: string> <chainedCommand: executechainedoption_0>
Runs a command with an entity facing a particular direction.
/execute anchored <anchored: ActorLocation> <chainedCommand: executechainedoption_0>
Runs a command with a contextual facing to another entity that is returned by a selection.
/execute <subcommand: Option_If_Unless> block <position: x y z> <block: Block> [chainedCommand: executechainedoption_0]
Runs a command where positions are aligned (floored) to block axes
/execute <subcommand: Option_If_Unless> block <position: x y z> <block: Block> <blockStates: block properties> [chainedCommand: executechainedoption_0]
Runs a command with a position anchored to a specific location - e.g., the toes or eyes - for an entity
/execute <subcommand: Option_If_Unless> blocks <begin: x y z> <end: x y z> <destination: x y z> <scan mode: BlocksScanMode> [chainedCommand: executechainedoption_0]
Runs a command if or unless there is a block at a position of a particular type
/execute <subcommand: Option_If_Unless> entity <target: target> [chainedCommand: executechainedoption_0]
Runs a command with if or unless there is a block with a set of block states that matches the specified set.
/execute <subcommand: Option_If_Unless> score <target: target> <objective: ScoreboardObjectives> <operation: compareoperator> <source: target> <objective: ScoreboardObjectives> [chainedCommand: executechainedoption_0]
/execute <subcommand: Option_If_Unless> score <target: target> <objective: ScoreboardObjectives> matches <range: fullintegerrange> [chainedCommand: executechainedoption_0]
Runs a command if a particular set of blocks in a volume matches the scan mode criteria
/execute run <command: codebuilderargs>
Runs a command if (or unless) a selector returns at least one matching entity.
anchor
: ActorLocationanchored
: ActorLocationaxes
: stringbegin: x y z
: positionblock
: Block Compares block to a given blockid
.blockStates
: block propertieschainedCommand
: executechainedoption_0command
: codebuilderargs Astring
of the command to run. Must be a valid command.destination: x y z
: positiondimension
: Dimensionend: x y z
: positionobjective
: ScoreboardObjectivesoperation
: compareoperatororigin
: target The target of the command to execute. Must be a player name or target selector.pitch
: rotation Up-and-down rotation of the commandposition: x y z
: position Avector
of where to run the command from.range
: fullintegerrangescan mode
: BlocksScanModesource
: targetsubcommand
: Option_If_Unlesstarget
: targetyaw
: rotation Left-to-right rotation context of the command
Specifies where on the selected entity to look at.
eyes
feet
For a blocks condition, specifies how to look for blocks.
masked
all
Specifies a dimension to run the command within.
overworld
nether
the_end
Specifies an additional condition to run this command within
if
unless