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 Formatting Examples
 * Tellraw Generator
 * List of all Keybinds
 * Component Generator

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.

List of commands

 * 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.

advancement
Gives or takes an advancement from a player, or tests whether a player has an advancement.


 * Syntax




 * Arguments


 * player
 * Must be a player name or a target selector.


 * Grants/revokes only the specified advancement from the player.
 * Grants/revokes only the specified advancement from the player.


 * Grants/revokes the specified advancement, its parent advancement, its parent's parent advancement, etc. from the player. From the start until the specified advancement. The exact order of granting/revoking is "parent" > "parent's parent" > ... > "start" > "specified advancement".
 * Grants/revokes the specified advancement, its parent advancement, its parent's parent advancement, etc. from the player. From the start until the specified advancement. The exact order of granting/revoking is "parent" > "parent's parent" > ... > "start" > "specified advancement".


 * Grants/revokes the specified advancement, its children advancements, its children's children advancements, etc. from the player. All the way forward from the specified advancement. The exact order of granting/revoking is "specified advancement" > "child" > "child's child", when a branch is found it will iterate through the top branch entirely before going through the other branches. Because the order of branches depends on how the operating system reads the files, this order will be inconsistent across different operating systems.
 * Grants/revokes the specified advancement, its children advancements, its children's children advancements, etc. from the player. All the way forward from the specified advancement. The exact order of granting/revoking is "specified advancement" > "child" > "child's child", when a branch is found it will iterate through the top branch entirely before going through the other branches. Because the order of branches depends on how the operating system reads the files, this order will be inconsistent across different operating systems.


 * Acts as  and   combined; all advancements through the specified advancement, going both backwards and forwards. The exact order of granting/revoking is the same as for   and ,   being done before.
 * Acts as  and   combined; all advancements through the specified advancement, going both backwards and forwards. The exact order of granting/revoking is the same as for   and ,   being done before.


 * Grants/revokes every loaded advancement from the player.
 * Grants/revokes every loaded advancement from the player.


 * advancement
 * Specifies which advancement to grant, revoke or test. Must be a valid advancement identifier.


 * criterion (optional)
 * Specifies which criterion of the advancement to grant, revoke or test. Must be a valid advancement criteria identifier.
 * If specified, the command will refer to merely the criterion, and not the entire advancement.
 * If absent, the command will refer to the entire advancement.


 * 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 advancement(s) to the player(s).


 * Examples


 * To test yourself for the "iron leggings" criterion of the "Obtain armor" advancement:


 * To grant the "Shiny gear" advancement to yourself:

ban
These commands control a server's banlist, or blacklist. A blacklist is a list of players or IP addresses that are not allowed to connect to the server. Bans supersede any whitelisting in place.

ban
Adds a player to the blacklist.


 * Syntax




 * Arguments


 * name
 * The name of the player to be banned. Does not need to be online, or even real.


 * reason (optional)
 * Text to be displayed with the ban, to other operators and in the server logs.


 * Result


 * Always succeeds. The player name is added to the server blacklist, which prevents anyone with that name from connecting to the server

ban-ip
Adds an IP address to the blacklist.


 * Syntax




 * Arguments


 * address|name
 * An IP address or the name of a player who is currently online


 * reason (optional)
 * Text to be displayed with the ban, to other operators and in the server logs.


 * Result


 * Fails if address|name is neither a valid IP address nor the name of an online player.


 * On success, the IP address (of the online player, or the address specified) is added to the server blacklist, which prevents anyone from connecting to the server from that address.

banlist
Displays the server's blacklist.


 * Syntax




 * Result


 * Always succeeds. Displays banned IP addresses or banned players.

blockdata
Modifies the data tag of a block.


 * Syntax




 * Arguments


 * x y z
 * Specifies the coordinates of the block to be modified. May be provided in tilde notation to identify a position relative to the command's execution.


 * dataTag
 * Specifies the data tag elements to be added to, or overwrite elements of, the specified block. Must be a compound NBT tag (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, or if the block is "not a data holder block," as in it is not associated with a block entity.


 * On success, modifies the data tag of the targeted block.


 * Examples


 * To change the primary power of the beacon at (0,64,0) to Haste:


 * See also


 * Chunk format — defined data tags for tile entity blocks
 * — changes an entity's data tag
 * — replaces items in a block's inventory
 * – places a new block at a position
 * — sets a block's CommandStats

clear
Clears items from player inventory.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: player: target) (optional)
 * Must be a player name or a target selector. If not specified, defaults to the player who executed the command. Not optional in command blocks.


 * item (PE: itemName: string) (optional)
 * Specifies the id of the item to be cleared. If not specified, all items in the player's inventory are cleared.


 * data (PE: data: int) (optional)
 * Specifies the data value of the item to be cleared. If not specified, or if, all items that match item are cleared, regardless of their data.


 * maxCount (PE: maxCount: int) (optional)
 * Specifies the maximum number of items to be cleared. If not specified, or if, all items that match item and data are cleared. If  , does not clear items, but returns successfully if there were items that could have been cleared (allowing detection of items rather than clearing of items).


 * dataTag (optional)
 * Specifies the data tags of the item to be cleared (only items matching the specified data tags will be cleared — data tags not specified will not be considered). Must be a compound NBT tag (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, if player fails to resolve to one or more online players, or if no items are removed (except when maxCount is )


 * On success, removes the specified items from the player(s).


 * Examples


 * To clear your entire inventory:


 * To clear all items from Alice's inventory:


 * To clear all wool items from Alice's inventory:


 * To clear all orange wool items from the inventory of all players:


 * To clear all golden swords with the "Sharpness I" enchantment from the nearest player, regardless of their damage value:


 * See also


 * — can change or remove items in block inventories
 * — can change or remove items in entity inventories
 * — give items to player
 * — can destroy item entities
 * — can replace items in block or entity inventories

clone
Clones blocks from one region to another.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Color added to make reading easier. The in-game help for the clone command does not list the final argument — TileName is a placeholder name for the purpose of discussion.


 * Arguments


 * x1 y1 z1 and x2 y2 z2 (PE: begin: x y z and end: x y z )
 * Specifies the coordinates of two opposing corner blocks of the source region. May use tilde notation to specify distances relative to the command's execution.


 * The blocks that make up the corners extend in the positive direction from the coordinates used to identify them. Because of this, the lesser coordinates of each axis will be right on the region boundary, but the greater coordinates will be one block from the boundary, and the block volume of the source region will be (xgreater - xlesser + 1) × (ygreater - ylesser + 1) × (zgreater - zlesser + 1). For example,  has a 1-block volume, and   and   both identify the same region with an 8-block volume.


 * x y z (PE: destination: x y z )
 * Specifies the lower northwest corner (i.e., the smallest coordinates of each axis) of the destination region. May use tilde notation to specify a distance relative to the command's execution.


 * maskMode (PE: maskMode: string) (optional)
 * Specifies whether to filter the blocks being cloned. Must be one of the following:
 * — Clone only blocks with the block id specified by TileName.
 * — Copy only non-air blocks. Blocks in the destination region that would otherwise be overwritten by air are left unmodified.
 * — Copy all blocks, overwriting all blocks of the destination region with the blocks from the source region.
 * If left unspecified, defaults to.


 * cloneMode (PE: cloneMode: string) (optional)
 * Specifies how to treat the source region. Must be one of the following:
 * — Force the clone even if the source and destination regions overlap.
 * — Clone the source region to the destination region, then replace the source region with air. When used in filtered mask mode, only the cloned blocks will be replaced with air.
 * — Don't move or force.
 * If left unspecified, defaults to.


 * TileName (PE: tileName: string) (optional)
 * Specifies the block id (e.g., ) to copy when maskMode is set to  . Not optional when using   mode.


 * dataValue (PE: tileData: int) (optional)
 * Specifies the block data to match when finding blocks to clone. Must be between 0 and 15 (inclusive).


 * state (optional)
 * Specifies the block state to match when finding blocks to clone. Must be a valid block state for the block specified in block.


 * Result


 * Fails if the arguments are not specified correctly, if the block volume of the source region is greater than 32768 (enough for the equivalent of eight chunk sections), if the source and destination region overlap (unless using force clone mode), or if one or both regions isn't currently rendered.


 * On success, overwrites blocks in the destination region with blocks from the source region, leaving the source region unmodified (unless using move clone mode).


 * See also


 * — fill a region with a block

debug
Starts or stops a debugging session.


 * Syntax




 * Arguments


 * Starts a new debug profiling session.
 * Starts a new debug profiling session.


 * Stops the active debug profiling session.
 * Stops the active debug profiling session.


 * Result


 * Fails if trying to start a debug session when one is already active, or if trying to stop a debug session when none is running.


 * On success, starts or stops the debug session. While active, includes notifications about potential performance bottlenecks in the console. When stopped, creates a profiler results file in the folder "debug".

defaultgamemode
Sets the default game mode (creative, survival, etc.) for new players entering a multiplayer server.


 * Syntax




 * Arguments


 * mode


 * Specifies the default game mode for new players. Must be one of the following:
 * (can be abbreviated as  or  ) for survival mode
 * (can be abbreviated as  or  ) for creative mode
 * (can be abbreviated as  or  ) for adventure mode
 * (can be abbreviated as  or  ) for spectator mode


 * Result


 * Fails if the arguments are not specified correctly.


 * If successful, sets the default game mode that is shown on the world selection menu. New players that join the world will be put into the default game mode.


 * Examples


 * To set the default game mode to survival:,  , or


 * See also


 * – changes a player's game mode

deop
Revoke operator status from a player.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: player: target)
 * Specifies a player to remove from the list of operators. May be either a player name or a target selector, but target selectors will not evaluate; only actual player names will produce a useful result.


 * Result


 * Always succeeds if restrictions are satisfied. If player matches a name on the list of operators, the name is removed from the list and any player by that name no longer has operator status.


 * Examples


 * To remove Alice from the list of operators:

