


In Java Edition, these arguments limit the search of entities to the current dimension. In Bedrock Edition, tilde notation is available for selector argument coordinates. The positional components are doubles, allowing for values like +12.34, and they are not center-corrected, meaning x=0 is not corrected to x=0.5. Cannot duplicate any one of these three arguments. Using these arguments alone will not restrict the entities found, and will only affect the sorting of targets. Position arguments - Define a position in the world the selector starts at, for use with the distance argument, the volume arguments, or the limit argument. (In other words, they are AND-ed together). If there are multiple argument-value pairs, they all must be satisfied to add a potential target to the group. Commas must be used to separate argument-value pairs.

Spaces are allowed around the brackets, equal signs, and commas, except in Java Edition between the target variable and the first bracket. When used with the player using the command is targeted only if they would be in the narrowed group.Īrgument-value pairs appear within square brackets after the target selector variable, separated by Java Edition, arguments and values are case-sensitive. When used with or the nearest or random player is selected from the group.

COMMAND E IN BRACKETS FULL
When used with or arguments narrow down the targets from the full list to a specific group. Target selector arguments Summary of target selector argumentsĪfter a target selector, optional arguments can be used to narrow down the set of targets to a group that also matches certain criteria. Targets the player who interacts with a button in a JSON NPC dialogue. Works only if more than one agent exists. It does not target anything if the command was run by a command block or server console. Targets the entity (alive or not) that executed the command. Targets all alive entities (including players) in loaded chunks. In Bedrock Edition, can only target entities who are alive. Bedrock Edition can use to target non-player entities via the type selector argument in Java Edition, to select a random entity, use instead. In Bedrock Edition, only targets players who are alive. If there are multiple nearest players, caused by them being precisely the same distance away, the player who most recently joined the server is selected. There are five (six in Bedrock Edition, eight in Education Edition) Targets the nearest player from the command's execution. gamemode creative Target selector variables Summary of target selector executing the player's agent Ī target selector variable identifies the broad category of targets to select. One or more entities can be selected with a target selector variable, and targets can be filtered from the selection based on certain criteria using the target selector arguments.įor example, to change the game mode of all players to Creative mode, instead of specifying each of them by name individually: If this is null (the default), this condition is disabled.Target selectors are used in commands to select players and entities arbitrarily, without needing to specify an exact player name or a UUID. If this is 0, this condition will act the same as the option "always".
