Commands

Commands, in the Java Edition and Pocket Edition, are advanced features activated by typing certain strings of text.

Usage
In a regular Minecraft client or the stand alone client, commands are entered via Minecraft's chat window, which is displayed by pressing the key (default) or  key. Using the key will also enter the forward slash that commands require as a prefix, so it is a useful shortcut. The and  key can be used to enter the previously executed command. Pressing while entering commands cycles through possible commands or arguments, and can be used to auto-enter the coordinates of the block looked at before entering chat.

Commands may also be entered in a multiplayer server's console, but are not preceded by a when entered this way. A server admin running commands in this way is often referred to as "ghosting".

Commands in command blocks can be preceded by a slash, but it is not required. Commands in a command block usually also require an optional argument, like a player's username.

The majority of commands are only available in the following situations:


 * In a Minecraft multiplayer server game, entered by an operator or command block.
 * In other multiplayer games, entered by the player who opened a LAN game with cheats enabled, or is hosting their own multiplayer server
 * In singleplayer, if cheats were enabled at world creation (via the "More World Options..." button).

Some player commands are also available in singleplayer even when cheats are not enabled.

Note: In singleplayer worlds where cheats were not enabled at creation, they can be enabled on a temporary basis by opening the current game session to LAN play ( → "Open to LAN", then "Allow Cheats" button and "Start LAN World"). You do not actually need to be on a LAN or have others join. This is not permanent, but will allow the use of commands until you quit the world, and changes you make via commands (items spawned, etc.) will be saved with the world. You can do this each time you start playing the world again. Note that this will disable game pausing for the duration, so while open to LAN, you should get somewhere safe or reload your world before using the Game Menu. Remember that you can disable your LAN world by reloading the world.

Tilde notation
Many commands allow relative coordinates to be specified using tildes. A number following a tilde is an offset from something rather than a coordinate. The sign of the offset specifies whether to go in the positive or negative direction for that axis. A single tilde by itself is shorthand for.

For example, will teleport the user to the coordinate (0, 64, 0), while  will teleport the user to a position +3 blocks in the "x" direction (i.e., east), keep their current height, and -3 blocks in the "z" direction (i.e., north).

Usually absolute coordinates can be mixed with relative coordinates. For example, will keep the user's "x" and "z" coordinates the same, but teleport them to absolute height of 64.

The origin for the offset depends on the command. For example, in the offset is from the target's starting position. Other common offsets include from the position of the command's execution or from another coordinate specified by the command.

Target selectors
In most commands where a player may be specified as an argument, it is possible to "target" one or more players satisfying certain conditions instead of specifying players by name. To target players by condition, choose a target selector variable and, optionally, one or more target selector arguments to modify the conditions to be satisfied.

For example, to change the game mode of all players on team Red to creative mode, instead of specifying them by name individually:

Target selector variables
A target selector variable identifies the broad category of targets to select. There are five variables:




 * Targets the nearest player. When run by the console, the origin of selection will be at (0, 0, 0). 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.


 * Target selector arguments may be used to reduce the set of players from which the nearest player will be selected. For example,  will target the nearest player on team Red even if there are other players closer.


 * The  target selector argument can be used to increase the number of nearest players targeted (for example,   will target the three nearest players). When negative,   will reverse the order of targeting (for example,   will target the farthest player).




 * Targets a random player (or entity with the  target selector argument).


 * Target selector arguments may be used to reduce the set of players from which a random player will be targeted. For example,  will only target a random player from team Red.


 * The  target selector argument can be used to increase the number of random players targeted. For example,   will target three random players.


 * When used without the  argument,   always targets a random player. The   argument can be used to target non-player entities (for example,   will target a random zombie,   will target a random non-player entity,   will target a random non-zombie, etc.).




 * Targets all players, including dead players. No other selector will find dead players, except.


 * Target selector arguments may be used to reduce the set of players targeted. For example,  will only target players on team Red.




 * Targets all entities (including players).


 * Target selector arguments may be used to reduce the set of entities targeted. For example,  will only target cows.




 * Targets only one entity: the entity that executed the command, including dead players. If the executor was not an entity, for instance if the executor was a command block or a server console, this selector will find nothing.


 * Target selector arguments may be used to specify whether the executor is actually eligible to be targeted. For example,   will only target the executor of the command, if the executor was a cow on team Red.