difficulty
Sets the difficulty level (peaceful, easy, etc.).


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * difficulty (PE: difficulty: int or difficulty: string)


 * Specifies the new difficulty level. Must be one of the following:
 * (can be abbreviated as  or  ) for peaceful difficulty
 * (can be abbreviated as  or  ) for easy difficulty
 * (can be abbreviated as  or  ) for normal difficulty
 * (can be abbreviated as  or  ) for hard difficulty


 * Result


 * Fails if the arguments are not specified correctly.


 * If successful, changes the game's difficulty. On a multiplayer server lasts only until the server is restarted — on restart, difficulty is reloaded from server.properties.


 * Examples


 * To change the difficulty to hard:,  , or


 * See also


 * – changes a player's game mode (creative, survival, etc.)

effect
The effect command manages status effects on players and other entities.


 * Syntax


 * Java Edition
 * (removes all effects)
 * (gives an effect)


 * Pocket Edition
 * (removes all effects)
 * (gives an effect)


 * Arguments


 * player (PE: player: target)
 * Specifies the target(s). Must be a player name or a target selector ( is permitted to target entities other than players).


 * effect (PE: effect: string)
 * Specifies the effect to grant. Must be a status effect id (for example,  or  ).


 * seconds (PE: seconds: int) (optional)
 * Specifies the effect's duration in seconds. Must be between 0 and 1,000,000 (inclusive, without the commas). If not specified, defaults to 30 seconds.


 * amplifier (PE: amplifier: int) (optional)
 * Specifies the number of additional levels to add to the effect. Must be between 0 and 255 (inclusive). If not specified, defaults to 0. Note that the first tier of a status effect (e.g. Regeneration I) is 0, so the second tier, for example Regeneration II, would be specified by an amplifier level of 1.


 * hideParticles (PE: hideParticles: bool) (optional)
 * Specifies whether the particles and the HUD indicator of the status effect should be hidden. Must be either  or  . If not specified, defaults to.


 * Result


 * Fails if arguments are not specified correctly, if player fails to resolve to one or more valid entities (named players must be online), if seconds was specified as 0 and the target did not have the effect, or if no effects were removed in  mode.


 * On success:


 * — clears all status effects from the target(s).


 * effect — Adds the status effect to the target(s). If a target already has the status effect, a new status effect with the same amplifier will only override the old duration if it is longer, but a new status effect with a higher duration will override any previous duration. If seconds is set to 0, cancels the specified effect instead.


 * Examples


 * To grant a Speed II effect to the nearest player for 60 seconds:


 * To grant a Speed III effect to the nearest player for 60 seconds:


 * To clear any Haste effects from all players:


 * To clear all effects from all zombies:

enchant
Adds an enchantment to a player's selected item, subject to the same restrictions as an anvil.


 * Syntax


 * Java Edition


 * Pocket Edition


 * An alternate syntax for enchantment ID's name uses:




 * Arguments


 * player (PE: player: target)
 * Specifies the target(s). Must be a player name or target selector.


 * enchantment ID (PE: enchantmentId: int or enchantmentName: string)
 * Specifies the enchantment to be added to the item held by the target. Must be a valid enchantment ID (for example,  or  ).


 * level (PE: level: int) (optional)
 * Specifies the enchantment level. Must be at least 1 and not greater than the maximum level for the specified enchantment. If not specified, defaults to 1.


 * Result


 * Fails if arguments are not specified correctly, if player fails to resolve to one or more online players, or if the enchantment is not valid for the item or conflicts with current enchantments (for example, "Fire Protection" cannot be given to armor which already has "Protection", and "Sharpness III" cannot be given to a sword which already has "Sharpness I").


 * On success, adds the specified enchantment to the item held by the target.


 * Examples


 * To give the Infinity enchantment to all players holding a bow:


 * Note


 * Although  enforces maximum levels and compatibility, other commands (such as, , and ) can bypass these restrictions.

entitydata
Modifies the data tag of an entity.


 * Syntax




 * Arguments


 * entity
 * Specifies the entity(ies) to be modified. Must be an entity UUID or the  target selector.


 * dataTag
 * Specifies the data tag elements to be added to, or overwrite elements of, the specified entity (data tags cannot be removed and strings cannot be set to a null value). Must be a compound NBT tag (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, or if entity fails to resolve to one or more non-player entities (players can not be changed).


 * On success, modifies the data tag of the targeted entity(ies).


 * Examples


 * To prevent all current zombies from picking up loot:

execute
Executes a command on behalf of one or more other entities, with originating permissions, optionally on condition that a single-block -style check passes.


 * Syntax


 * Java Edition


 * An alternate syntax allows the command to be executed only if a specific block is detected:




 * Pocket Edition


 * An alternate syntax allows the command to be executed only if a specific block is detected:



Color added to make reading easier.


 * Arguments


 * entity (PE: 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.


 * x y z (PE: 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 (PE: command: string)
 * Specifies the command to be run. Must be a valid command.


 * x2 y2 z2 (PE: detectPos: x y z ) ( mode only)
 * Specifies the position of the block to check. x2 and z2 must be within the range -30,000,000 to 30,000,000 (inclusive). May use tilde notation to specify distances relative to (x,y,z).


 * block (PE: detectBlock: string) ( mode only)
 * Specifies the block ID which the block at (x2,y2,z2) must match for the command to run. block must be a valid block id (for example, )


 * dataValue (PE: detectData: int) ( mode only)
 * Must be a valid block data for that type of block or  to match any block data.


 * state ( mode only)
 * Must be a valid block state for that type of block or  to match any block state.


 * Result


 * Fails if arguments are not specified correctly, if entity fails to resolve to one or more valid entities (named players must be online), if the checked block is not of the correct block id, data or state, or if the specified command fails.


 * On success, executes the specified command as if executed by the specified target(s) with operator-level permission at the specified coordinate.


 * Examples


 * To summon lightning bolts at the positions of every zombie:


 * To summon lightning bolts at the positions of every zombie standing on any type of sand:


 * To summon 10 creepers at the nearest player's position (only works as long as there are at least 10 entities in the loaded world):


 * See also


 * — tests for a certain block at a specified position (including specific data tags)

fill
Fills all or parts of a region with a specific block.


 * Syntax


 * Java Edition


 * The fill command also has an optional alternate syntax when using the  option:




 * Pocket Edition


 * Color added to make reading easier.


 * Arguments


 * x1 y1 z1 and x2 y2 z2 (PE: from: x y z and to: x y z )
 * Specifies any two opposing corner blocks of the region to be filled (the "fill region"). May use tilde notation to specify distances relative to the command's execution.


 * The blocks that make up the corners extend in the positive direction from the coordinates used to identify them. Because of this, the lesser coordinates of each axis will be right on the region boundary, but the greater coordinates will be one block from the boundary, and the block volume of the source region will be (xgreater - xlesser + 1) × (ygreater - ylesser + 1) × (zgreater - zlesser + 1). For example,  has a 1-block volume, and   and   both identify the same region with an 8-block volume.


 * block (PE: tileName: string)
 * Specifies the block to fill the region with. Must be a block id (for example, ).


 * dataValue (PE: tileData: int) (optional)
 * Specifies the block data to use for the fill block. Must be between 0 and 15 (inclusive).


 * state (optional)
 * Specifies the block state to use for the fill block. Must be a valid block state for the block specified in block.


 * oldBlockHandling (PE: oldBlockHandling: string) (optional)
 * Must be one of:
 * - Replaces all blocks (including air) in the fill region with the specified block, dropping the existing blocks (including those that are unchanged) and block contents as entities as if they had been mined with an unenchanted diamond shovel or pickaxe. (Blocks that can only be mined with shears, such as vines, will not drop; neither will liquids.)
 * - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are changed to air, dropping their contents as entities but not themselves. If the fill region has no inner blocks (because it is smaller than three blocks in at least one dimension), acts like.
 * - Replaces only air blocks in the fill region with the specified block.
 * - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are not affected. If the fill region has no inner blocks (because it is smaller than three blocks in at least one dimension), acts like.
 * - Replaces all blocks (including air) in the fill region with the specified block, without dropping blocks or block contents as entities. Optionally, instead of specifying a data tag for the replacing block, block id and data values may be specified to limit which blocks are replaced (see replaceTileName and replaceDataValue below)
 * If not specified, defaults to.


 * dataTag (optional)
 * Specifies the data tag to use for the fill block (for example, contents of a chest, patterns on a banner, etc.). Must be a compound NBT tag (for example, ). Cannot be combined with the replaceTileName and replaceDataValue arguments.


 * replaceTileName and replaceDataValue (PE: replaceTileName: string and replaceDataValue: int) (optional)
 * Arguments are only valid when oldBlockHandling is . Cannot be combined with the dataTag argument.
 * Specifies the block id and data of the blocks in the fill region to be replaced. If replaceDataValue is not specified, data value is ignored when determining which blocks to replace. If both arguments are not specified, replaces all blocks in the fill region.


 * Result


 * Fails if the arguments are not specified correctly, if the fill region is not rendered, if the block volume of the fill region is greater than 32768, if dataValue or dataTag are invalid for the specified block id, or if no blocks were changed. However, in Pocket Edition, you can fill unlimited blocks unless one of the sides of the filled blocks is 1 block long.


 * On success, changes blocks in the fill region to the specified block.


 * Examples


 * Replaces all the orange stained hardened clay in the selected area with gold blocks.
 * Replaces the blocks in a 7x7x3 cube directly beneath the player with water.
 * Creates a house-sized box around the player, replacing any blocks that would have been inside the box with air.
 * Replaces the blocks in a 7x7x3 cube directly beneath the player with water.
 * Creates a house-sized box around the player, replacing any blocks that would have been inside the box with air.
 * Creates a house-sized box around the player, replacing any blocks that would have been inside the box with air.

function
Runs a function.


 * Syntax


 * Java Edition


 * Arguments


 * function


 * Must be of the format.


 * if


 * Will only make the function run when an entity was found matching the selector.


 * unless


 * Will only make the function run when no entity was found matching the selector.


 * selector


 * When used with if or unless, this determines the entity to find or not find for the function to actually run.


 * Result


 * Fails if the argument is not specified correctly.


 * Fails if the selector was not found using if.


 * Fails if the selector was found using unless.


 * If successful, runs a function through the entity or commandblock which ran the /function command.


 * Examples


 * To run a function located at 'data/functions/custom/example/test.mcfunction':


 * To run a function if there is a sheep within a radius of 2 blocks:


 * To run a function unless the executor is a player:


 * See also


 * gamerule gameLoopFunction – Runs a function every tick.

gamemode
Sets a player's game mode.


 * Syntax


 * Java Edition


 * Pocket Edition
 * An alternate syntax allows player to enter game mode by its number:
 * An alternate syntax allows player to enter game mode by its number:


 * Arguments


 * mode (PE: gameMode: string or gameMode: int)


 * Must be one of:
 * (can be abbreviated as  or  ) for survival mode
 * (can be abbreviated as  or  ) for creative mode
 * (can be abbreviated as  or  ) for adventure mode
 * (can be abbreviated as  or  ) for spectator mode


 * "hardcore" is not a valid option for the mode argument, as it is technically not a game mode.


 * player (PE: player: target) (optional)


 * If specified, must be either a player's username or a target selector. If unspecified, defaults to the player using the command. When used in a command block, player is not optional.


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.


 * If successful, changes the game mode of the default or specified players.


 * Examples


 * To put yourself into creative mode:,  , or


 * To put all players into survival mode:


 * See also


 * defaultgamemode – sets the initial game mode for players joining the world

gamerule
Sets or queries a game rule value.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * rule name (PE: rule: string)
 * Specifies the game rule to set or query. May be any value, but only certain predefined game rules will affect gameplay (see Predefined Game Rules below).


 * value (PE: value: bool or value: int) (optional)
 * Specifies the value to set the game rule to. May be any value, though only  or   specified for predefined game rules will actually affect gameplay, except in the case of ,   and
 * Whether advancements should be announced in chat
 * style="text-align:center" |
 * (PE: )
 * Whether command blocks should notify admins when they perform commands
 * style="text-align:center" |
 * Whether the server should skip checking player speed when the player is wearing elytra. Often helps with jittering due to lag in multiplayer, but may also be used to travel unfairly long distances in survival mode (cheating).
 * style="text-align:center" |
 * (PE: )
 * Whether the day-night cycle and moon phases progress
 * style="text-align:center" |
 * Whether entities that are not mobs should have drops
 * style="text-align:center" |
 * (PE: )
 * Whether fire should spread and naturally extinguish
 * style="text-align:center" |
 * Whether players should only be able to craft recipes that they've unlocked first
 * style="text-align:center" |
 * (PE: )
 * Whether mobs should drop items
 * style="text-align:center" |
 * (PE: )
 * Whether mobs should naturally spawn. Does not affect monster spawners.
 * style="text-align:center" |
 * (PE: )
 * Whether blocks should have drops
 * style="text-align:center" |
 * (PE: )
 * Whether the weather will change
 * style="text-align:center" |
 * Whether the player should take damage when drowning
 * style="text-align:center" |
 * Whether the player should take fall damage
 * style="text-align:center" |
 * Whether the player should take fire damage
 * style="text-align:center" |
 * The function to run every game tick
 * style="text-align:center" |
 * (PE: )
 * Whether the player should keep items in their inventory after death
 * style="text-align:center" |
 * Whether to log admin commands to server log
 * style="text-align:center" |
 * Determines the number at which the chain command block acts as a "chain".
 * style="text-align:center" |
 * The maximum number of other pushable entities a mob or player can push, before taking suffocation damage per half-second.  Setting to 0 disables the rule.  Damage affects survival-mode or adventure-mode players, and all mobs but bats.  Pushable entities include non-spectator-mode players, any mob except bats, as well as boats and minecarts.
 * style="text-align:center" |
 * (PE: )
 * Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items
 * style="text-align:center" |
 * Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.)
 * style="text-align:center" |
 * Whether the player can fight with other player
 * style="text-align:center" |
 * How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks
 * style="text-align:center" |
 * Whether the debug screen shows all or reduced information; and whether the effects of (entity hitboxes) and  (chunk boundaries) are shown.
 * style="text-align:center" |
 * (PE: )
 * Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text
 * style="text-align:center" |
 * Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies.
 * style="text-align:center" |
 * The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint.
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * style="text-align:center" |
 * Whether the player should take fall damage
 * style="text-align:center" |
 * Whether the player should take fire damage
 * style="text-align:center" |
 * The function to run every game tick
 * style="text-align:center" |
 * (PE: )
 * Whether the player should keep items in their inventory after death
 * style="text-align:center" |
 * Whether to log admin commands to server log
 * style="text-align:center" |
 * Determines the number at which the chain command block acts as a "chain".
 * style="text-align:center" |
 * The maximum number of other pushable entities a mob or player can push, before taking suffocation damage per half-second.  Setting to 0 disables the rule.  Damage affects survival-mode or adventure-mode players, and all mobs but bats.  Pushable entities include non-spectator-mode players, any mob except bats, as well as boats and minecarts.
 * style="text-align:center" |
 * (PE: )
 * Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items
 * style="text-align:center" |
 * Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.)
 * style="text-align:center" |
 * Whether the player can fight with other player
 * style="text-align:center" |
 * How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks
 * style="text-align:center" |
 * Whether the debug screen shows all or reduced information; and whether the effects of (entity hitboxes) and  (chunk boundaries) are shown.
 * style="text-align:center" |
 * (PE: )
 * Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text
 * style="text-align:center" |
 * Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies.
 * style="text-align:center" |
 * The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint.
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * The maximum number of other pushable entities a mob or player can push, before taking suffocation damage per half-second.  Setting to 0 disables the rule.  Damage affects survival-mode or adventure-mode players, and all mobs but bats.  Pushable entities include non-spectator-mode players, any mob except bats, as well as boats and minecarts.
 * style="text-align:center" |
 * (PE: )
 * Whether creepers, zombies, endermen, ghasts, withers, ender dragons, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items
 * style="text-align:center" |
 * Whether the player can regenerate health naturally if their hunger is full enough (doesn't affect external healing, such as golden apples, the Regeneration effect, etc.)
 * style="text-align:center" |
 * Whether the player can fight with other player
 * style="text-align:center" |
 * How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks
 * style="text-align:center" |
 * Whether the debug screen shows all or reduced information; and whether the effects of (entity hitboxes) and  (chunk boundaries) are shown.
 * style="text-align:center" |
 * (PE: )
 * Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text
 * style="text-align:center" |
 * Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies.
 * style="text-align:center" |
 * The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint.
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * style="text-align:center" |
 * How often a random block tick occurs (such as plant growth, leaf decay, etc.) per chunk section per game tick. 0 will disable random ticks, higher numbers will increase random ticks
 * style="text-align:center" |
 * Whether the debug screen shows all or reduced information; and whether the effects of (entity hitboxes) and  (chunk boundaries) are shown.
 * style="text-align:center" |
 * (PE: )
 * Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text
 * style="text-align:center" |
 * Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies.
 * style="text-align:center" |
 * The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint.
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * (PE: )
 * Whether the feedback from commands executed by a player should show up in chat. Also affects the default behavior of whether command blocks store their output text
 * style="text-align:center" |
 * Whether death messages are put into chat when a player dies. Also affects whether a message is sent to the pet's owner when the pet dies.
 * style="text-align:center" |
 * The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint.
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * The number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint.
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * style="text-align:center" |
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * Whether players in spectator mode can generate chunks
 * style="text-align:center" |
 * }
 * }
 * }
 * }


 * Result


 * Fails if rule name is not defined and value is not provided (i.e., attempting to query an undefined game rule).


 * On success, returns the value of the game rule (if value is not provided) or sets the game rule to the specified value (if value is provided).


 * New game rules may be defined and set (by providing a value) or queried (by not providing a value).


 * Examples


 * To stop the day-night cycle:


 * To stop natural healing:


 * To define a new game rule called  and sets its value to 10:

give
Gives an item to a player.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: player: target)
 * Specifies the target to give item(s) to. Must be a player name or target selector.


 * item (PE: itemName: string)
 * Specifies the item to give. Must be a valid item id (for example, ), or block id for which items exist. Numerical ids are unsupported.


 * amount (PE: amount: int) (optional)
 * Specifies the number of items to give. Must be between 1 and 64 (inclusive), but can be 64 even when that's more than one stack. If not specified, defaults to.


 * Item-specific stacking restrictions are ignored, for example: will give a stack of 5 iron swords, though normally the iron sword is restricted to stacks of 1.  The minimum of 1 and the maximum of 64 still apply.


 * data (PE: data: int) (optional)
 * Specifies the item data of the given item(s). 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.


 * dataTag (optional)
 * Specifies the data tag of the given item(s). Must be a compound NBT tag (for example, )


 * "components" (optional)
 * Like DataTags but only supports   and   functions (for example,  )


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.


 * On success, summons the specified item(s) at the location(s) of the target(s). If player resolves to multiple targets, each receives the specified number of items. The item entity's Owner tag is set to the target and its PickupDelay tag set to 0 so that it immediately enters the target's inventory if there is room.


 * Examples


 * To summon 30 blocks of spruce wood planks at John's location with Lore that says "Wooden planks":


 * To summon a potion at John's location which has the Night Vision effect:


 * To give Block of Diamond that can be placed on dirt and can break quartz block that can be done in adventure mode.


 * See also


 * — summon any entity at any location

help
Provides help/list of commands.


 * Syntax


 * Java Edition


 * Alternative command:




 * Pocket Edition


 * Alternative command:




 * Arguments


 * page|command name (PE: page: int or command: string) (optional)
 * Specifies the page number of the command list or the command to provide help for. If not specified, defaults to  (the first page of the command list).


 * Result


 * Fails if page is not a valid page number, or if command name is not a valid command name. Technically fails even if a valid command name is specified, although it displays the usage of the command.


 * On success, displays a page of the command list. Multiplayer commands will not be displayed while in singleplayer, even when open to LAN players.


 * If a valid command name was specified, displays the usage for that command. For some complicated commands may show only the basic usage — additional information can sometimes be gained by attempting to type the command and using the auto-complete control (defaults to key) to explore available options for each argument.


 * If the command is run via command block, it gives various messages prefixed with "Searge says: " as the previous output when activated: "Yolo", "/achievement take achievement.understandCommands @p", "Ask for help on twitter", "/deop @p", "Scoreboard deleted, commands blocked", "Contact helpdesk for help", "/testfornoob @p", "/trigger warning", "Oh my god, it's full of stats", "/kill @p[name=!Searge]", "Have you tried turning it off and on again?", "Sorry, no help today".


 * Examples


 * To display the first page of the command list:  or


 * To display the third page of the command list:


 * To display the usage for the help command:

kick
Kicks a player off a server.


 * Syntax




 * Description


 * Forcibly disconnects player from the server, displaying an optional reason to them.


 * Success Conditions


 * player must be online.

kill
Kills entities (players, mobs, items, etc.).


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player|entity (PE: target: target) (optional)
 * Specifies the target(s) to be killed (including "non-living" entities like items, vehicles, etc.). Must be a player name or a target selector. If not specified, defaults to the command's user. Not optional in command blocks.


 * Result


 * Fails if player|entity fails to resolve to one or more entities (named players must be online).


 * On success, directly kills non-living targets, or inflicts 3.4 x 1038 void damage to living targets — even if they are in Creative mode or protected by a high-level Resistance effect — and issues the appropriate death message. Players and mobs killed this way drop loot, and slimes and magma cubes that aren't already of minimum size spawn smaller ones. Destroys boats, minecarts, loose items and experience orbs if they are targeted.


 * Examples


 * To kill yourself:


 * To kill a player named Bob:


 * To "kill" all item entities (making them vanish from the world):


 * To "kill" all entities within loaded chunks, including yourself:


 * To "kill" all entities (item entities, animals, etc) apart from players:

list
Lists players on the server.


 * Syntax


 * Java Edition


 * Pocket Edition
 * (hidden)
 * (hidden)


 * Description


 * Shows the names of all currently-connected players (the same can be achieved when pressing ).


 * Arguments


 * uuids (PE: details: string) (optional)
 * If 'uuids' is specified, player UUIDs will be shown alongside names.
 * In Pocket Edition, it must be one of:


 * Success Conditions


 * Always succeeds, even in a command block.

locate
Displays the coordinates for the closest structure of a given type in the chat for the player who executed the command.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * StructureType (PE: feature: string)


 * Specifies the structure to locate. Must be one of the following:
 * (PE: ) (for end cities)
 * (PE: ) (for nether fortresses)
 * (PE: ) (for woodland mansions)
 * (PE: ) (for abandoned mineshafts)
 * (PE: ) (for ocean monuments)
 * (PE: ) (for strongholds)
 * (PE: ) (for desert temples, jungle temples, witch huts, and igloos)
 * (PE: ) (for villages)

The structure type is case-sensitive.


 * Result


 * Fails if the arguments are not specified correctly, or if unable to locate the requested StructureType (for example, if it's in a different dimension).


 * If successful, displays the coordinates for the closest structure of the given type in the chat, for the player who executed the command. Will display the Y coordinate as  for some structures.


 * Examples


 * To obtain the coordinates of the nearest woodland mansion:

me
Displays a message about yourself.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Result


 * Fails if any target selectors do not resolve to at least one online player, or if any named players are not online.


 * On success, sends a narrative message to the other players in the form of "* Your Name action" (e.g., "* Alice sneezes." or "* Alice exploded." ). If a multi-person target selector (e.g., @a) is used in action, the list of names is formatted as "name1 and name2" for two players, or "name1, name2, ... and nameN" for N players.

op
Grants operator status to a player.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Result


 * Always succeeds. Grants player operator status on the server.

pardon
Removes entries from the banlist.


 * Syntax




 * Arguments


 * name
 * Specifies the name to remove from the banlist.


 * address
 * Specifies the IP address to remove from the banlist. Must be a valid IP address.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success, if the name or the IP address is on the banlist, it is removed, allowing anyone to connect to the server by that name or from that IP address.

particle
Creates particles.


 * Syntax




 * Color added to make reading easier.


 * Arguments


 * name
 * Specifies the particle to create. Must be a particle name (for example, ).


 * x y z
 * Specifies the position at which to create the particle. All values (including y) must be between -30,000,000 and 30,000,000 (inclusive, without the commas). May use tilde notation to specify a position relative to the command's execution.


 * xd yd zd
 * Specifies the size of the 3-dimensional cuboid volume to spawn particles in, centered on position x y z, and divided by about 8 (using  specifies a cuboid of about 8×8×8 in size).


 * Exception: When name is,  , or   and speed is not 0, and count is 0 or not specified, these values are set as the RGB channel values of the color of the particle, and are specified in the range 0 to 1.  In this usage, the speed parameter acts as a multiplier on these values.  If count is greater than 0 for those particles, xd yd zd are treated as a 3-dimensional volume as usual, rather than as a color, and randomized colors are used.
 * With  or ,   produces a black particle for example,   produces a green particle, and   produces a dark blue particle, etc.
 * The  particle's RGB channels behaves differently:


 * The other peculiarities are explained by this pseudocode:
 * {| class="wikitable"

! Pseudocode Set Red = xd, Green = yd, Blue = zd Multiply each (Red, Green, Blue) by speed If Red = 0 then set Red = 1 Set AllChannelMultiplier = RandomBetween(0.6, 1.0) For each channel (Red, Green, Blue): ## Multiply (so that we step towards the range of a Byte) Multiply channel by 256 ## Randomize (note that this causes a triangular distribution ## such that 0.74 is the mean net multiplier) Multiply channel by RandomBetween(0.8, 1.0) Multiply channel by AllChannelMultiplier ## Convert (to an actual Byte value) Round channel toward zero, to the nearest integer Set channel = channel Mod 256 Return color of this particle as (Red, Green, Blue)
 * }
 * To better illustrate this process, consider these particular values, which can be used for any of xd yd zd to affect their respective channels (with the exception of xd = Red = ).
 * {| class="wikitable" data-description="reddust examples"

! Input !! # Multiply !! # Randomize !! # Convert !! Result to   to
 * style="width: 60px;" |
 * style="width: 70px;" |
 * style="width: 170px;" |
 * style="width: 130px;" |
 * Multipliers have no effect, so the channel will stay at . Note that this is not possible for the red channel.
 * to
 * Since every possible value is less than, this channel will have a true bit value of  , even for the red channel. This is true for any input value that has an absolute value of less than.
 * to
 * to
 * This produces a wide range of values for the channel, with  as the upper bound.
 * to
 * to
 * This produces a range of only the two brightest bit values ( is now effectively the lower bound).
 * to
 * or
 * Similar to above. Note that if the randomized value is greater than, the channel wraps around to zero. This results in a some particles with bit   and some with bit   (i.e., some dark and some bright). Values closer to zero produce more dark particles, and values further from zero produce more bright particles.
 * to
 * to  and
 * to
 * to
 * This produces a range of only the two brightest bit values ( is now effectively the lower bound).
 * to
 * or
 * Similar to above. Note that if the randomized value is greater than, the channel wraps around to zero. This results in a some particles with bit   and some with bit   (i.e., some dark and some bright). Values closer to zero produce more dark particles, and values further from zero produce more bright particles.
 * to
 * to  and
 * to
 * or
 * Similar to above. Note that if the randomized value is greater than, the channel wraps around to zero. This results in a some particles with bit   and some with bit   (i.e., some dark and some bright). Values closer to zero produce more dark particles, and values further from zero produce more bright particles.
 * to
 * to  and
 * to
 * to  and
 * to
 * to  and
 * This can produce every possible bit value. However, due to both overlap (eg.,  and   give the same result due to modulo) and the triangular distribution caused by two random multipliers, some bit values are more likely.
 * to
 * to  and
 * to
 * to  and
 * to  and
 * This covers the entire range of byte values with no overlap, so the probability distribution of the values is nearly triangular ( is the most likely value, which becomes bit  ). Note that.
 * }
 * }


 * speed
 * Specifies the speed of the particle. Must be at least 0.


 * count (optional)
 * Specifies the number of particle effects to create. Must be at least 0 (which produces one particle).


 * mode (optional)
 * Specifies the display mode. May be anything but only  will have an effect: to allow the particle(s) to be seen up to 256 blocks away and by players that use the minimal particles setting.


 * player (optional)
 * Allows control of which player should view this particle instead of everyone in the viewing range of the particle.


 * params (optional)
 * Allows,  ,   and   to be modified to view a specific item or block. Two parameters are accepted for.


 * For,   and  , the params argument specifies a numeric id (block only) and a data value, using a single number: id+(data×4096).


 * For, two params arguments specify the numeric id (block id or item id) and the data value separately.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success, creates the specified particle.


 * Examples


 * To create a stationary huge explosion particle 10 blocks to the east:

playsound
Plays a sound.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * sound (PE: sound: string)
 * Specifies the sound to play. Must be a sound event defined in sounds.json (for example, ).


 * A sound event may be affiliated with multiple sounds, and the sound which is actually produced will be chosen at random from them, modified by their "weight", just as the game normally would. For example, the  sound event will play one of several pig sounds at random, because the event has multiple sounds associated with it.


 * Resource packs may add their own events to sounds.json; the command will successfully play these. File names are not used by this command; it strictly uses the events defined in sounds.json (which may not even be similar to the original file names and paths), and thus a resource pack adding new sound files must define events for them (this is not necessary when replacing old sounds which are already in defined events).


 * source
 * Specifies which category in the music & sound options the sound falls under. Must be,  ,  ,  ,  ,  ,  ,  ,  , or.


 * player (PE: player: target)
 * Specifies the sound's target. Must be a player name or a target selector.


 * x y z (PE: position: x y z) (optional)
 * Specifies the position to play the sounds from. May use tilde notation to specify a position relative to the target(s).


 * volume (PE: volume: float) (optional)
 * Specifies the distance that the sound can be heard. Must be at least 0.0. For values less than 1.0, the sound will be quieter and have a smaller sphere within which it may be heard. For values greater than 1.0, the sound will not actually grow louder, but its audible range (a 16-block radius at 1.0) will be multiplied by volume. There will always be a gradual falloff to silence based on distance from the center of the sphere.


 * pitch (PE: pitch: float) (optional)
 * Specifies the pitch of the sound. Must be between 0.0 and 2.0 (inclusive), and values less than 0.5 are equivalent to 0.5. Values lower than 1.0 lower the pitch and increase the duration; values greater than 1.0 raise the pitch and reduce the duration. The pitch value is a multiplier applied to the frequency, so if a value between 0.5 and 1.0 (inclusive) is doubled, the pitch will be an octave higher. (If you're a musician wishing to convert other intervals to pitch values, see Note block, but be aware that 1.0 won't be F♯ for all sound effects.) If not specified, defaults to 1.0.


 * minimumVolume (PE: minimumVolume: float) (optional)
 * Specifies the volume for targets outside the sound's normal audible sphere. If a target is outside the normal sphere, the sound will instead be centered some short distance from the target (less than four blocks away), and  will determine its volume. Must be between 0.0 and 1.0 (inclusive).


 * Result


 * Fails if the arguments are not specified correctly, if player fails to resolve to one or more online players, or if the targets are unable to hear the sound from where it is played.


 * On success, plays a sound for the targeted players.


 * See also


 * — Stops a sound.

publish
Opens single-player world to the local network.


 * Syntax




 * Description


 * Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats.


 * Success Conditions


 * Cannot be used in a command block.
 * Cannot be used on a multiplayer server, and will fail if the world is already published to LAN.

recipe
Gives or takes (unlocks or locks) recipes for players.


 * Syntax




 * Arguments


 * give|take
 * If give, the recipe will be given (unlocked) for the player. If take, the recipe will be taken (locked) for the player.


 * player
 * Specifies the player to give or take the recipe from. May be a player name or a target selector.


 * name
 * The item ID of the recipe to give or take. If you specify *, it will give or take all recipes from that player.


 * Result


 * Fails if the arguments are not specified correctly, if player fails to resolve to one or more online players, or if no new recipes are given or taken.


 * On success, returns the number of recipes given or taken.

reload
Reloads loot tables, advancements and functions from disk.


 * Syntax




 * Arguments


 * Result


 * Always succeeds. Any changes to loot tables, advancements or functions will now be recognised by Minecraft.

replaceitem
Replaces items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs) with the given item(s).


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * x y z (PE: position: x y z) ( mode only)
 * Specifies the position of the block to be modified. May use tilde notation to specify a position relative to the command's execution.


 * selector (PE: target: target) ( mode only)
 * Specifies one or more entities to modify. Must be a player name or target selector.


 * slot (PE: slotType and slotId)
 * Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.


 * For blocks, must be  where slot_number is replaced with a number specifying the slot.
 * Chests, dispensers, droppers, hoppers, and trapped chests are numbered 0 for the top-left slot and then increase first horizontally, then vertically (so, for example, a chest's top row slots are numbered 0 to 8 from left to right). Double chests and double trapped chests are treated as two single container blocks.
 * A brewing stand's bottom slots are numbered 0 to 2 from left to right, and its top slot is 3.
 * A furnace's slots are numbered 0 for the input slot, 1 for the fuel slot, and 2 for the output slot.
 * Other blocks which hold items but don't have inventory GUIs (flower pots and jukeboxes) can only be changed with.


 * For entities, must be one of the following, where slot_number is replaced with a number specifying the slot:


 * {| class="wikitable" data-description="Slot information"

!Slot !Slot Numbers !Restrictions
 * rowspan=4|armor stands, mobs, and players only (though not all mobs will show or make use of the items)
 * rowspan=2|works on players, armor stands and mobs (though not all mobs will show or make use of the items).
 * style="text-align: center;"|0 to 26
 * rowspan=3|players only
 * style="text-align: center;"|0 to 8
 * style="text-align: center;"|0 to 26
 * horses, donkeys, and mules only; item must be a saddle
 * donkeys, and mules only; item must be a chest
 * horses and llamas only; item must be a type of horse armor (if a horse) or a carpet (if a llama)
 * style="text-align: center;"|0 to 14
 * donkeys and mules with chests only
 * style="text-align: center;"|0 to 7
 * villagers only
 * }
 * The inventory of an item frame can only be changed with.
 * rowspan=2|works on players, armor stands and mobs (though not all mobs will show or make use of the items).
 * style="text-align: center;"|0 to 26
 * rowspan=3|players only
 * style="text-align: center;"|0 to 8
 * style="text-align: center;"|0 to 26
 * horses, donkeys, and mules only; item must be a saddle
 * donkeys, and mules only; item must be a chest
 * horses and llamas only; item must be a type of horse armor (if a horse) or a carpet (if a llama)
 * style="text-align: center;"|0 to 14
 * donkeys and mules with chests only
 * style="text-align: center;"|0 to 7
 * villagers only
 * }
 * The inventory of an item frame can only be changed with.
 * style="text-align: center;"|0 to 26
 * horses, donkeys, and mules only; item must be a saddle
 * donkeys, and mules only; item must be a chest
 * horses and llamas only; item must be a type of horse armor (if a horse) or a carpet (if a llama)
 * style="text-align: center;"|0 to 14
 * donkeys and mules with chests only
 * style="text-align: center;"|0 to 7
 * villagers only
 * }
 * The inventory of an item frame can only be changed with.
 * horses and llamas only; item must be a type of horse armor (if a horse) or a carpet (if a llama)
 * style="text-align: center;"|0 to 14
 * donkeys and mules with chests only
 * style="text-align: center;"|0 to 7
 * villagers only
 * }
 * The inventory of an item frame can only be changed with.
 * style="text-align: center;"|0 to 7
 * villagers only
 * }
 * The inventory of an item frame can only be changed with.
 * }
 * The inventory of an item frame can only be changed with.


 * item (PE: itemName: string)
 * Specifies the item to be placed in the block or entity's inventory slot. Must be an item id, or a block id for which an item exists (for example, ).


 * amount (PE: amount: int) (optional)
 * Specifies the number of items to be placed in the block or entity's inventory slot. Must be between 1 and 64 (inclusive), even for items with a smaller stack size.


 * data (PE: data: int) optional)
 * Specifies the item data for the item(s) to be placed in the block or entity's inventory slot. 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 will default to 0. If not specified, defaults to 0.


 * dataTag (optional)
 * Specifies the data tag for the item(s) to be placed in the block or entity's inventory slot. Must be a compound NBT tag (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, if the specified block is not a container, if selector fails to resolve to one or more entities (named players must be online), or if none of the targeted entities have the specified slot (for example, zombies don't have ).


 * On success, replaces the items in the specified slot with the specified items (previous items in that slot are lost) wherever possible.


 * Examples


 * To replace the items in the bottom-right slot of a single chest one block above with four spruce saplings:


 * To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:


 * See also


 * — can also replace items in a container
 * — can also replace items in a mob's inventory, or modify the drop chances of armor and weapons
 * — give items to players without specifying specific inventory slots or overwriting other items

save
These commands manage server saves.

save-all
Saves the server to disk.


 * Syntax




 * Description


 * Causes the server to mark all chunks and player data as needing to be saved. They will be saved over time until all are flushed to disk.
 * If 'flush' is specified as the sole argument to the command, all the chunks will be saved to disk immediately, freezing the server for a short time.


 * Success Conditions


 * Succeeds if the map is successfully saved to disk. If an error occurs (such as the disk being full, or another copy of Minecraft has the map open) the command will fail.