Target selector arguments
After using a target selector, you can optionally use arguments to modify the set of targets selected. When used with  or , arguments narrow down the number of targets from the full list to a specific few. When used with  or , arguments narrow the number of targets down from the full list to a smaller set from which the nearest or random player is selected.

Add argument-value pairs as a comma-separated list contained within square brackets after the target selector variable:



Arguments and values are case-sensitive. Spaces are not allowed around the brackets, equal signs, or commas, and only commas may be used to separate argument-value pairs.


 * Selecting targets by coordinate


 * — Selects targets based on distance to that exact position. Combine with selecting by radius to select only targets at that specific position.


 * The coordinates have to be integers and must be exact - tilde notation is not available for selector argument coordinates.


 * Selecting targets by radius


 * — Selects only targets less than R blocks from the command's execution. Using a value under 0 restricts the targets to the same dimension the command was run from without applying a restriction on distance from the location of execution.
 * — Selects only targets more than RM blocks from the command's execution.


 * If a coordinate (above) and either or both radius/i are both defined, the radius/i will center on the coordinate rather than the postion of the command's execution.


 * Selecting targets by volume




 * Selects only targets within the volume defined as starting from the location where the command was executed and extending DX blocks in the "x" direction (i.e., east/west), DY blocks in the "y" direction (i.e., upwards/downwards), and DZ blocks in the "z" direction (i.e., north/south). If an initial coordinate is specified with the,  , and   arguments, that will be used instead of the position of the command's execution for the lower northwestern corner ( ,  , and   still specify distances from that coordinate; they do not specify a separate coordinate).


 * It is possible to combine selection by radius and selection by volume, in which case the command will only select targets within the overlap of both regions (within certain radius/i of the volume's lower northwest corner and not outside the defined volume).


 * Selecting targets by score


 * — Selects only targets with a score in objective name of no more than SCORE.


 * — Selects only targets with a score in objective name of no less than SCOREMIN.


 * For example,  will select all players with a score in objective "points" between 30 and 39 (inclusive).


 * Selecting targets by tag


 * — Selects only targets that have been given the scoreboard tag TAG.
 * — Selects only targets that have not been given the scoreboard tag TAG.
 * — Selects only targets without any scoreboard tags.
 * — Selects only targets with any scoreboard tags.


 * Selecting targets by team


 * — Selects only targets on team TEAM.


 * — Selects only targets not on team TEAM.


 * — Selects only targets not on any team.


 * — Selects only targets on any team.


 * Selecting targets by count


 * — Selects only the specified number of targets. Usually in order of distance from the command executor.


 * When used with  or , this argument defaults to 1, so using a higher number will increase the number of nearest or random targets returned. When used with   or  , this argument returns only the nearest targets.


 * If there are multiple nearest targets, caused by them being precisely the same distance away, targets are sorted by the time they have been on the server (since their most recent join for players or their creation for other entities) with the longest times selected first. For example, if equally distant,  will select the player who has been on the server the longest and   will select the three oldest creepers.


 * When used with a negative value, the order of targets is reversed. For example,  will return the three farthest targets, and, if all potential targets are equally far away,   will select the last three targets created.


 * Selecting targets by experience level


 * — Selects only targets with no more than L experience levels.


 * – Selects only targets with no less than LM experience levels.
 * This automatically filters out all non-player targets.


 * Selecting targets by game mode


 * — Selects only targets on the specified game mode.
 * — Selects only targets that are not on the specified game mode.
 * Permitted values for M are:
 * : all game modes
 * ,,  : survival mode
 * ,,  : creative mode
 * ,,  : adventure mode
 * ,,  : spectator mode
 * This automatically filters out all non-player targets.


 * Selecting targets by name


 * — Selects only targets named NAME.


 * — Selects only targets not named NAME.


 * Selecting targets by vertical rotation


 * — Selects only targets with a maximum vertical rotation of RX.
 * — Selects only targets with a minimum vertical rotation of RXM.


 * Vertical rotation values vary from 270 facing straight up, increasing to 359 just above horizontal, then 0 at horizontal increasing to 90 facing straight down (thus vertical rotation values increase with rotation downwards).


 * Selecting targets by horizontal rotation


 * — Selects only targets with a maximum horizontal rotation of RY.
 * — Selects only targets with a minimum horizontal rotation of RYM.


 * Horizontal rotation values vary from -180 (facing due north), to -90 (facing due east), to 0 (facing due south), to 90 (facing due west), to 180 (just west of due north) before wrapping back to -180 (thus horizontal rotation values increase with rotation to the right, or clockwise viewed from above).


 * Selecting targets by type


 * — Selects only targets of the specific entity type.
 * — Selects only targets not of the specific entity type.


 * TYPE must be an entity ID used to identify different types of entities internally (for example,  for creepers,   for regular minecarts,   for primed TNT, etc.). Entity IDs are case-sensitive and invalid entity IDs will cause the command to fail.


 * When used with, can change its normal behavior of targeting only players to target other entities.

Data tags
A data tag is a sequence of text which describes a data structure using attribute-value pairs. Data tags are used in Java Edition commands to specify complex data for players, entities, and some blocks.

A data tag consists of zero or more attribute-value pairs separated by commas and delineated by curly brackets. Each attribute-value pair consists of an attribute name and the attribute's value, separated by a colon. Some values, however, may themselves contain attribute-value pairs, allowing a data tag to describe a hierarchical data structure.


 * Example:

The data structures that data tags describe are the same ones used in Minecraft's save files. These data structures are described in other articles and commands expect data tags to use the same attribute names (which are case-sensitive):

The defined data structures also expect the values to be of the correct type.

The type is unavailable to commands.

Some commands may require that a number's type be specified by adding a letter (B, S, L, F, D) to the end of the value. For example,  for a short,   for a float, etc. (This doesn't work with I for int.) The letter can be uppercase or lowercase. When no letter is used and Minecraft can't tell the type from context, it assumes double (if there's a decimal point), int (if there's no decimal point and the number is small enough to store as an int), or string (if neither is true). A square-bracketed literal is assumed to be an int array if every element that's between commas is an int; otherwise, it is assumed to be a list. An exception applies:  is an empty list, but   is an empty int array.

When commands such as, , and are used to match data tags, they only check for the presence of the provided tags in the target entity/block/item. This means that the entity/block/item may have additional tags and will still match. This is true even for lists and arrays: the order of a list is not acknowledged, and as long as every requested element is in the list, it will match even if there are additional elements.

The format used for data tags is a lenient form of JSON.

Raw JSON text
The and  commands use strict JSON syntax.

Scores and target selectors are evaluated for a Sign when it is placed or edited and for a Written Book when it is "resolved" (opened for the first time after signing). They won't update after that, and they won't work if edited onto an existing sign with an NBT editor, or onto a book that's already marked resolved. There's no way to wrap text onto the next line of a sign or the next page of a book during resolution; instead, the extra text will simply disappear.

The format of raw JSON text is a JSON Object which supports the following (mostly optional) elements:
 * The base chat component Object
 * : A string representing raw text to display directly in chat. Note that selectors such as "@a" and "@p" are not translated into player names; use selector instead. "\n" is newline (enter).
 * : A string that can be used to display the key needed to preform a certain action. An example is  which will always display "E" unless the player has set a different key for opening their inventory.
 * : A list of additional objects, sharing the same format as the base object.
 * A list element with the same format as the base object (recursive). Note that all properties of this object are inherited by children except for text, extra, translate, with, and score. This means that children will retain the same formatting and events as this object unless they explicitly override them.
 * : The color to render this text in. Valid values are "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white", and "reset" (cancels out the effects of colors used by parent objects). Technically, "bold", "underline", "italic", "strikethrough", and "obfuscated" are also accepted, but it may be better practice to use the tags below for such formats.
 * : Boolean (true/false) - whether to render text in bold. Defaults to false.
 * : Boolean (true/false) - whether to render text underlined. Defaults to false.
 * : Boolean (true/false) - whether to render text in italics. Defaults to false.
 * : Boolean (true/false) - whether to render text with a strikethrough. Defaults to false.
 * : Boolean (true/false) - whether to render text obfuscated. Defaults to false.
 * : When the text is shift-clicked by a player, this string will be inserted in their chat input. It will not overwrite any existing text the player was writing.
 * : Allows for events to occur when the player clicks on text.
 * : The action to perform when clicked. Valid values are "open_url" (opens value as a URL in the player's default web browser), "open_file" (opens the value file on the user's computer), "twitch_user_info" (opens info about a twitch user), "run_command" (has value entered in chat as though the player typed it themselves. This can be used to run commands, but the command will fail if the player does not have the required permissions to use it), "change_page" (can only be used in written books) changes to page value if that page exists, and "suggest_command" (similar to "run_command", but the text only appears in the player's chat input, and is not automatically entered. Unlike insertion, this will replace the existing contents of the chat input). "open_file" and "twitch_user_info" are used in messages automatically generated by the game (e.g. on taking a screenshot) and cannot be used in commands or signs.
 * : The URL, file, twitch user, chat, command or book page used by the specified action. Note that commands must be prefixed with the usual "/" slash.
 * : Allows for a tooltip to be displayed when the player hovers their mouse over text.
 * : The type of tooltip to show. Valid values are "show_text" (shows raw JSON text), "show_item" (shows the tooltip of an item which can have NBT tags), "show_achievement" (shows formatted text describing an achievement or statistic. Normal achievement names are green, final achievement names are dark_purple, and statistic names are gray. In addition, a description is given for achievements), and "show_entity" (shows an entity's name, possibly its type, and its UUID).
 * : The formatting of this tag varies depending on the action. Note that "show_text" is the only action to support an Object as the value; all other action values are Strings and should thus be wrapped in quotes.
 * "show_text": Can be either a raw String of text, or an Object with the same formatting as this base object. Note that clickEvent and hoverEvent do not function within the tooltip, but the formatting and extra tags still work.
 * "show_item": A string formatted like item NBT data. Contains the "id" tag, and optionally the "Damage" tag and "tag" tag (which is the same compound used as "dataTag" in the command).
 * "show_achievement": The achievement or statistic's name. This uses the same format as achievement and statistic Scoreboard objective criteria and the command.
 * "show_entity": A string formatted like a compound with the string values "type" (such as "Zombie"), "name", and "id" (should be an entity UUID, but can actually be any string).
 * : The translation identifier of text to be displayed using the player's selected language. This identifier is the same as the identifiers found in lang files from assets or resource packs. The translated text will only be displayed if the text string is not used.
 * : A list of chat component arguments and/or string arguments to be used by translate.
 * The arguments are text corresponding to the arguments used by the translation string in the current language, in order (for example, the first list element corresponds to "%1$s" in a translation string).
 * : A player's score in an objective. Displays nothing if the player is not tracked in the given objective. Ignored completely if text or translate is present.
 * : The name of the player whose score should be displayed. Selectors (such as @p) can be used, in addition to "fake" player names created by the scoreboard system. In addition, if the name is "*", it will show the reader's own score (for example,  will show every online player their own score in the "obj" objective).
 * : The internal name of the objective to display the player's score in.
 * : Optional. If present, this value is used regardless of what the score would have been.
 * : A string containing a selector (@p,@a,@r, or @e) and, optionally, selector arguments. Unlike text, the selector will be translated into the correct player/entity names. If more than one player/entity is detected by the selector, it will be displayed in a form such as 'Name1 and Name2' or 'Name1, Name2, Name3, and Name4'. Ignored completely if text, translate, or score is present. Clicking a player's name inserted into a /tellraw command this way will suggest a command to whisper to that player. Shift-clicking a player's name will insert that name into chat. Shift-clicking a non-player entity's name will insert its UUID into chat.

Due to the extra tag, the above format may be recursively nested to produce very complex and functional text strings. However, a raw json text doesn't have to be complicated at all: virtually all properties are optional and may be left out.

To be valid, each object must have at least either text, translate, score or selector (everything else is optional). As a matter of shorthand, however, the entire Object may be substituted with a String. In this case, that string will be considered the value of the text property. For example,  is equivalent to. This shorthand substitution is valid anywhere a raw text object is required (including the base  argument of, the elements of the extra list, and the value of a "show_text" hover_event).

/tellraw also accepts an array of objects and/or strings; they are concatenated. It even accepts a tree of nested arrays; they are traversed depth-first. For example:

/tellraw @a ["Hello there, ",{"selector":"@p"},"."] /tellraw @a [["The "],[["quick ","brown "],[{"selector":"@p"}," jumps "],"over "],"the "],["lazy ","dog."]

Finally, unlike other commands using JSON, Strings support Unicode via the notation , where #### is the Unicode hexadecimal number for the desired character.


 * External links


 * Skylinerw's JSON Text Component
 * Tellraw Generator
 * List of all Keybinds
 * Zofenia Component Editor

Block/item names
Many commands have arguments that identify particular types of blocks or items. In the command syntax below these typically appear as elements named,  , or the like which are replaced with identifiers such as   in the examples. In the Java edition, these identifiers are namespaced and all have the " " prefix; in Pocket Edition this prefix must be omitted.

Summary of commands
The table below summarizes available commands. Click a column heading to sort by that column.

Command Guide

 * Syntax


 * {| class="wikitable" style="text-align:center" data-description="Syntax"

! If you see… !! Then Pick one of the options shown.
 * plain text || Enter this literally, exactly as shown.
 * italics || Replace this with an appropriate value.
 *  || This is a required argument.
 * [square brackets] || This is an optional argument.
 * x | y
 *  || This is a required argument.
 * [square brackets] || This is an optional argument.
 * x | y
 * x | y
 * x | y

Available options are shown separated by vertical bars: |
 * ellipsis … || The argument may consist of multiple words separated by spaces.
 * x: int || The argument consist of numbers.
 * y: string || The argument consist of multiple words and could have separated by spaces.
 * }
 * y: string || The argument consist of multiple words and could have separated by spaces.
 * }
 * }


 * Success Conditions


 * A command's Success Conditions must be met in order for the game to consider the command "successful". This is used to determine a variety of things, such as the output of a redstone comparator feeding from command block with a command. Note that not all "successful" commands actually do something, and not all "failed" commands fail to do something useful.


 * Restrictions


 * Describes restrictions on who can use the command or in what context.


 * None: The command can be used by any player in any world. The following commands have no restrictions:, , , and.


 * Operator: The command may only be used by an operator or in singleplayer mode with cheats enabled. On multiplayer servers, the results of these commands are broadcast to other ops online.


 * Multiplayer: The command is only available on a multiplayer server. The following commands are restricted to multiplayer servers:, , , , , , , , , , , , , ,.
 * No multiplayer commands permit target selectors in arguments.
 * Except for, multiplayer commands cannot be used in command blocks.
 * Many of these commands can be used on players who have never been to the server, or even on names which are not (or cannot be) registered as Minecraft accounts.


 * No command blocks: The command cannot be executed by a command block.

Education Edition commands
List of Education Edition commands, some information were taken from Code Connection API.pdf and at the program folder of Minecraft: Windows 10 Edition.

ability
Grants or revokes player with a specific ability.


 * Syntax




 * Arguments


 * player: target
 * Specifies the target to grant/revoke player ability. Must be a player name or target selector.


 * ability: string
 * Specifies the player ability.
 * Must be one of:
 * for ability to become a World Builder.
 * for ability to fly.


 * value: bool
 * Specifies the value to set the ability to, must in between  or.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, grants/revokes the player ability into the specified ability.

clearfixedinv
Clears fixed inventory slots.


 * Syntax




 * Result


 * Fails if there are no fixed inventory slots available.
 * On success, fixed inventory slots cleared successfully.

executeasother
Executes another command as the specified target.


 * Syntax




 * Arguments


 * origin: target
 * Specifies the target to be the command's executor. Must be a player name or target selector. If more than one entity is selected, the command will be run once as each of them.


 * position: x y z
 * Specifies the position from which to run the command. x and z must be within the range -30,000,000 to 30,000,000 (inclusive). Coordinates specified with tilde notation are relative to the target, not to the position of the command's execution.


 * command: string
 * Specifies the command to be run. Must be a valid command.


 * Result


 * Fails if ...
 * On success, ...

executeasself
Similar to, but executes the command to the executor.


 * Syntax




 * Arguments


 * command: rawText
 * Specifies the command to be run. Must be a valid command.


 * Result


 * Fails if ...
 * On success, ...

getchunkdata
Gets pixels for a specific chunk.


 * Syntax




 * Arguments


 * dimension: string
 * The dimension name.


 * chunkX: int
 * Specifies the coordinates of the chunk in X-axis.


 * chunkZ: int
 * Specifies the coordinates of the chunk in Z-axis.


 * height: int
 * Specifies the height of the chunk.


 * Result


 * Unknown

getchunks

 * Syntax



geteduclientinfo

 * Syntax



getspawnpoint

 * Syntax




 * Arguments


 * player: target
 * Specifies the target to get the player spawn point. Must be a player name or target selector.


 * Result


 * Fails if ...
 * On success, ...

globalpause
Sets or gets the paused state of the game for all players.


 * Syntax




 * Arguments


 * isPaused: bool
 * Specifies the value to pause the world, must in between  or.


 * Result


 * Fails if ...
 * On success, ...

immutableworld
Toggles the world to be able altered or cannot be altered.


 * Syntax




 * Arguments


 * value: bool (optional)
 * Specifies the value to set the world to be able altered, must in between  or.


 * Result


 * Fails if ...
 * On success, if  the world cannot be altered, but doors, levers, etc. can still be used, and vice versa if set to.

querytarget
Gets transform, name, and id information about the given target entity or entities.


 * Syntax




 * Arguments


 * victim: target
 * Specifies the targets. Must be one or more player names and/or [#Target selectors|target selectors] separated by spaces ( is permitted to target entities other than players).


 * Result


 * Fails if ...
 * On success, ...

setfixedinvslot
Sets fixed inventory slot with a specific item.


 * Syntax




 * Arguments


 * fixedinvslotnum: int
 * Specifies the number of fixed inventory slot.


 * itemName: string
 * Specifies the item for the fixed slot. Must be a valid item id (for example, ), or block id for which items exist.


 * data: int (optional)
 * Specifies the item data of the item. Must be an integer between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values which are invalid for the specified item id revert to 0. If not specified, defaults to 0.


 * Result


 * Fails if arguments are not specified correctly.
 * On success, players are given the specified items in the fixed inventory slot.

setfixedinvslots
Sets the amount of fixed inventory slots.


 * Syntax




 * Arguments


 * fixedinvslotnum: int
 * Specifies the amount of fixed inventory slots, up into three slots.


 * Result


 * Fails if the argument is empty, or not specified correctly.
 * On success, players grant fixed slots with the specified amount.

worldbuilder
Toggles the World Builder ability to enable or disable alternately.


 * Syntax






 * Result


 * Fails if the player does not have permission to become a World Builder.
 * On success, player switch the World Builder ability alternately.

attack
Attacks in the direction specified.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to attack.
 * Must be one of:
 * to attack forward.
 * to attack backward.
 * to attack leftward.
 * to attack rightward.
 * to attack upward.
 * to attack downward.


 * Result


 * Always success, Agent attacks in the specified direction by attack damage.

collect
Collects all items within a one block from Agent in three dimensions.


 * Syntax




 * Arguments


 * Specifies the item to be collected on the block to the Agent's inventory. Must be an item id, or a block id for which an item exists (for example, ).


 * Result


 * Fails if the arguments are not specified correctly or no items of the same name were collected.
 * On success, returns if any items of the same name were collected.

createagent
Creates Agent on the current player position.


 * Syntax




 * Result


 * Always success, Agent created succesfully.

destroy
Destroys block or item in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to destroy.
 * Must be one of:
 * to destroy block/item on the front.
 * to destroy block/item on the back.
 * to destroy block/item on the left-hand side.
 * to destroy block/item on the right-hand side.
 * to destroy block/item on the top-hand side.
 * to destroy block/item on the bottom-hand side.


 * Result


 * Fails if the block was unbreakable or a non-solid block.
 * On success, Agent destroys the block/item by one hit as expected.

detect
Detects if there is a collidable block in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to detect a collidable block.
 * Must be one of:
 * to detect the block on the front.
 * to detect the block on the back.
 * to detect the block on the left-hand side.
 * to detect the block on the right-hand side.
 * to detect the block on the top-hand side.
 * to detect the block on the bottom-hand side.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns if there was a collidable block in the specified direction.

detectredstone
Detects redstone signal in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to detect a redstone signal.
 * Must be one of:
 * to detect the block on the front.
 * to detect the block on the back.
 * to detect the block on the left-hand side.
 * to detect the block on the right-hand side.
 * to detect the block on the top-hand side.
 * to detect the block on the bottom-hand side.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns if the object in the specified direction received a redstone signal at that moment.

drop
Drops the given number of items from the specified inventory slot onto the ground by one block in the specified direction.


 * Syntax




 * Arguments


 * slotNum: int
 * Specifies the slot number to drop, slots are numbered from 1 to 27.


 * quantity: int
 * Specifies the number of items to be dropped from the Agent's inventory slot. Must be between 1 and 64.


 * direction: string
 * Specifies the direction of Agent to drop the item(s).
 * Must be one of:
 * to drop item(s) to the front.
 * to drop item(s) to the back.
 * to drop item(s) to the left.
 * to drop item(s) to the right.


 * Result


 * Fails if the arguments are not specified correctly or the slot was empty.
 * On success, returns if items were dropped onto the ground in the direction specified.

dropall
Drops all items from all slots onto the ground by one block in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to drop all the items.
 * Must be one of:
 * to drop items to the front.
 * to drop items to the back.
 * to drop items to the left.
 * to drop items to the right.


 * Result


 * Fails if the arguments are not specified correctly or the Agent's inventory was empty.
 * On success, returns if all items were dropped onto the ground in the direction specified.

getitemcount
Returns the number of items in the specified slot, as in how many the player could use before it would be empty.


 * Syntax




 * Arguments


 * slotNum: int
 * Specifies the slot number of items to be counted, slots are numbered from 1 to 27.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns the number of item in the specified slot. See block ids for the complete list.

getitemdetail
Returns the name of the item in the specified slot.


 * Syntax




 * Arguments


 * slotNum: int
 * Specifies the slot number of items to be counted, slots are numbered from 1 to 27.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns the form of the item in the specified slot. See block id for the complete list.

getitemspace
Returns the number of spaces remaining in the specified slot, as in the number of items you could add before it would be full.


 * Syntax




 * Arguments


 * slotNum: int
 * Specifies the slot number of items to be counted, slots are numbered from 1 to 27.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns the remaining number of the item in the specified slot.

inspect
Returns the name of the block in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to verify the name of the block.
 * Must be one of:
 * to inspect the block on the front.
 * to inspect the block on the back.
 * to inspect the block on the left-hand side.
 * to inpect the block on the right-hand side.
 * to inspect the block on the top-hand side.
 * to inspect the block on the bottom-hand side.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns the form of the block in the specified direction. See block id for the complete list.

inspectdata
Returns the data value of the block in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to verify the data value of the block.
 * Must be one of:
 * to inspect the block on the front.
 * to inspect the block on the back.
 * to inspect the block on the left-hand side.
 * to inpect the block on the right-hand side.
 * to inspect the block on the top-hand side.
 * to inspect the block on the bottom-hand side.


 * Result


 * Fails if the arguments are not specified correctly.
 * On success, returns the data value of the block in the specified direction. See block id for the complete list.

move
Moves Agent in specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to move.
 * Must be one of:
 * to move Agent forward.
 * to move Agent backward.
 * to move Agent leftward.
 * to move Agent rightward.
 * to move Agent upward.
 * to move Agent downward.


 * Result


 * Fails if the specified direction is blocked by a block.
 * On success, Agent moved in the direction specified by one block.

place
Right-clicks on the block in the specified direction.


 * Syntax




 * Arguments


 * slotNum: int
 * Specifies the slot number of block to be placed, slots are numbered from 1 to 27.


 * direction: string
 * Specifies the direction of Agent to place the block.
 * Must be one of:
 * to place the block on the front.
 * to place the block on the back.
 * to place the block on the left-hand side.
 * to place the block on the right-hand side.
 * to place the block on the top-hand side.
 * to place the block on the bottom-hand side.


 * Result


 * Fails if the arguments are not specified correctly or the specified slot was empty.
 * On success, returns if a block in the specified inventory slot was placed.


 * Note


 * This basically places a block (ex: Place Stone Block) or a placeable item (ex: Place Oak Fence) from the selected inventory slot in the specified direction.
 * However, this doesn’t interact with things like doors, levers, and containers.
 * Additionally, when player specifies a slot which contains the following non-place-able items, this behaves as follows:
 * Place water/lava
 * Bucket
 * Till grass
 * Hoe
 * Make a path
 * Shovel
 * Spawn a mob
 * Spawn Eggs
 * Dye something
 * Dyes
 * Make a fire
 * Flint and Steel
 * Fire Charge
 * Placeable material
 * Boat
 * Minecart
 * Bottle

till
Tills grass in the specified direction.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to till the block.
 * Must be one of:
 * to till the block on the front.
 * to till the block on the back.
 * to till the block on the left-hand side.
 * to till the block on the right-hand side.
 * to till the block on the top-hand side.
 * to till the block on the bottom-hand side.


 * Result


 * Fails if the arguments are not specified correctly or there is no till-able block in the specified direction.
 * On success, returns if any till-able block was turned into farmland in the specified direction.

tpagent
Teleport player to the Agent's position.


 * Syntax




 * Result


 * Fails if there is no Agent existed.
 * On success, player teleported to Agent successfully.

transfer
Transfers specified quantity of items from the selected slot to another specified slot of Agent's inventory.


 * Syntax




 * Arguments


 * srcSlotNum: int
 * Specifies the source of slot number to be transferred, slots are numbered from 1 to 27.


 * quantity: int
 * Specifies the number of items to be transferred from the Agent's inventory slot.


 * srcSlotNum: int
 * Specifies the destination of slot number to be transferred, slots are numbered from 1 to 27.


 * Result


 * Fails if the arguments are not specified correctly, or returns false if the destination already has items of a different type, and if the source slot was empty.
 * On success, returns true if there was a room for the items to be transferred.

turn
Rotate Agent in the specified direction by 90 degrees.


 * Syntax




 * Arguments


 * direction: string
 * Specifies the direction of Agent to rotate.
 * Must be one of:
 * to rotate Agent leftward.
 * to rotate Agent rightward.


 * Result


 * Always success, Agent rotate in the specified direction as expected.

classroommode

 * Syntax



code
Used to access Code Connection.


 * Syntax




 * Result


 * Fails if there is no Code Connection installed.
 * On success, Code Connection connected successfully.

geteduclientinfo

 * Syntax




 * Result


 * Shows the information about the client.

position
Toggles player coordinates to be displayed on the HUD.


 * Syntax




 * Result


 * Always success, coordinates displayed on the HUD succesfully.

achievement
Gives or takes an achievement from a player. Replaced with as achievements were replaced with advancements in the Java edition.


 * Syntax




 * Arguments


 * name
 * Specifies which achievement to modify. Must be one of the following:
 * , where achievement_name is a valid achievement identifier
 * to represent all achievements


 * player (optional)
 * Must be a player name or a target selector. If not specified, defaults to the command's executor. Not optional in command blocks.


 * Result


 * Fails if the arguments aren't specified correctly, or if player fails to resolve to one or more online players.


 * On success, grants or removes the specified achievement(s) (and all prerequisite achievements) to the player(s).


 * Examples


 * To grant the "Overkill" achievement to yourself:


 * To grant the "Taking Inventory" achievement to Alice:


 * To remove all achievements from all players:

banip
Bans a player by ip number. Cannot be undone ingame, you must manually change banned-ip.txt.

The Classic equivalent of.


 * Syntax



broadcast
Broadcasts a message across the entire server.

Replaced by.


 * Syntax



chunkinfo
Unknown. Presumably gets information about a chunk, such as the number of vertices and whether it is empty.

Translation strings for this command are present in en_us.lang (and translations), but the command itself is not present in-game.


 * Syntax




 * Result


 * Returns info about the chunk.

home
Teleports player to their spawn point.


 * Syntax


 * Result


 * Always succeeds. Teleports player to their spawn point.

setspawn
Sets the current location as the default spawn location for new players.

The Classic equivalent of.


 * Syntax



solid
Toggles between placing stone and placing bedrock.


 * Syntax




 * Result


 * Always succeeds. Toggles between placing stone and placing bedrock.

unban
Pardons a banned player.

The Classic equivalent of.


 * Syntax