save-off
Disables automatic server saves.


 * Syntax




 * Description


 * Disables the server writing to the world files. All changes will temporarily be queued.


 * Success Conditions


 * Always succeeds unless already disabled.

save-on
Enables automatic server saves.


 * Syntax




 * Description


 * Enables the server writing to the world files. This is the default behavior.


 * Result


 * Always succeeds unless already enabled.

say
Sends a message in the chat to other players


 * Syntax


 * Java Edition


 * Pocket Edition


 * Result


 * Fails if any target selectors do not resolve to at least one online player, or if any named players are not online.
 * On success, broadcasts message to all players on the server. If a multi-person target selector (e.g., @a) is used in message, the list of names is formatted as "name1 and name2" for two players, or "name1, name2, ... and nameN" for N players. Target selectors are not recognized in Pocket Edition.

scoreboard
These commands manage scoreboard objectives, players, and teams.


 * Syntax



See Scoreboard for more information.

seed
Displays the world seed.


 * Syntax




 * Result


 * Always succeeds. This command can always be used in single-player mode, regardless of whether cheats are enabled or not.

setblock
Changes a block to another block.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * x y z (PE: position: x y z)
 * Specifies the position of the block to be changed. May use tilde notation to specify a position relative to the command's execution.


 * block (PE: tileName: string)
 * Specifies the new block. Must be a block id (for example,  or  ).


 * dataValue (PE: tileData: int) (optional)
 * Specifies additional data to further describe the new block. Must be between 0 and 15 (inclusive). If not specified, defaults to.


 * state (optional)
 * Specifies additional data to further describe the new block. Must be a valid state for the block specified in block.


 * oldBlockHandling (PE: oldBlockHandling: string) (optional)
 * Specifies how to handle the block change. Must be one of:
 * — The old block drops both itself and its contents (as if destroyed by a player). Plays the appropriate block breaking noise.
 * — Only air blocks will be changed (non-air blocks will be "kept").
 * — The old block drops neither itself nor any contents. Plays no sound.
 * If not specified, defaults to.


 * dataTag (optional)
 * Specifies the data tag for the new block. Must be a compound NBT tag (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, if tried to change a non-air block in keep mode, tried to replace a block with an identical copy in keep or replace mode, or if the coordinates are in an unloaded chunk.


 * On success, changes the block at the specified position.


 * See also


 * — modifies the data tags of a block
 * — copies blocks from one region to another
 * — fills a region with a block

setidletimeout
Sets the time before idle players are kicked from the server.


 * Syntax




 * Description


 * Set the idle kick timer. Any players idle for Minutes until kick will be kicked.


 * Success Conditions


 * Always succeeds.

setmaxplayers
Sets the maximum number of players allowed to join a multiplayer game.


 * Syntax




 * Arguments


 * maxplayers
 * Specifies the desired new maximum number of players. If less than the current number of players or greater than the maximum number of connections the server can accept, the argument is forced into this range.


 * Result


 * Fails if maxPlayers is omitted or isn't an integer.
 * On success, displays the new maximum number of players in the chat. An additional notification message is displayed if the number specified in the command was forced into the allowed range.
 * Note: This command can be entered in single-player mode, but has no effect until you reopen the world in multiplayer mode.

setworldspawn
Sets the world spawn.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * x y z (PE: spawnPoint: x y z) (optional)
 * Specifies the coordinates of the world spawn. x and z must be within the range -30,000,000 to 30,000,000 (inclusive). y must be between 0 and 256 (inclusive). May use tilde notation to specify coordinates relative to the command's execution. If not specified, defaults to the position of the command's execution. Not optional in command blocks.


 * If the server is not in adventure mode, players will always spawn on the topmost block near (x,z) — y is effectively ignored. If the server is in adventure mode, then the new spawnpoint will be the coordinates given exactly, including the y coordinate (even if underground and even if there is no block there) -- if the y level given does not have space for the player then it will move up on the y axis until it does, at most y level 256.


 * Although spawn chunks are usually kept loaded at all times, new spawn chunks won't be loaded by this command until a player moves within range. Compasses (which in Minecraft point to the world spawn rather than north) will also not update to the change until the world is reloaded.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success, sets the world spawn to the specified coordinate.

spawnpoint
Sets the spawn point for a player.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: player: target) (optional)
 * Specifies the player whose spawn point should be set. Must be a player name or a target selector. If not specified, defaults to the command's user. Not optional in command blocks.


 * x y z (PE: spawnPos: x y z) (optional)
 * Specifies the coordinates of the player's new spawn point. x and z must be integers within the range -30,000,000 to 30,000,000 (inclusive). y must be an integer between 0 and 256 (inclusive). May use tilde notation to specify coordinates relative to the command's execution. If not specified, defaults to the position of the specified player(s).


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.


 * On success, sets the spawn point of the targeted player(s) to the specified coordinate.

spreadplayers
Teleports entities (players, mobs, items, etc.) to random surface locations within an area.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * x z (PE: x: rotation and z: rotation)
 * Specifies the center of the region to spread targets to. x and z must be between -30,000,000 and 30,000,000 (exclusive). May use tilde notation to specify coordinates relative to the command's execution.


 * spreadDistance (PE: spreadDistance: float)
 * Specifies the minimum distance between targets. Must be at least 0.0.


 * maxRange (PE: maxRange: float)
 * Specifies the maximum distance on each horizontal axis from the center of the area to spread targets (thus, the area is square, not circular). Must be at least 1.0 greater than spreadDistance.


 * respectTeams
 * Specifies whether to keep teams together. Must be  or  . If , targets on the same team will be teleported to the same location.


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


 * Result


 * Fails if the arguments are not specified correctly, if there are too many targets to satisfy the spreadDistance requirement within the specified area, or if a target is attempted to be spread to outside the world boundary.


 * On success, teleports targets to random surface locations within the specified area. Targets will always be placed on the top block at a location, and never on lava.


 * Examples


 * To teleport all players by team to random surface locations in a 1,000×1,000-block area centered on (0,0), with a minimum distance between teams of 200 blocks:


 * To teleport one random player from each of three teams (Red, Blue, and Green), as well as Alice and Bob, to random surface locations in a 200×200-block area centered on (0,0), with a minimum distance between players of 50 blocks:


 * See also


 * and — different commands that teleport a single player or entity to a specific position (even underground).

stats
Manages the updating of scoreboard objectives with the results of other commands.

Commands can be executed by blocks (specifically, command blocks and signs) or by entities (players can execute commands directly, and other entities can be the origin of commands indirectly with the command). When a command is executed, the command returns one or more "command stats": the success count, number of blocks affected, number of entities affected, number of items affected, and/or a query result (such as from ).

The stats command allows "selectors" and "objectives" to be set (or cleared) for each of these command stats for specific blocks or entities. Selectors (for example, ) are stored exactly as entered, and don't get evaluated immediately. When a command is later run by the block or entity, the stored selector is then used to target (other) entities and update their scoreboard objective with the value of the command stat. That value can then be displayed or operated on, just like any other scoreboard value.

The success count from a command block can also be acquired with a redstone comparator, but that is capped at a maximum value of 15, while scoreboard objectives can hold any value from -2,147,483,648 to 2,147,483,647. Success counts and query results are also usually displayed in the chat.


 * Syntax




 * Arguments


 * x y z ( mode only)
 * Specifies the position of the block to post command stats from. x and z must be between -30,000,000 and 30,000,000 (inclusive, without the commas) and y must be between 0 and 255 (inclusive). May use tilde notation to specify a position relative to the command's execution.


 * selector2 ( mode only)
 * Specifies the entity to post command stats from. Must be a player name or a target selector.


 * stat
 * Specifies the command stat whose selector and objective are to be cleared or set. Must be one of:
 * — returns the number of blocks affected by a command
 * — returns the number of entities affected by a command
 * — returns the number of items affected by a command
 * — returns the result of a command query
 * — returns a command's success count


 * selector ( mode only)
 * Specifies the selector to be evaluated when a command is run by the specified block or entity to determine which entity(ies) scoreboard objective is to be updated with the result returned by stat. May be anything because it won't be evaluated until a command is run by the specified block or entity, but only a player name or a target selector will produce useful results (though player names can be fake, so even real players don't need to be online).


 * objective ( mode only)
 * Specifies the name of the objective to be updated with the result returned by stat. May be anything because it won't be evaluated until a command is run by the specified block or entity, but only the name of a defined objective will produce useful results.


 * Result


 * Fails if the arguments are not specified correctly, if the specified block cannot track stats (in other words, it fails if the specified block is not a command block or sign), or if selector2 fails to evaluate to one or more valid entities (named players must be online).


 * On success, clears or sets the selector and objective to be updated with the result returned by stat.


 * Examples


 * To set the block at (0,64,0) to update scoreboard objective MyObj of the nearest player with the value of any query result returned by the block:


 * To stop the block at (0,64,0) from updating any scoreboard obectives with the success count of commands it executes:


 * To have the nearest wither skull update the scoreboard objective NumBlocks of fake player #FakePlayer with the number of blocks affected by commands executed by the wither skull:


 * See also


 * — can also change the selector and objectives of blocks by altering data tags directly
 * — can also change the selector and objectives of entities by altering data tags directly

stop
Stops a server.


 * Syntax




 * Result


 * Always succeeds. Saves all changes to disk, then shuts down the server.

stopsound
Stops a sound.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: player: target)
 * Specifies the sound's target. Must be a player name or a target selector.


 * source (optional)
 * Specifies which category in the music & sound options the sound falls under. Must be,  ,  ,  ,  ,  ,  ,  ,  , or.


 * sound (PE: sound: string) (optional)
 * Specifies the sound to stop. Must be a sound event defined in sounds.json (for example, ). If no sound if specified, stops all sounds.


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.


 * On success, stop the specified sound(s) for the targeted players.

summon
Summons an entity (mobs, projectiles, items, vehicles, etc.).


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * EntityName (PE: entityType: string)
 * Specifies the entity to be summoned. Must be an entity id (for example,,  ,  ,  ,  , etc.) or.


 * x y z (PE: spawnPos: x y z) (optional)
 * Specifies the position to summon the entity. x and z must be between -30,000,000 to 30,000,000 (inclusive), and y must be at least 0. May use tilde notation to specify a position relative to the command's execution. If not specified, defaults to the position of the command's execution.


 * dataTag (optional)
 * Specifies the data tag for the entity. Must be a compound NBT tag (for example, ). Lightning has no additional data tags that can be specified.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success, creates the specified entity at the specified position.


 * Examples


 * To summon a charged creeper named "Powered Creeper" at the current position:


 * To summon lightning 10 blocks west of the current position:


 * To summon an armor stand wielding a lava bucket and wearing a skeleton skull:

teleport
Teleports entities (players, mobs, items, etc.).

In the Java Edition, the primary difference between this command and the command is that  uses coordinates relative to the command's execution, while  uses coordinates relative to the teleported targets.

Although most commands can only affect chunks that have already been generated, can send entities into chunks that have yet to be generated. If this happens to a player, then the chunks around and including that player's destination will be newly generated.

In Pocket Edition, this command is simply an alias for.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * target entity (PE: victim: target)
 * Specifies the entity(s) to be teleported. Must be either a player name or a target selector.


 * x y z (PE: destination: x y z)
 * Specifies the coordinates to teleport the target(s) to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be within the range -4096 to 4096 inclusive. May use tilde notation to specify a position relative to the position of the executor of the command (use or  to teleport using coordinates relative to the target instead).


 * destination: target
 * Specifies the entity to teleport the target(s) to. Must be either a player name or a target selector.


 * y-rot (PE: y-rot: rotation) (optional)
 * Specifies the horizontal rotation (-180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of due north, before wrapping back around to -180.0). Tilde notation can be used to specify a rotation relative to the target's previous rotation.


 * x-rot (PE: x-rot: rotation) (optional)
 * Specifies the vertical rotation (-90.0 for straight up to 90.0 for straight down). Tilde notation can be used to specify a rotation relative to the target's previous rotation.


 * Result


 * Fails if the arguments are not specified correctly, or if target entity fails to resolve to one or more entities (named players must be online).


 * On success, teleports the targets to the specified destination.

tell
Sends a private message to one or more players. "w" or "msg" can also be used.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: recipient: target)
 * Specifies the targeted player(s) to send the private message to. Must be a player name (or a target selector, but only if the user is an operator).


 * message(PE: message: string)
 * Specifies the message to send. May include spaces as well as target selectors if run from the server console. Target selectors may also be used by running the command via.


 * Result


 * Fails if the arguments are not specified correctly, if any target selectors in either argument fail to resolve to at least one online player, or if a named player is not online.


 * On success, only the targeted player(s) see the private message in their chat. If a multi-person target selector (e.g., @a) is used in message, the list of names is formatted as "name1 and name2" for two players, or "name1, name2, ... and nameN" for N players. Target selectors in the message are not recognized in Pocket Edition.


 * Examples


 * To privately tell Alice to start the mission:

tellraw
Sends a JSON message to players.


 * Syntax




 * Arguments


 * player
 * Specifies the player(s) to send the message to. Must be a player name or target selector.


 * raw json message
 * Specifies the message to send. Must be valid raw JSON text (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to evaluate to one or more online players.


 * On success, the targeted players receive the JSON message in their chat.


 * See also


 * — send a simple text message to all players
 * — send a simple text message to specific players

testfor
Counts entities (players, mobs, items, etc.) matching specified conditions.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * player (PE: victim: target)
 * Specifies the targets to count. Must be a player name or a target selector ( is permitted to target entities other than players).


 * dataTag (optional)
 * Specifies the data tags the entities must have to match successfully. Must be a compound NBT tag (for example, ).


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to resolve to one or more entities (named players must be online).


 * On success, produces a success count equal to the number of targets matching player, which can be measured by a redstone comparator facing away from the command block.


 * Examples


 * To test if Alice is online:


 * To count the number of players in survival mode within a 3-block radius of (0,64,0):


 * To count the number of zombies within a 20-block radius of (0,64,0):


 * To count the number of players currently flying:


 * To test if an arrow is in a block:

testforblock
Tests whether a certain block is in a specific location.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * x y z (PE: position: x y z)
 * Specifies the position of the block to test. x and z must be between -30,000,000 and 30,000,000 (inclusive, without the commas) and y must be between 0 and 255 (inclusive). May use tilde notation to specify a position relative to the command's execution.


 * block (PE: tileName: string)
 * Specifies the block to test for. Must be a valid block id (for example, ).


 * dataValue (PE: dataValue: int) (optional)
 * Specifies the block data to test for. dataValue must be between -1 and 15 (inclusive). If not specified, or if, dataValue matches any block data value.


 * state (optional)
 * Specifies the block state to test for. Must be a valid block state for the block specified in block. If not specified, or if , state matches any block state.


 * dataTag (optional)
 * Specifies the block data tags to test for. Must be a compound NBT tag (for example, ). If not specified, dataTag matches any block data tag.


 * Result


 * Fails if the arguments are not specified correctly, if the block at the specified position does not match the specified block id or data, or if the specified data tag has different values than are defined in the block's data tag (dataTag does not need to match the block's entire data tag, and data tags in the argument which are undefined in the block will not cause the command to fail).


 * On success, returns a success count of 1.


 * Examples


 * To test if the block at (0,64,0) is any type of wool:


 * To test if the block at (0,64,0) is orange wool:


 * To test if the block below is a jukebox with the "mall" record inside:

testforblocks
Tests whether the blocks in two regions match.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Color added to make reading easier.


 * Arguments


 * x1 y1 z1 and x2 y2 z2 (PE:  and  )
 * Specifies two opposing corners of the region to use as the pattern to test for (the "source region"). x1, z1, x2, and z2 must all be between -30,000,000 and 30,000,000 (inclusive, without the commas), and y1 and y2 must be between 0 and 255 (inclusive). May use tilde notation to specify coordinates relative to the command's position. The number of blocks in the source region must not exceed 524,288.


 * x y z (PE: destination: x y z )
 * Specifies the lower northwestern corner (the corner with the most-negative values) of the region to be checked (the "destination region"). x and z must both be between -30,000,000 and 30,000,000 (inclusive, without the commas), and y must be between 0 and 255 (inclusive). May use tilde notation to specify coordinates relative to the command's position. Source and destination regions may overlap.


 * mode (PE: mode: string) (optional)
 * Specifies how to match blocks. Must be one of:
 * — every block in the source and destination regions must match exactly.
 * — air blocks in the source region will match any block in the destination region.
 * If not specified, defaults to.


 * Result


 * Fails if the arguments are not specified correctly, or if the source and destination regions do not match.


 * On success, returns the number of matching blocks (the total number of blocks in  mode, or the number of source region non-air blocks in   mode).

time
Changes or queries the world's game time. In Pocket Edition,,   and   are three separated commands.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * value (PE: amount: int or time: string)
 * Specifies the time to add, query, or set:
 * - Must be between 0 and 2,147,483,647 (inclusive, without the commas)
 * - Must be,   or.
 * - Must be between 0 and 2,147,483,647 (inclusive, without the commas),, or.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success:
 * - adds value to the world's game time.
 * - returns the number of game ticks since dawn.
 * - returns the age of the world in game ticks.
 * - returns the number of in-game days passed (matching the debug screen).
 * - sets the world game time to value ( = 1,000,   = 13,000).


 * Examples


 * To set the time to 1,000:  or


 * To add one day to the world time:

title
Controls screen titles.

Screen titles are displayed to players as a single line of large center-aligned text in the middle of their displays and can include a second line of text called a "subtitle". Both lines are specified using complicated formatting. Screen titles can be set to fade in and fade out, and the duration they are displayed can also be specified. Screen titles scale in size with the GUI Scale and screen titles which are too big to fit on the screen are not line-wrapped (they just overflow off the screen on both sides).


 * Syntax


 * The command has six variations, each with different arguments.


 * Java Edition
 * (removes the screen title from the screen)
 * (resets options to default values)
 * (displays the text as the title position)
 * (displays the text in the subtitle position)
 * (displays the text as the action bar position)
 * (specifies fade-in, stay, and fade-out times)


 * Pocket Edition
 * (removes the screen title from the screen)
 * (resets options to default values)
 * (displays the text as the title position)
 * (displays the text in the subtitle position)
 * (displays the text as the action bar position)
 * (specifies fade-in, stay, and fade-out times)


 * Arguments


 * player (PE: player: target)
 * Specifies the player(s) to display a screen title to. Must be a player name or target selector.


 * raw json title (PE: titleText: string) (, , and   mode only)
 * Specifies the text to display as a title, subtitle, or on the action bar. Must be valid raw JSON text (for example, ).


 * fadeIn, stay, and fadeOut (PE: fadeIn: int, stay: int, and fadeOut: int) ( mode only)
 * Specifies the time in game ticks (1/20ths of a second) for the screen title to fade in, stay, and fade out. All values must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas), but values below 0 will be treated as 0. If not specified (or if reset), defaults to 10 (0.5 seconds), 70 (3.5 seconds), and 20 (1 second).


 * Result


 * Fails if the arguments are not specified correctly, or if player fails to evaluate to one or more online players.


 * On success:
 * — Clears the screen title from the screens of the specified player(s). If no screen title is currently being displayed, has no effect.
 * — Resets the subtitle text to blank text, and the fade-in, stay and fade-out times to their default values for the specified player(s).
 * — If a screen title is currently being displayed to the specified player(s), changes the current subtitle to title; otherwise, specifies the subtitle for the next screen title to be displayed to the specified player(s).
 * — Changes the fade-in, stay, and fade-out times of all current and future screen titles for the specified player(s).
 * — Displays a screen title to the specified player(s), or changes the current screen title to title. After fading out, resets the subtitle back to blank text, but does not reset fade-in, stay, and fade-out times.
 * - Displays text on the action bar to the specified player(s), or changes the current action bar title.


 * Examples


 * To display a bold screen title "Chapter I" with a gray italic subtitle "The story begins…" to all players:

toggledownfall
Toggles the weather.


 * Syntax




 * Result


 * Always succeeds. If weather is currently clear, rain or snow will start. If weather is currently rain, snow, or a thunderstorm, it will become clear. Can be overridden by the command.

tp
Teleports entities (players, mobs, items, etc.).

In the Java edition, the primary difference between this command and the command is that  uses coordinates relative to the teleported targets, while  uses coordinates relative to the command's execution. In Pocket Edition, is merely a synonym for.

Although most commands can only affect chunks that have already been generated, can send entities into chunks that have yet to be generated. If this happens to a player, then the chunks around and including that player's destination will be newly generated.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * target player (PE: victim: target) (optional)
 * Specifies the entity(s) to be teleported. Must be either a player name or a target selector. If not specified, defaults to the player who executed the command. Not optional in command blocks.


 * destination player (PE: destination: target)
 * Specifies the entity to teleport the target(s) to. Must be either a player name or a target selector.


 * x y z (PE: destination: x y z)
 * Specifies the coordinates to teleport the target(s) to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be within the range -4096 to 4096, inclusive. May use tilde notation to specify a position relative to the target's current position – an exception to tilde notation's usual rule of being relative to the executor of the command.  can be used to teleport relative to executor of the command.


 * yaw (PE: x-rot: rotation) (optional)
 * Specifies the horizontal rotation (-180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of due north, before wrapping back around to -180.0). Tilde notation can be used to specify a rotation relative to the target's previous rotation.


 * pitch (PE: y-rot: rotation) (optional)
 * Specifies the vertical rotation (-90.0 for straight up to 90.0 for straight down). Tilde notation can be used to specify a rotation relative to the target's previous rotation.


 * Result


 * Fails if the arguments are not specified correctly, if target player fails to resolve to one or more entities (named players must be online), or if destination player fails to resolve to a single entity (a named player must be online). Fails individually for each entity referenced by target player that is not in the same dimension as the destination player, if specified.


 * On success, teleports the targets to the specified destination.


 * Examples


 * To teleport yourself to Alice:


 * To teleport all players to yourself:


 * To teleport yourself to x=100 and z=100, but three blocks above your current position:


 * To rotate the nearest player 10 degrees to the right without changing their position:

transferserver
Transfer player to another server.


 * Syntax




 * Arguments


 * server: string
 * Enter the specified server address. Numerical IP address must be quoted, for example:.


 * port: int
 * Enter the specified server port.


 * Result


 * Fails if there is no internet connection, invalid address, outdated server, or the server is offline.


 * On success, the player will leave the current server and connect to the specified server ip.

trigger
Modifies a scoreboard objective with a "trigger" criterion.


 * Syntax




 * Description


 * Used together with  to let players activate systems made by operators or mapmakers.


 * Arguments


 * objective
 * An enabled scoreboard objective with the "trigger" criterion.


 * add|set
 * – Adds value to the current value of objective.
 * – Sets the value of objective to value.


 * Result


 * Fails if the arguments are not specified correctly, if objective does not have the "trigger" criteria, or if the player who executed the command is not able to modify objective.


 * On success, the value of objective is changed for the player that executed the command.

weather
Sets the weather.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * clear|rain|thunder (PE: type: string)
 * – Set the weather to clear.
 * – Set the weather to rain (or snow in cold biomes).
 * – Set the weather to a thunderstorm (or a thunder snowstorm in cold biomes).


 * duration (PE: duration: int) (optional)
 * Specifies the time in seconds for the specified weather to last. Must be between 1 and 1,000,000 (inclusive, without the commas). If duration is omitted, the duration will be set between 6,000 and 18,000 ticks.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success, changes the weather for the specified duration (in seconds).


 * Examples


 * To get clear weather for one Minecraft day:


 * To make it rain, but let it end at its own pace:

whitelist
Manages the server whitelist.

Server ops will always be able to connect when the whitelist is active, even if their names do not appear in the whitelist.


 * Syntax


 * The command has six variations.




 * Arguments


 * player ( and   mode only)
 * Specifies the player(s) to add or remove from the whitelist.


 * Result


 * Fails if the arguments are not specified correctly, or if player doesn't exist


 * On success:
 * — Adds the player name to the whitelist. The player does not need to be online.
 * — Displays all player names in the whitelist.
 * — Disables the server's use of a whitelist.
 * — Enables the server's use of a whitelist.
 * — Reloads the list of player names in  (1.7.5 or earlier) or   (1.7.6 or later) from disk (used when   or   has been modified outside of Minecraft).
 * — Removes the player name from the whitelist. The player does not need to be online.

worldborder
These commands control the world border.


 * Syntax


 * The command has eight variations, each with different arguments:
 * (increases the world border diameter)
 * (recenters the world boundary)
 * (specifies the world border damage rate)
 * (specifies the world border damage buffer distance)
 * (returns the world border diameter)
 * (sets the world border diameter)
 * (specifies the world border warning distance)
 * (specifies the world border warning time)


 * Arguments


 * distance (, ,   and   modes only)
 * Specifies a distance in blocks:
 * – Specifies the number of blocks to add to the world border diameter.
 * – Specifies the distance outside the world buffer a player must be before they start taking damage. Must be at least 0.0. Initially set to 5.0.
 * – Specifies the new diameter for the world border. Must be between 1.0 and 60,000,000 (inclusive, without the commas).
 * – Specifies the distance from the world border at which players will begin to see a visual warning of the world border's proximity. Must be at least 0. Initially set to 5.


 * time (,  and   modes only)
 * Specifies a time in seconds:
 * – Specifies the number of seconds it should take for the world border to move from its current diameter to the new diameter. Must be at least 0. If not specified, defaults to 0.
 * – Specifies the number of seconds it should take for the world border to move from its current diameter to the new diameter. Must be at least 0. If not specified, defaults to 0.
 * – Specifies the number of seconds that a player will begin to see a visual warning before a moving world border passes their position. Must be at least 0. Initially set to 15.


 * x z ( mode only)
 * Specifies the horizontal coordinates of the world border's center. Must be between -30,000,000 and 30,000,000 (inclusive, without the commas). May use tilde notation to specify coordinates relative to the command's execution.


 * damagePerBlock ( mode only)
 * Specifies the damage a player takes per second per block past the world border buffer. For example, if damagePerBlock is 0.1, a player 5 blocks outside the world border buffer will take 0.5 damage per second (damage less than half a heart might not change the visual health display, but will still accumulate). Must be at least 0.0. Initially set to 0.2.


 * Result


 * Fails if the arguments are not specified correctly, or if the new world diameter will be less than 1.0 or greater than 60,000,000.


 * On success:


 * – The world border begins changing its diameter by the specified amount. If distance is positive, the world border will turn green and start increasing; if negative, the world border will turn red and start decreasing. If time is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of (distance/2)/time blocks per second.


 * – The center of the world border immediately moves to the specified coordinates.


 * – Sets the world border damage amount to the specified value. Any player outside the world border buffer will take this amount of damage per second per block past the world border buffer distance.


 * – Sets the world border buffer distance to the specified value. Players won't take damage until they move past this distance from the world border.


 * – Shows the current world border diameter in the chat.


 * – The world border begins changing its diameter to the specified value. If distance is bigger than the current diameter, the world border will turn green and start increasing; if smaller, the world border will turn red and start decreasing. If time is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of ((distance- )/2)/time blocks per second.


 * – Sets the world border warning distance to the specified value.


 * – Sets the world border warning time to the specified value.

wsserver
Stands for "WebSocket server". Used to connect to a WebSocket server which uses command messages to communicate with clients. Used primarily in Education Edition.

The command can also be used.


 * Syntax






 * Arguments


 * serverUri: string
 * A URI indicating a WebSocket server.


 * Result


 * Fails if it cannot connect to the WebSocket server.

xp
Adds experience to a player.


 * Syntax


 * Java Edition


 * Pocket Edition


 * Arguments


 * amount (PE: amount: int)
 * Specifies the amount of experience to give to the player. Must be between 0 and 2,147,483,647 (inclusive, without the commas).


 * If an  is added to the end, adds levels instead. Levels must be between -2,147,483,648 and 2,147,483,647 (inclusive, without the commas) — negative values remove levels instead of adding them.


 * player (PE: player: target) (optional)
 * Specifies the target of the command. If not specified, defaults to the command's executor. Not optional in command blocks.


 * Result


 * Fails if arguments are not specified correctly, or if player fails to resolve to one or more online players.


 * On success, adds experience or adds/removes levels. Total experience and levels will not be reduced below 0.


 * Examples


 * To give 7 experience to yourself:


 * To give 3 levels to Alice:


 * To remove all levels from all players:

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