vim-castle/.vim/vimwiki/vimwiki_html/Server Commands.html

4087 lines
99 KiB
HTML
Raw Normal View History

2015-01-14 23:41:47 +00:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="Stylesheet" type="text/css" href="style.css">
<title>Server Commands</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<h3 id="toc_0.0.1">Commands</h3>
<p>
Commands are advanced functions activated by typing certain strings of text.
Contents
</p>
<blockquote>
1 <a href="minecraft-command-Usage.html">Usage</a>
2 <a href="minecraft-command-summary.html">Summary of commands</a>
3 List of commands
3.1 <a href="minecraft-command-achievement.html">achievement</a>
3.2 <a href="minecraft-command-ban.html">ban</a>
3.2.1 ban
3.2.2 ban-ip
3.2.3 banlist
3.3 <a href="minecraft-command-blockdata.html">blockdata</a>
3.4 <a href="minecraft-command-clear.html">clear</a>
3.5 <a href="minecraft-command-clone.html">clone</a>
3.6 <a href="minecraft-command-debug.html">debug</a>
3.7 <a href="minecraft-command-defaultgamemode.html">defaultgamemode</a>
3.8 <a href="minecraft-command-deop.html">deop</a>
3.9 <a href="minecraft-command-difficulty.html">difficulty</a>
3.10 <a href="minecraft-command-effect.html">effect</a>
3.11 <a href="minecraft-command-enchant.html">enchant</a>
3.12 <a href="minecraft-command-entitydata.html">entitydata</a>
3.13 <a href="minecraft-command-execute.html">execute</a>
3.14 <a href="minecraft-command-fill.html">fill</a>
3.15 <a href="minecraft-command-gamemode.html">gamemode</a>
3.16 <a href="minecraft-command-gamerule.html">gamerule</a>
3.17 <a href="minecraft-command-give.html">give</a>
3.18 <a href="minecraft-command-help.html">help</a>
3.19 <a href="minecraft-command-kick.html">kick</a>
3.20 <a href="minecraft-command-kill.html">kill</a>
3.21 <a href="minecraft-command-list.html">list</a>
3.22 <a href="minecraft-command-me.html">me</a>
3.23 <a href="minecraft-command-op.html">op</a>
3.24 <a href="minecraft-command-pardon.html">pardon</a>
3.25 <a href="minecraft-command-particle.html">particle</a>
3.26 <a href="minecraft-command-playsound.html">playsound</a>
3.27 <a href="minecraft-command-publish.html">publish</a>
3.28 <a href="minecraft-command-replaceitem.html">replaceitem</a>
3.29 <a href="minecraft-command-save.html">save</a>
3.29.1 save-all
3.29.2 save-off
3.29.3 save-on
3.30 <a href="minecraft-command-say.html">say</a>
3.31 <a href="minecraft-command-scoreboard.html">scoreboard</a>
3.32 <a href="minecraft-command-seed.html">seed</a>
3.33 <a href="minecraft-command-setblock.html">setblock</a>
3.34 <a href="minecraft-command-setidletimeout.html">setidletimeout</a>
3.35 <a href="minecraft-command-setworldspawn.html">setworldspawn</a>
3.36 <a href="minecraft-command-spawnpoint.html">spawnpoint</a>
3.37 <a href="minecraft-command-spreadplayers.html">spreadplayers</a>
3.38 <a href="minecraft-command-stats.html">stats</a>
3.39 <a href="minecraft-command-stop.html">stop</a>
3.40 <a href="minecraft-command-summon.html">summon</a>
3.41 <a href="minecraft-command-tell.html">tell</a>
3.42 <a href="minecraft-command-tellraw.html">tellraw</a>
3.43 <a href="minecraft-command-testfor.html">testfor</a>
3.44 <a href="minecraft-command-testforblock.html">testforblock</a>
3.45 <a href="minecraft-command-testforblocks.html">testforblocks</a>
3.46 <a href="minecraft-command-time.html">time</a>
3.47 <a href="minecraft-command-title.html">title</a>
3.48 <a href="minecraft-command-toggledownfall.html">toggledownfall</a>
3.49 <a href="minecraft-command-tp.html">tp</a>
3.50 <a href="minecraft-command-trigger.html">trigger</a>
3.51 <a href="minecraft-command-weather.html">weather</a>
3.52 <a href="minecraft-command-whitelist.html">whitelist</a>
3.53 <a href="minecraft-command-worldborder.html">worldborder</a>
3.54 <a href="minecraft-command-xp.html">xp</a>
</blockquote>
<p>
List of commands
</p>
<p>
Syntax
</p>
<blockquote>
If you see… Then
plain text Enter this literally, exactly as shown.
italics Replace this with an appropriate value.
&lt;angle brackets&gt; This is a required argument.
[square brackets] This is an optional argument.
x|y
</blockquote>
<blockquote>
Pick one of the options shown.
</blockquote>
<blockquote>
Available options are shown separated by vertical bars: |
ellipsis … The argument may consist of multiple words separated by spaces.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
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.
</blockquote>
<p>
Restrictions
</p>
<blockquote>
Describes restrictions on who can use the command or in what context.
</blockquote>
<blockquote>
None: The command can be used by any player in any world. The following commands have no restrictions: /help, /me, /tell, and /trigger.
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
Multiplayer: The command is only available on a multiplayer server. The following commands are restricted to multiplayer servers: /ban, /ban-ip, /banlist, /deop, /kick, /list, /op, /pardon, /pardon-ip, /save-all, /save-off, /save-on, /setidletimeout, /stop, /whitelist.
</blockquote>
<blockquote>
No multiplayer commands permit target selectors in arguments and, except for /list, 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.
</blockquote>
<blockquote>
No command blocks: The command cannot be executed by a command block.
</blockquote>
<p>
achievement
achievement
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.7.2 (13w36a)
</p>
<p>
Gives a player an achievement or increases a statistic.
</p>
<p>
Syntax
</p>
<blockquote>
achievement &lt;give|take&gt; &lt;stat_name|*&gt; [player]
</blockquote>
<p>
Arguments
</p>
<blockquote>
stat_name
</blockquote>
<blockquote>
Must be either:
</blockquote>
<blockquote>
achievement.achievement_name, where achievement_name is a valid achievement identifier
stat.statistic_name, where statistic_name is a valid statistic identifier
</blockquote>
<ul>
<li>
to represent all achievements
</ul>
<blockquote>
player (optional)
</blockquote>
<blockquote>
Must be a player name or a target selector. If not specified, defaults to the command's executor. Not optional in command blocks.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments aren't specified properly, or if player fails to resolve to one or more online players.
</blockquote>
<blockquote>
On success, grants or removes the specified achievement(s) (and all prerequisite achievements) to the player(s) or increases/decreases the specified statistic of the player(s) by 1.
</blockquote>
<p>
Examples
</p>
<blockquote>
To grant the "Overkill" achievement to yourself: achievement give achievement.overkill
</blockquote>
<blockquote>
To grant the "Taking Inventory" achievement to Alice: achievement give achievement.openInventory Alice
</blockquote>
<blockquote>
To increase the "Mob Kills" statistic by 1 for the nearest player: achievement give stat.mobKills @p
</blockquote>
<blockquote>
To remove all achievements from all players: achievement take * @a
</blockquote>
<p>
See also
</p>
<blockquote>
Commands to modify player:
</blockquote>
<blockquote>
/effect — give player a status effect
/spawnpoint — set player's spawn location
/xp — modify player's experience or level
</blockquote>
<p>
ban
</p>
<p>
These commands manage a server banlist. The server banlist is a list of players or IP addresses that will not be allowed to connect to the server. Bans supersede any whitelisting in place.
</p>
<blockquote>
See also: /whitelist
</blockquote>
<p>
ban
ban
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Adds player to banlist.
</p>
<p>
Syntax
</p>
<blockquote>
ban &lt;name&gt; [reason …]
</blockquote>
<p>
Arguments
</p>
<blockquote>
name
</blockquote>
<blockquote>
The name of the player to be banned. Does not need to be online, or even real.
</blockquote>
<blockquote>
reason (optional)
</blockquote>
<blockquote>
Text to be displayed with the ban, to other operators and in the server logs.
</blockquote>
<p>
Result
</p>
<blockquote>
Always succeeds. The player name is added to the server banlist which prevents anyone from connecting to the server by that name.
</blockquote>
<p>
ban-ip
ban-ip
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Adds IP address to banlist.
</p>
<p>
Syntax
</p>
<blockquote>
ban-ip &lt;address|name&gt; [reason …]
</blockquote>
<p>
Arguments
</p>
<blockquote>
address|name
</blockquote>
<blockquote>
Must be a player name or an IP address.
</blockquote>
<blockquote>
reason (optional)
</blockquote>
<blockquote>
Text to be displayed with the ban, to other operators and in the server logs.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if address|name is neither a valid IP address nor the name of an online player.
</blockquote>
<blockquote>
On success, the IP address (of the online player, or the address specified) is added to the server banlist which prevents anyone from connecting to the server from that address.
</blockquote>
<p>
banlist
banlist
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Displays banlist.
</p>
<p>
Syntax
</p>
<blockquote>
banlist ips
banlist players
</blockquote>
<p>
Result
</p>
<blockquote>
Always succeeds. Displays banned IP addresses or banned players.
</blockquote>
<p>
blockdata
blockdata
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w02a)
</p>
<p>
Modifies the data tag of a block.
</p>
<p>
Syntax
</p>
<blockquote>
blockdata &lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;dataTag&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
x y z
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
dataTag
</blockquote>
<blockquote>
Specifies the data tag elements to be added to, or overwrite elements of, the specified block. Must be a compound NBT tag (for example, {CustomName:Fred}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly.
</blockquote>
<blockquote>
On success, modifies the data tag of the targeted block.
</blockquote>
<p>
Examples
</p>
<blockquote>
To change the primary power of the beacon at (0,64,0) to Haste:
</blockquote>
<blockquote>
blockdata 0 64 0 {Primary:3}
</blockquote>
<p>
See also
</p>
<blockquote>
Chunk_format#Tile_Entity_Format — defined data tags for tile entity blocks
/entitydata — changes an entity's data tag
/replaceitem — replaces items in a block's inventory
/setblock places a new block at a position
/stats — sets a block's CommandStats
</blockquote>
<p>
clear
clear
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.4.2 (12w37a)
</p>
<p>
Clears items from player inventory.
</p>
<p>
Syntax
</p>
<blockquote>
clear [player] [item] [data] [maxCount] [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
player (optional)
</blockquote>
<blockquote>
Must be a player name or a target selector. If not specified, defaults to the command's user. Not optional in command blocks.
</blockquote>
<blockquote>
item data (optional)
</blockquote>
<blockquote>
Specifies the id and data of the item to be cleared. If neither argument is specified, clears all items from the inventory. If item is specified, but not data, all items with id item are cleared, regardless of their data. data can be set to -1 to ignore data and clear all blocks of a certain id when maxCount or dataTag must be specified but data needs to be ignored.
</blockquote>
<blockquote>
maxCount (optional)
</blockquote>
<blockquote>
Specifies the maximum number of items to be cleared. If not specified, or if -1, clears all items. If 0, 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).
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
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, {display:{Name:Fred}}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if the arguments are not specified properly, if player fails to resolve to one or more online players, or if no items are removed.
</blockquote>
<blockquote>
On success, removes the specified items from the player(s).
</blockquote>
<p>
Examples
</p>
<blockquote>
To clear your entire inventory: clear
</blockquote>
<blockquote>
To clear all items from Alice's inventory: clear Alice
</blockquote>
<blockquote>
To clear all wool items from Alice's inventory: clear Alice minecraft:wool
</blockquote>
<blockquote>
To clear all orange wool items from the inventory of all players: clear @a minecraft:wool 1
</blockquote>
<blockquote>
To clear all golden swords with the "Sharpness I" enchantment from the nearest player, regardless of their damage value:
</blockquote>
<blockquote>
clear @p minecraft:golden_sword -1 -1 {ench:[{id:16s,lvl:1s}]}
</blockquote>
<p>
See also
</p>
<blockquote>
/give — give items to player
</blockquote>
<p>
clone
clone
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w03a)
</p>
<p>
Clones blocks from one region to another.
</p>
<p>
Syntax
</p>
<blockquote>
clone &lt;x1&gt; &lt;y1&gt; &lt;z1&gt; &lt;x2&gt; &lt;y2&gt; &lt;z2&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt; [maskMode] [cloneMode] [TileName]
</blockquote>
<blockquote>
The in-game help for the clone command does not list the final argument. TileName is a placeholder name for the purpose of discussion.
</blockquote>
<p>
Arguments
</p>
<blockquote>
x1 y1 z1 and x2 y2 z2
</blockquote>
<blockquote>
Specifies any two opposing corner blocks of the region to be cloned (the "source region"). May use tilde notation to specify distances relative to the command's execution.
</blockquote>
<blockquote>
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, 0 0 0 0 0 0 has a 1-block volume, and 0 0 0 1 1 1 and 1 1 1 0 0 0 both identify the same region with an 8-block volume.
</blockquote>
<blockquote>
x y z
</blockquote>
<blockquote>
Specifies the lower northwest corner (i.e., the smallest coordinates of each axis) of the region to clone to (the "destination region"). May use tilde notation to specify a distance relative to the command's execution.
</blockquote>
<blockquote>
maskMode (optional)
</blockquote>
<blockquote>
Must be one of:
</blockquote>
<blockquote>
filtered — Clone only blocks with the specified block id (see TileName below).
masked — Copy only non-air blocks. Blocks in the destination region that would otherwise be overwritten by air are left unmodified.
replace — Copy all blocks, overwriting all blocks of the destination region with the blocks from the source region.
</blockquote>
<blockquote>
If not specified, defaults to replace.
</blockquote>
<blockquote>
cloneMode (optional)
</blockquote>
<blockquote>
Must be one of:
</blockquote>
<blockquote>
force — Force the clone even if the source and destination regions overlap.
move — Clone the source region to the destination region, then replace the copied blocks with air. When used in filtered mask mode, only the cloned blocks will be replaced with air.
normal — Don't move or force. Used when TileName also needs to be specified.
</blockquote>
<blockquote>
If not specified, defaults to normal.
</blockquote>
<blockquote>
TileName (optional)
</blockquote>
<blockquote>
Specifies the block id (for example, minecraft:stone) to copy when using filtered mask mode. Not optional when using filtered mask mode.
</blockquote>
<p>
Result
</p>
<blockquote>
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.
</blockquote>
<blockquote>
On success, overwrites blocks in the destination region with blocks from the source region, leaving the source region unmodified (unless using move clone mode).
</blockquote>
<p>
See also
</p>
<blockquote>
/fill — fill a region with a block
</blockquote>
<p>
debug
debug
Restrictions
</p>
<p>
Operator
No command blocks
First introduced
</p>
<p>
1.3.1 (12w27a)
</p>
<p>
Starts or stops a debugging session.
</p>
<p>
Syntax
</p>
<blockquote>
debug &lt;start|stop&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
start
</blockquote>
<blockquote>
Starts a new debug profiling session.
</blockquote>
<blockquote>
stop
</blockquote>
<blockquote>
Stops the active debug profiling session.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if tried to start a debug session when one is already active, or if tried to stop a debug session when none is running.
</blockquote>
<blockquote>
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".
</blockquote>
<p>
defaultgamemode
defaultgamemode
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w22a)
</p>
<p>
Sets the default game mode (creative, survival, etc.) for new players entering a multiplayer server.
</p>
<p>
Syntax
</p>
<blockquote>
defaultgamemode &lt;mode&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
mode
</blockquote>
<blockquote>
Must be one of:
</blockquote>
<blockquote>
survival (can be abbreviated as s or 0) for survival mode
creative (can be abbreviated as c or 1) for creative mode
adventure (can be abbreviated as a or 2) for adventure mode
spectator (can be abbreviated as sp or 3) for spectator mode
</blockquote>
<blockquote>
"hardcore" is not a valid option for the mode argument, as it is technically not a game mode.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments aren't specified properly.
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Examples
</p>
<blockquote>
To set the default game mode to survival: defaultgamemode survival, defaultgamemode s, or defaultgamemode 0
</blockquote>
<p>
See also
</p>
<blockquote>
/gamemode changes a player's game mode
</blockquote>
<p>
deop
deop
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Revoke operator status from a player.
</p>
<p>
Syntax
</p>
<blockquote>
deop &lt;player&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies a player to remove from the list of operators. May be anything but target selectors will not evaluate and only actual player names will produce a useful result.
</blockquote>
<p>
Result
</p>
<blockquote>
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.
</blockquote>
<p>
Examples
</p>
<blockquote>
To remove Alice from the list of operators: deop Alice
</blockquote>
<p>
difficulty
difficulty
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.4.2 (12w32a)
</p>
<p>
Sets the difficulty level (peaceful, easy, etc.).
</p>
<p>
Syntax
</p>
<blockquote>
difficulty &lt;new difficulty&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
new difficulty
</blockquote>
<blockquote>
Must be one of:
</blockquote>
<blockquote>
peaceful (can be abbreviated as p or 0) for peaceful difficulty
easy (can be abbreviated as e or 1) for easy difficulty
normal (can be abbreviated as n or 2) for normal difficulty
hard (can be abbreviated as h or 3) for hard difficulty
</blockquote>
<blockquote>
"hardcore" is not a valid option for the new difficulty argument, as it is not a difficulty.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments aren't specified properly.
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Examples
</p>
<blockquote>
To change the difficulty to hard: difficulty hard, difficulty h, or difficulty 3
</blockquote>
<p>
See also
</p>
<blockquote>
/gamemode changes a player's game mode (creative, survival, etc.)
</blockquote>
<p>
effect
effect
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.5 (13w09b)
</p>
<p>
The effect command manages status effects on players and other entities.
</p>
<p>
Syntax
</p>
<blockquote>
effect &lt;player&gt; clear (removes all effects)
effect &lt;player&gt; &lt;effect&gt; [seconds] [amplifier] [hideParticles] (gives an effect)
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the target(s). Must be a player name or a target selector (@e is permitted to target entities other than players).
</blockquote>
<blockquote>
effect
</blockquote>
<blockquote>
Specifies the effect to grant. Must be a status effect id (for example, 1 or minecraft:speed).
</blockquote>
<blockquote>
seconds (optional)
</blockquote>
<blockquote>
Specifies the effect's duration in seconds. Must be between 0 and 1,000,000 (inclusive). If not specified, defaults to 30 seconds.
</blockquote>
<blockquote>
amplifier (optional)
</blockquote>
<blockquote>
Specifies the number of additional levels to add to the effect. Must be between 0 and 255 (inclusive). If not specified, defaults to 0.
</blockquote>
<blockquote>
hideParticles (optional)
</blockquote>
<blockquote>
Specifies whether the particles of the status effect should be hidden. Must be either true or false. If not specified, defaults to false.
</blockquote>
<p>
Result
</p>
<blockquote>
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 clear mode.
</blockquote>
<blockquote>
On success:
</blockquote>
<blockquote>
clear — clears all status effects from the target(s).
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Examples
</p>
<blockquote>
To grant a Speed 1 effect to the nearest player for 60 seconds: effect @p 1 60
</blockquote>
<blockquote>
To grant a Speed 3 effect to the nearest player for 60 seconds: effect @p 1 60 2
</blockquote>
<blockquote>
To clear any Haste effects from all players: effect @a 3 0
</blockquote>
<blockquote>
To clear all effects from all zombies: effect @e[type=Zombie] clear
</blockquote>
<p>
enchant
enchant
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.4.4 (1.4.4-pre)
</p>
<p>
Adds an enchantment to a player's selected item.
</p>
<p>
Syntax
</p>
<blockquote>
enchant &lt;player&gt; &lt;enchantment ID&gt; [level]
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the target(s). Must be a player name or target selector.
</blockquote>
<blockquote>
enchantment ID
</blockquote>
<blockquote>
Specifies the enchantment to be added to the item held by the target. Must be a valid enchantment ID (for example, 16 or minecraft:sharpness).
</blockquote>
<blockquote>
level (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Result
</p>
<blockquote>
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").
</blockquote>
<blockquote>
On success, adds the specified enchantment to the item held by the target.
</blockquote>
<p>
Examples
</p>
<blockquote>
To give the Infinity enchantment to all players holding a bow: enchant @a 51
</blockquote>
<p>
entitydata
entitydata
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w32b)
</p>
<p>
Modifies the data tag of an entity.
</p>
<p>
Syntax
</p>
<blockquote>
entitydata &lt;entity&gt; &lt;dataTag&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
entity
</blockquote>
<blockquote>
Specifies the entity(ies) to be modified. Must be an entity UUID or the @e target selector.
</blockquote>
<blockquote>
dataTag
</blockquote>
<blockquote>
Specifies the data tag elements to be added to, or overwrite elements of, the specified entity. Must be a compound NBT tag (for example, {CustomName:Fred}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if entity fails to resolve to one or more non-player entities (players can not be changed).
</blockquote>
<blockquote>
On success, modifies the data tag of the targeted entity(ies).
</blockquote>
<p>
Examples
</p>
<blockquote>
To prevent all current zombies from picking up loot:
</blockquote>
<blockquote>
entitydata @e[type=Zombie] {CanPickUpLoot:0}
</blockquote>
<p>
execute
execute
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w07a)
</p>
<p>
Executes a command with a different user and position.
</p>
<p>
Syntax
</p>
<blockquote>
execute &lt;entity&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;command …&gt;
</blockquote>
<blockquote>
An alternate syntax allows the command to be executed only if a specific block is detected:
</blockquote>
<blockquote>
execute &lt;entity&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt; detect &lt;x2&gt; &lt;y2&gt; &lt;z2&gt; &lt;block&gt; &lt;data&gt; &lt;command …&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
entity
</blockquote>
<blockquote>
Specifies the target to be the command's executor. Must be a player name or target selector.
</blockquote>
<blockquote>
x y z
</blockquote>
<blockquote>
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). May use tilde notation to specify distances relative to the target.
</blockquote>
<blockquote>
command
</blockquote>
<blockquote>
Specifies the command to be run. Must be a valid command.
</blockquote>
<blockquote>
x2 y2 z2 (detect mode only)
</blockquote>
<blockquote>
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).
</blockquote>
<blockquote>
block and data (detect mode only)
</blockquote>
<blockquote>
Specifies the block id and data which the block at (x2,y2,z2) must match for the command to run. block must be a valid block id (for example, minecraft:stone), and data must be a valid block data for that type of block or -1 to match any block data.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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 and data, or if the specified command fails.
</blockquote>
<blockquote>
On success, executes the specified command as if executed by the specified target(s) with operator-level permission at the specified coordinate.
</blockquote>
<p>
Examples
</p>
<blockquote>
To summon lightning bolts at the positions of every zombie:
</blockquote>
<blockquote>
execute @e[type=Zombie] ~ ~ ~ summon LightningBolt
</blockquote>
<blockquote>
To summon lightning bolts at the positions of every zombie standing on any type of sand:
</blockquote>
<blockquote>
execute @e[type=Zombie] ~ ~ ~ detect ~ ~-1 ~ minecraft:sand -1 summon LightningBolt
</blockquote>
<p>
See also
</p>
<blockquote>
/testforblock — tests for a certain block at a specified position (including specific data tags)
</blockquote>
<p>
fill
fill
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w03a)
</p>
<p>
Fills all or parts of a region with a specific block.
</p>
<p>
Syntax
</p>
<blockquote>
fill &lt;x1&gt; &lt;y1&gt; &lt;z1&gt; &lt;x2&gt; &lt;y2&gt; &lt;z2&gt; &lt;TileName&gt; [dataValue] [oldBlockHandling] [dataTag]
</blockquote>
<blockquote>
The fill command also has an optional alternate syntax when using the replace option:
</blockquote>
<blockquote>
fill &lt;x1&gt; &lt;y1&gt; &lt;z1&gt; &lt;x2&gt; &lt;y2&gt; &lt;z2&gt; &lt;TileName&gt; &lt;dataValue&gt; replace [replaceTileName] [replaceDataValue]
</blockquote>
<p>
Arguments
</p>
<blockquote>
x1 y1 z1 and x2 y2 z2
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
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, 0 0 0 0 0 0 has a 1-block volume, and 0 0 0 1 1 1 and 1 1 1 0 0 0 both identify the same region with an 8-block volume.
</blockquote>
<blockquote>
TileName
</blockquote>
<blockquote>
Specifies the block to fill the region with. Must be a block id (for example, minecraft:stone).
</blockquote>
<blockquote>
dataValue (optional)
</blockquote>
<blockquote>
Specifies the block data to use for the fill block. Must be between 0 and 15 (inclusive).
</blockquote>
<blockquote>
oldBlockHandling (optional)
</blockquote>
<blockquote>
Must be one of:
</blockquote>
<blockquote>
destroy - Replaces all blocks (including air) in the fill region with the specified block, dropping the replaced blocks and block contents as entities as if they had been mined.
hollow - 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.
keep - Replaces only air blocks in the fill region with the specified block.
outline - Replaces only blocks on the outer edge of the fill region with the specified block. Inner blocks are not affected.
replace - 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)
</blockquote>
<blockquote>
If not specified, defaults to replace.
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
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, {CustomName:Fred}). Cannot be combined with the replaceTileName and replaceDataValue arguments.
</blockquote>
<blockquote>
replaceTileName replaceDataValue (optional)
</blockquote>
<blockquote>
Arguments are only valid when oldBlockHandling is replace. 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.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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.
</blockquote>
<blockquote>
On success, changes blocks in the fill region to the specified block.
</blockquote>
<p>
gamemode
gamemode
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w16a)
</p>
<p>
Sets a player's game mode.
</p>
<p>
Syntax
</p>
<blockquote>
gamemode &lt;mode&gt; [player]
</blockquote>
<p>
Arguments
</p>
<blockquote>
mode
</blockquote>
<blockquote>
Must be one of:
</blockquote>
<blockquote>
survival (can be abbreviated as s or 0) for survival mode
creative (can be abbreviated as c or 1) for creative mode
adventure (can be abbreviated as a or 2) for adventure mode
spectator (can be abbreviated as sp or 3) for spectator mode
</blockquote>
<blockquote>
"hardcore" is not a valid option for the mode argument, as it is technically not a game mode.
</blockquote>
<blockquote>
player (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments aren't specified properly, or if player fails to resolve to one or more online players.
</blockquote>
<blockquote>
If successful, changes the game mode of the default or specified players.
</blockquote>
<p>
Examples
</p>
<blockquote>
To put yourself into creative mode: gamemode creative, gamemode c, or gamemode 1
</blockquote>
<blockquote>
To put all players into survival mode: gamemode 0 @a
</blockquote>
<p>
See also
</p>
<blockquote>
defaultgamemode sets the initial game mode for players joining the world
</blockquote>
<p>
gamerule
gamerule
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.4.2 (12w32a)
</p>
<p>
Sets or queries a game rule value.
</p>
<p>
Syntax
</p>
<blockquote>
gamerule &lt;rule name&gt; [value]
</blockquote>
<p>
Arguments
</p>
<blockquote>
rule name
</blockquote>
<blockquote>
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).
</blockquote>
<blockquote>
value (optional)
</blockquote>
<blockquote>
Specifies the value to set the game rule to. May be any value, though only true or false specified for predefined game rules will actually affect gameplay, except in the case of randomTickSpeed, where any number 0 or higher will affect gameplay (see Predefined Game Rules below).
</blockquote>
<blockquote>
Predefined Game Rules Rule Name Description Default Value
commandBlockOutput Whether command blocks should notify admins when they perform commands true
doDaylightCycle Whether time progresses true
doEntityDrops Whether entities that are not mobs should have drops true
doFireTick Whether fire should spread and naturally extinguish true
doMobLoot Whether mobs should drop items true
doMobSpawning Whether mobs should naturally spawn true
doTileDrops Whether blocks should have drops true
keepInventory Whether the player should keep items in their inventory after death false
logAdminCommands Whether to log admin commands to server log true
mobGriefing Whether creepers, zombies, endermen, ghasts, withers, rabbits, sheep, and villagers should be able to change blocks and whether villagers, zombies, skeletons, and zombie pigmen can pick up items true
naturalRegeneration 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.) true
randomTickSpeed 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 3
reducedDebugInfo Whether the debug screen shows all or reduced infomation false
sendCommandFeedback Whether the feedback from commands executed by a player should show up in chat true
showDeathMessages Whether a message appears in chat when a player dies true
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if rule name is not defined and value is not provided (i.e., attempting to query an undefined game rule).
</blockquote>
<blockquote>
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).
</blockquote>
<blockquote>
New game rules may be defined and set (by providing a value) or queried (by not providing a value).
</blockquote>
<p>
Examples
</p>
<blockquote>
To stop the day-night cycle: gamerule doDaylightCycle false
</blockquote>
<blockquote>
To stop natural healing: gamerule naturalRegeneration false
</blockquote>
<blockquote>
To define a new game rule called MyNewRule and sets its value to 10: gamerule MyNewRule 10
</blockquote>
<p>
give
give
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w16a)
</p>
<p>
Gives an item to a player.
</p>
<p>
Syntax
</p>
<blockquote>
give &lt;player&gt; &lt;item&gt; [amount] [data] [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the target to give item(s) to. Must be a player name or target selector.
</blockquote>
<blockquote>
item
</blockquote>
<blockquote>
Specifies the item to give. Must be a valid item id (for example, 256 or minecraft:iron_shovel), or block id for which items exist.
</blockquote>
<blockquote>
amount (optional)
</blockquote>
<blockquote>
Specifies the number of items to give. Must be between 1 and 64 (inclusive). If not specified, defaults to 1.
</blockquote>
<blockquote>
data (optional)
</blockquote>
<blockquote>
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 default to 0. If not specified, defaults to 0.
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
Specifies the data tag of the given item(s). Must be a compound NBT tag (for example, {display:{Name:Fred}}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if player fails to resolve to one or more online players.
</blockquote>
<blockquote>
On success, summons the specified item(s) at the location(s) of the target(s). If player resolves to multiple targets, each receives the specifed number of items. The item entity's Owner tag is set to the target and its PickupDelay tag set to 0[Verify] so the item can be picked up immediately and only by the target (if the target has room in their inventory).
</blockquote>
<p>
Examples
</p>
<blockquote>
To summon 30 blocks of spruce wood planks at John's location with Lore that says "Wooden planks":
</blockquote>
<blockquote>
give John minecraft:planks 30 1 {display:{Lore:["Wooden planks"]}}
</blockquote>
<p>
See also
</p>
<blockquote>
/summon — summon any entity at any location
</blockquote>
<p>
help
help
Restrictions
</p>
<p>
None
First introduced
</p>
<p>
1.3.1 (12w17a)
</p>
<p>
Provides help for commands.
</p>
<p>
Syntax
</p>
<blockquote>
help [page|command name]
? [page|command name]
</blockquote>
<p>
Arguments
</p>
<blockquote>
page|command name (optional)
</blockquote>
<blockquote>
Specifies the page number of the command list or the command to provide help for. If not specified, defaults to 1 (the first page of the command list).
</blockquote>
<p>
Result
</p>
<blockquote>
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.
</blockquote>
<blockquote>
On success, displays a page of the command list. Multiplayer commands will not be displayed while in singleplayer, even when open to LAN players.
</blockquote>
<blockquote>
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 Tab ↹ key) to explore available options for each argument.
</blockquote>
<p>
Examples
</p>
<blockquote>
To display the first page of the command list: ? or help
</blockquote>
<blockquote>
To display the third page of the command list: ? 3
</blockquote>
<blockquote>
To display the usage for the help command: help help
</blockquote>
<p>
kick
kick
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Kicks a player off a server.
</p>
<p>
Syntax
</p>
<blockquote>
kick &lt;player&gt; [reason …]
</blockquote>
<p>
Description
</p>
<blockquote>
Forcibly disconnects player from the server, displaying an optional reason to them.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
player must be online.
</blockquote>
<p>
kill
kill
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w16a)
</p>
<p>
Kills entities (players, mobs, items, etc.).
</p>
<p>
Syntax
</p>
<blockquote>
kill [player|entity]
</blockquote>
<p>
Arguments
</p>
<blockquote>
player|entity
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if player|entity fails to resolve to one or more entities (named players must be online).
</blockquote>
<blockquote>
On success, inflicts 1000 (Heart.svg × 500) void damage to targets — killing them instantly even if in Creative mode or protected by a high-level Resistance effect — and issues the appropriate death message.
</blockquote>
<p>
Examples
</p>
<blockquote>
To kill yourself: kill
</blockquote>
<blockquote>
To kill Bob: kill Bob
</blockquote>
<blockquote>
To "kill" all item entities (making them vanish from the world): kill @e[type=Item]
</blockquote>
<p>
list
list
Restrictions
</p>
<p>
Multiplayer
Operator
First introduced
</p>
<p>
Alpha 1.0.16_02
</p>
<p>
Lists players on the server.
</p>
<p>
Syntax
</p>
<blockquote>
list
</blockquote>
<p>
Description
</p>
<blockquote>
Shows the names of all currently-connected players (the same can be achieved when pressing tab)
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds, even in a command block.
</blockquote>
<p>
me
me
Restrictions
</p>
<p>
None
First introduced
</p>
<p>
Classic 0.0.15a_03
</p>
<p>
Displays a message about yourself.
</p>
<p>
Syntax
</p>
<blockquote>
me &lt;action …&gt;
</blockquote>
<p>
Description
</p>
<blockquote>
Sends a narrative message to the other players in the form of "* Yourname 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, name2, and name3", or "name1 and name2" for two names. Therefore, regardless of any target selectors which are used in action, this command will only output once.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
All target selectors (e.g., @p) in action must evaluate.
</blockquote>
<p>
op
op
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Grants operator status to a player.
</p>
<p>
Syntax
</p>
<blockquote>
op &lt;player&gt;
</blockquote>
<p>
Description
</p>
<blockquote>
Grants player operator status on the server.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds.
</blockquote>
<p>
pardon
pardon, pardon-ip
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Removes entries from the banlist.
</p>
<p>
Syntax
</p>
<blockquote>
pardon &lt;name&gt;
pardon-ip &lt;address&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
name
</blockquote>
<blockquote>
Specifies the name to remove from the banlist.
</blockquote>
<blockquote>
address
</blockquote>
<blockquote>
Specifies the IP address to remove from the banlist. Must be a valid IP address.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly.
</blockquote>
<blockquote>
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.
</blockquote>
<p>
particle
particle
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w04a)
</p>
<p>
Creates particles.
</p>
<p>
Syntax
</p>
<blockquote>
particle &lt;name&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;xd&gt; &lt;yd&gt; &lt;zd&gt; &lt;speed&gt; [count] [mode]
</blockquote>
<p>
Arguments
</p>
<blockquote>
name
</blockquote>
<blockquote>
Specifies the particle to create. Must be a particle name (for example, explode).
</blockquote>
<blockquote>
x y z
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
xd yd zd
</blockquote>
<blockquote>
Specifies the size of the area to spawn particles in.
</blockquote>
<blockquote>
Exception: When name is reddust, mobSpell, or mobSpellAmbient and count is 0 or not specified, specifies the color of the particle in RGB format offset from the particle's default color (reddust's default is a near-red (a random red tint between 0.8 and 1.0), while the others default to black). For example, with reddust, 0 0 0 produces a red particle, -1 1 0 produces a green particle (red is reduced to 0 and green increased to 1), 0 0 1 produces a purple particle (blue is added to the original red), etc. With mobSpell or mobSpellAmbient, 0 0 0 produces a black particle, 0 1 0 produces a green particle, 0 0 0.5 produces a dark blue particle, etc. If count is greater than 0, colors are randomized.
</blockquote>
<blockquote>
speed
</blockquote>
<blockquote>
Specifies the speed of the particle. Must be at least 0.
</blockquote>
<blockquote>
count (optional)
</blockquote>
<blockquote>
Specifies the number of particle effects to create. Must be at least 0 (which produces one particle).
</blockquote>
<blockquote>
mode (optional)
</blockquote>
<blockquote>
Specifies the display mode. May be anything but only force will have an effect: to allow the particle(s) to be seen beyond the usual 16 block radius.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly.
</blockquote>
<blockquote>
On success, creates the specified particle.
</blockquote>
<p>
Examples
</p>
<blockquote>
To create a stationary huge explosion particle 10 blocks to the east:
</blockquote>
<blockquote>
particle hugeexplosion ~10 ~ ~ 0 0 0 0
</blockquote>
<p>
playsound
playsound
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.6.1 (1.6.1-pre)
</p>
<p>
Plays a sound.
</p>
<p>
Syntax
</p>
<blockquote>
playsound &lt;sound&gt; &lt;player&gt; [x] [y] [z] [volume] [pitch] [minimumVolume]
</blockquote>
<p>
Arguments
</p>
<blockquote>
sound
</blockquote>
<blockquote>
Specifies the sound to play. Must be a sound event defined in sounds.json (for example, mob.pig.say).
</blockquote>
<blockquote>
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 mob.pig.say sound event will play one of several pig sounds at random, because the event has multiple sounds associated with it.
</blockquote>
<blockquote>
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).
</blockquote>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the sound's target. Must be a player name or a target selector.
</blockquote>
<blockquote>
x y z (optional)
</blockquote>
<blockquote>
Specifies the position to play the sounds from. May use tilde notation to specify a position relative to the target(s).
</blockquote>
<blockquote>
volume (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
pitch (optional)
</blockquote>
<blockquote>
Specifies the pitch of the sound. Must be between 0.0 and 2.0 (inclusive) — 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 minimum pitch is 0.5; smaller values will result in identical sounds. If not specified, defaults to 1.0.
</blockquote>
<blockquote>
minimumVolume (optional)
</blockquote>
<blockquote>
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 minimumVolume will determine its volume. Must be between 0.0 and 1.0 (inclusive).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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.
</blockquote>
<blockquote>
On success, plays a sound for the targeted players.
</blockquote>
<p>
publish
publish
Restrictions
</p>
<p>
Operator
No command blocks
First introduced
</p>
<p>
1.3.1 (12w24a)
</p>
<p>
Opens single-player world to the local network.
</p>
<p>
Syntax
</p>
<blockquote>
publish
</blockquote>
<p>
Description
</p>
<blockquote>
Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Cannot be used in a command block.
</blockquote>
<p>
replaceitem
replaceitem
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w26a)
</p>
<p>
Replaces items in the inventories of blocks (chest, furnaces, etc.) or entities (players or mobs).
</p>
<p>
Syntax
</p>
<blockquote>
replaceitem block &lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;slot&gt; &lt;item&gt; [amount] [data] [dataTag]
replaceitem entity &lt;selector&gt; &lt;slot&gt; &lt;item&gt; [amount] [data] [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
x y z (block mode only)
</blockquote>
<blockquote>
Specifies the position of the block to be modified. May use tilde notation to specify a position relative to the command's execution.
</blockquote>
<blockquote>
selector (entity mode only)
</blockquote>
<blockquote>
Specifies the entity to modify. Must be a player name or target selector.
</blockquote>
<blockquote>
slot
</blockquote>
<blockquote>
Specifies the inventory slot to be modified. Valid values depend on whether a block or an entity is being modified.
</blockquote>
<blockquote>
For blocks, must be slot.container.slot_number where slot_number is replaced with a number specifying the slot.
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
Other blocks which hold items but don't have inventory GUIs (flower pots and jukeboxes) can only be changed with /blockdata.
</blockquote>
<blockquote>
For entities, must be one of the following, where slot_number is replaced with a number specifying the slot:
</blockquote>
<blockquote>
Slot Slot Numbers Restrictions
slot.armor.chest armor stands, mobs, and players only (though not all mobs will show or make use of the items)
slot.armor.feet
slot.armor.head
slot.armor.legs
slot.weapon armor stands and mobs only (though not all mobs will show or make use of the items)
slot.enderchest.slot_number 0 to 26 players only
slot.hotbar.slot_number 0 to 8
slot.inventory.slot_number 0 to 26
slot.horse.saddle horses, donkeys, and mules only; item must be a saddle
slot.horse.armor horses only; item must be a type of horse armor
slot.horse.chest.slot_number 2 to 16 donkeys and mules with chests only
slot.villager.slot_number 0 to 7 villagers only
</blockquote>
<blockquote>
The inventory of an item frame can only be changed with /entitydata.
</blockquote>
<blockquote>
item
</blockquote>
<blockquote>
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, minecraft:golden_sword).
</blockquote>
<blockquote>
amount (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
data (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
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, {display:{Name:Fred}}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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 the targeted entity does not have the specified slot (for example, zombies don't have slot.horse.armor).
</blockquote>
<blockquote>
On success, replaces the items in the specified slot with the specified items (previous items in that slot are lost).
</blockquote>
<p>
Examples
</p>
<blockquote>
To replace the items in the bottom-right slot of a single chest one block above with four spruce saplings:
</blockquote>
<blockquote>
replaceitem block ~ ~1 ~ slot.container.26 minecraft:sapling 4 1
</blockquote>
<blockquote>
To replace the items in the rightmost hotbar slot of the nearest player with four spruce saplings:
</blockquote>
<blockquote>
replaceitem entity @p slot.hotbar.8 minecraft:sapling 4 1
</blockquote>
<p>
See also
</p>
<blockquote>
/blockdata — can also replace items in a container
/entitydata — can also replace items in a mob's inventory, or modify the drop chances of armor and weapons
/give — give items to players without specifying specific inventory slots or overwriting other items
</blockquote>
<p>
save
save
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16_01
</p>
<p>
These commands manage server saves.
</p>
<p>
save-all
</p>
<p>
Saves the server to disk.
</p>
<p>
Syntax
</p>
<blockquote>
save-all
</blockquote>
<p>
Description
</p>
<blockquote>
Forces the server to write all pending changes to the world and player data to disk.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds.
</blockquote>
<p>
save-off
</p>
<p>
Disables automatic server saves.
</p>
<p>
Syntax
</p>
<blockquote>
save-off
</blockquote>
<p>
Description
</p>
<blockquote>
Disables the server writing to the world files. All changes will temporarily be queued.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds.
</blockquote>
<p>
save-on
</p>
<p>
Enables automatic server saves.
</p>
<p>
Syntax
</p>
<blockquote>
save-on
</blockquote>
<p>
Description
</p>
<blockquote>
Enables the server writing to the world files. This is the default behavior.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds.
</blockquote>
<p>
say
say
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
Classic 0.0.16a_01
</p>
<p>
Says a message to multiple players.
</p>
<p>
Syntax
</p>
<blockquote>
say &lt;message …&gt;
</blockquote>
<p>
Description
</p>
<blockquote>
Broadcasts message to all players on the server. If a multi-person target selector (e.g., @a) is used, the list of names is formatted as "name1, name2, and name3", or "name1 and name2" for two names. Therefore, regardless of any target selectors which are used, this command will only output once.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
All target selectors (e.g., @p) in the message must evaluate.
</blockquote>
<p>
scoreboard
scoreboard
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.5 (13w04a)
</p>
<p>
These commands manage scoreboard objectives, players, and teams.
</p>
<p>
Syntax
</p>
<blockquote>
scoreboard &lt;objectives|players|teams&gt;
</blockquote>
<p>
See Scoreboard#Command reference for more information.
</p>
<p>
seed
seed
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w21a)
</p>
<p>
Displays the world seed.
</p>
<p>
Syntax
</p>
<blockquote>
seed
</blockquote>
<p>
Description
</p>
<blockquote>
Displays the seed. This command can always be used in single-player mode, regardless of whether cheats are enabled or not.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds (if user is a command block, player in singleplayer, or server op).
</blockquote>
<p>
setblock
setblock
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.7.2 (13w37a)
</p>
<p>
Changes a block to another block.
</p>
<p>
Syntax
</p>
<blockquote>
setblock &lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;TileName&gt; [dataValue] [oldBlockHandling] [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
x y z
</blockquote>
<blockquote>
Specifies the position of the block to be changed. May use tilde notation to specify a position relative to the command's execution.
</blockquote>
<blockquote>
TileName
</blockquote>
<blockquote>
Specifies the new block. Must be a block id (for example, minecraft:stone).
</blockquote>
<blockquote>
dataValue (optional)
</blockquote>
<blockquote>
Specifies additional data to further describe the new block. Must be between 0 and 15 (inclusive). If not specified, defaults to 0.
</blockquote>
<blockquote>
oldBlockHandling (optional)
</blockquote>
<blockquote>
Specifies how to handle the block change. Must be one of:
</blockquote>
<blockquote>
destroy — The old block drops both itself and its contents (as if destroyed by a player). Plays the appropriate block breaking noise.
keep — Only air blocks will be changed (non-air blocks will be "kept").
replace — The old block drops neither itself nor any contents. Plays no sound.
</blockquote>
<blockquote>
If not specified, defaults to replace.
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
Specifies the data tag for the new block. Must be a compound NBT tag (for example, {CustomName:Fred}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, if tried to change a non-air block in keep mode, or tried to replace a block with an identical copy in keep or replace mode.
</blockquote>
<blockquote>
On success, changes the block at the specified position.
</blockquote>
<p>
See also
</p>
<blockquote>
/blockdata — modifies the data tags of a block
/clone — copies blocks from one region to another
/fill — fills a region with a block
</blockquote>
<p>
setidletimeout
setidletimeout
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Classic 0.0.15a_03
</p>
<p>
Sets the time before idle players are kicked from the server.
</p>
<p>
Syntax
</p>
<blockquote>
setidletimeout &lt;Minutes until kick&gt;
</blockquote>
<p>
Description
</p>
<blockquote>
Set the idle kick timer. Any players idle for Minutes until kick will be kicked.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds.
</blockquote>
<p>
setworldspawn
setworldspawn
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.7.2 (13w43a)
</p>
<p>
Sets the world spawn.
</p>
<p>
Syntax
</p>
<blockquote>
setworldspawn
setworldspawn &lt;x&gt; &lt;y&gt; &lt;z&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
x y z (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
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 undergound 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.
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified correctly.
</blockquote>
<blockquote>
On success, sets the world spawn to the specified coordinate.
</blockquote>
<p>
spawnpoint
spawnpoint
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.4.2 (12w32a)
</p>
<p>
Sets the spawn point for a player.
</p>
<p>
Syntax
</p>
<blockquote>
spawnpoint
spawnpoint &lt;player&gt;
spawnpoint &lt;player&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
player (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
x y z (optional)
</blockquote>
<blockquote>
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).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified correctly, or if player fails to resolve to one or more online players.
</blockquote>
<blockquote>
On success, sets the spawn point of the targeted player(s) to the specified coordinate.
</blockquote>
<p>
spreadplayers
spreadplayers
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.6.1 (13w23a)
</p>
<p>
Teleports entities (players, mobs, items, etc.) to random surface locations within an area.
</p>
<p>
Syntax
</p>
<blockquote>
spreadplayers &lt;x&gt; &lt;z&gt; &lt;spreadDistance&gt; &lt;maxRange&gt; &lt;respectTeams&gt; &lt;player …&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
x z
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
spreadDistance
</blockquote>
<blockquote>
Specifies the minimum distance between targets. Must be at least 0.0.
</blockquote>
<blockquote>
maxRange
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
respectTeams
</blockquote>
<blockquote>
Specifies whether to keep teams together. Must be true or false. If true, targets on the same team will be teleported to the same location.
</blockquote>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the targets to spread. Must be one or more player names and/or target selectors separated by spaces (@e is permitted to target entities other than players).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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.
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Examples
</p>
<blockquote>
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:
</blockquote>
<blockquote>
spreadplayers 0 0 200 500 true @a
</blockquote>
<blockquote>
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:
</blockquote>
<blockquote>
spreadplayers 0 0 50 100 false @r[team=Red] @r[team=Blue] @r[team=Green] Alice Bob
</blockquote>
<p>
See also
</p>
<blockquote>
/tp — teleports a single player or entity to a specific position (even underground).
</blockquote>
<p>
stats
stats
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w28a)
</p>
<p>
Manages the updating of scoreboard objectives with the results of other commands.
</p>
<p>
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 /execute 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 /time query daytime).
</p>
<p>
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, @e) 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.
</p>
<p>
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.
</p>
<blockquote>
See also: Tutorials/Command stats
</blockquote>
<p>
Syntax
</p>
<blockquote>
stats block &lt;x&gt; &lt;y&gt; &lt;z&gt; clear &lt;stat&gt;
stats block &lt;x&gt; &lt;y&gt; &lt;z&gt; set &lt;stat&gt; &lt;selector&gt; &lt;objective&gt;
stats entity &lt;selector2&gt; clear &lt;stat&gt;
stats entity &lt;selector2&gt; set &lt;stat&gt; &lt;selector&gt; &lt;objective&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
x y z (block mode only)
</blockquote>
<blockquote>
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 256 (inclusive). May use tilde notation to specify a position relative to the command's execution.
</blockquote>
<blockquote>
selector2 (entity mode only)
</blockquote>
<blockquote>
Specifies the entity to post command stats from. Must be a player name or a target selector.
</blockquote>
<blockquote>
stat
</blockquote>
<blockquote>
Specifies the command stat whose selector and objective are to be cleared or set. Must be one of:
</blockquote>
<blockquote>
AffectedBlocks — returns the number of blocks affected by a command
AffectedEntities — returns the number of entities affected by a command
AffectedItems — returns the number of items affected by a command
QueryResult — returns the result of a command query
SuccessCount — returns a command's success count
</blockquote>
<blockquote>
selector (set mode only)
</blockquote>
<blockquote>
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).
</blockquote>
<blockquote>
objective (set mode only)
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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).
</blockquote>
<blockquote>
On success, clears or sets the selector and objective to be updated with the result returned by stat.
</blockquote>
<p>
Examples
</p>
<blockquote>
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:
</blockquote>
<blockquote>
stats block 0 64 0 set QueryResult @p MyObj
</blockquote>
<blockquote>
To stop the block at (0,64,0) from updating any scoreboard obectives with the success count of commands it executes:
</blockquote>
<blockquote>
stats block 0 64 0 clear SuccessCount
</blockquote>
<blockquote>
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:
</blockquote>
<blockquote>
stats entity @e[type=WitherSkull,c=1] set AffectedBlocks #FakePlayer NumBlocks
</blockquote>
<p>
See also
</p>
<blockquote>
/blockdata — can also change the selector and objectives of blocks by altering data tags directly
/entitydata — can also change the selector and objectives of entities by altering data tags directly
</blockquote>
<p>
stop
stop
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Alpha 1.0.16
</p>
<p>
Stops a server.
</p>
<p>
Syntax
</p>
<blockquote>
stop
</blockquote>
<p>
Description
</p>
<blockquote>
Saves all changes to disk, then shuts down the server.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
Always succeeds.
</blockquote>
<p>
summon
summon
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.7.2 (13w36a)
</p>
<p>
Summons an entity (mobs, projectiles, items, vehicles, etc.).
</p>
<p>
Syntax
</p>
<blockquote>
summon &lt;EntityName&gt; [x] [y] [z] [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
EntityName
</blockquote>
<blockquote>
Specifies the entity to be summoned. Must be an entity id (for example, Bat, EntityHorse, WitherSkull, XPOrb, PrimedTNT, etc.) or LightningBolt.
</blockquote>
<blockquote>
x y z (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
Specifies the data tag for the entity. Must be a compound NBT tag (for example, {CustomName:Fred}). Lightning has no additional data tags that can be specified.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly.
</blockquote>
<blockquote>
On success, creates the specified entity at the specified position.
</blockquote>
<p>
Examples
</p>
<blockquote>
To summon a charged creeper named "Powered Creeper" at the current position:
</blockquote>
<blockquote>
summon Creeper ~ ~ ~ {powered:1,CustomName:Powered Creeper}
</blockquote>
<blockquote>
To summon lightning 10 blocks west of the current position:
</blockquote>
<blockquote>
summon LightningBolt ~-10 ~ ~
</blockquote>
<blockquote>
To summon an Armor stand wielding a lava bucket and wearing a skull:
</blockquote>
<blockquote>
/summon ArmorStand ~ ~ ~ {Equipment:[{id:lava_bucket},{},{},{},{id:skull}]}
</blockquote>
<p>
tell
tell
Restrictions
</p>
<p>
None
First introduced
</p>
<p>
Alpha 1.0.16_02
</p>
<p>
Sends a private message to one or more players.
</p>
<p>
Syntax
</p>
<blockquote>
tell &lt;player&gt; &lt;private message …&gt;
msg &lt;player&gt; &lt;private message …&gt;
w &lt;player&gt; &lt;private message …&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
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).
</blockquote>
<blockquote>
private message
</blockquote>
<blockquote>
Specifies the message to send. May include spaces (as well as target selectors, but only if run from the server console — in other words, from the computer running the server, or by remote access to it).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if any target selectors in either argument fail to resolve to at least one online player, or if a named player is not online.
</blockquote>
<blockquote>
On success, only the targeted player(s) see the private message in their chat.
</blockquote>
<blockquote>
Any target selectors in the private message will each resolve to one or more player names (as "name" for a single player, "name1 and name2" for two players, or "name1, name2, …, and nameN" for N players, without the quotes).
</blockquote>
<p>
Examples
</p>
<blockquote>
To privately tell Alice to start the mission: tell Alice Start the mission!
</blockquote>
<p>
tellraw
tellraw
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.7.2 (13w37a)
</p>
<p>
Sends a JSON message to players.
</p>
<p>
Syntax
</p>
<blockquote>
tellraw &lt;player&gt; &lt;raw json message&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the player(s) to send the message to. Must be a player name or target selector.
</blockquote>
<blockquote>
raw json message
</blockquote>
<blockquote>
Specifies the message to send. Must be valid raw JSON text (for example, {text:"Hi there!",bold:true}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if player fails to evaluate to one or more online players.
</blockquote>
<blockquote>
On success, the targeted players receive the JSON message in their chat.
</blockquote>
<p>
See also
</p>
<blockquote>
/say — send a simple text message to all players
/tell — send a simple text message to specific players
</blockquote>
<p>
testfor
testfor
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.5 (13w03a)
</p>
<p>
Counts entities (players, mobs, items, etc.) matching specified conditions.
</p>
<p>
Syntax
</p>
<blockquote>
testfor &lt;player&gt; [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the targets to count. Must be a player name or a target selector (@e is permitted to target entities other than players).
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
Specifies the data tags the entities must have to match successfully. Must be a compound NBT tag (for example, {XpLevel:3}).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if player fails to resolve to one or more entities (named players must be online).
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Examples
</p>
<blockquote>
To test if Alice is online: testfor Alice
</blockquote>
<blockquote>
To count the number of players in survival mode within a 3-block radius of (0,64,0): testfor @a[0,64,0,3,m=0]
</blockquote>
<blockquote>
To count the number of players currently flying: testfor @a {abilities:{flying:1b}}
</blockquote>
<blockquote>
To count the number of zombies within a 20-block radius of (0,64,0): testfor @e[0,64,0,20,type=Zombie]
</blockquote>
<p>
testforblock
testforblock
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.7.2 (13w37a)
</p>
<p>
Tests whether a certain block is in a specific location.
</p>
<p>
Syntax
</p>
<blockquote>
testforblock &lt;x&gt; &lt;y&gt; &lt;z&gt; &lt;TileName&gt; [dataValue] [dataTag]
</blockquote>
<p>
Arguments
</p>
<blockquote>
x y z
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
TileName
</blockquote>
<blockquote>
Specifies the block to test for. Must be a valid block id (for example, minecraft:stone).
</blockquote>
<blockquote>
dataValue (optional)
</blockquote>
<blockquote>
Specifies the block data to test for. dataValue must be between -1 and 15 (inclusive). If not specified, or if -1, dataValue matches any block data value.
</blockquote>
<blockquote>
dataTag (optional)
</blockquote>
<blockquote>
Specifies the block data tags to test for. Must be a compound NBT tag (for example, {CustomName:Fred}). If not specified, dataTag matches any block data tag.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, 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).
</blockquote>
<blockquote>
On success, returns a success count of 1.
</blockquote>
<p>
Examples
</p>
<blockquote>
To test if the block at (0,64,0) is any type of wool:
</blockquote>
<blockquote>
testforblock 0 64 0 minecraft:wool
testforblock 0 64 0 minecraft:wool -1
</blockquote>
<blockquote>
To test if the block at (0,64,0) is orange wool:
</blockquote>
<blockquote>
testforblock 0 64 0 minecraft:wool 1
</blockquote>
<blockquote>
To test if the block below is a jukebox with the "mall" record inside:
</blockquote>
<blockquote>
testforblock ~ ~-1 ~ minecraft:jukebox -1 {Record:2261}
</blockquote>
<p>
testforblocks
testforblocks
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w07a)
</p>
<p>
Tests whether the blocks in two regions match.
</p>
<p>
Syntax
</p>
<blockquote>
testforblocks &lt;x1&gt; &lt;y1&gt; &lt;z1&gt; &lt;x2&gt; &lt;y2&gt; &lt;z2&gt; &lt;x&gt; &lt;y&gt; &lt;z&gt; [mode]
</blockquote>
<p>
Arguments
</p>
<blockquote>
x1 y1 z1 and x2 y2 z2
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
x y z
</blockquote>
<blockquote>
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 254 (inclusive). May use tilde notation to specify coordinates relative to the command's position. Source and destination regions may overlap.
</blockquote>
<blockquote>
mode (optional)
</blockquote>
<blockquote>
Specifies how to match blocks. Must be one of:
</blockquote>
<blockquote>
all — every block in the source and destination regions must match exactly.
masked — air blocks in the source region will match any block in the destination region.
</blockquote>
<blockquote>
If not specified, defaults to all.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if the source and destination regions do not match.
</blockquote>
<blockquote>
On success, returns the number of matching blocks (the total number of blocks in all mode, or the number of source region non-air blocks in masked mode).
</blockquote>
<p>
time
time
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w16a)
</p>
<p>
Changes or queries the world's game time.
</p>
<p>
Syntax
</p>
<blockquote>
time &lt;add|query|set&gt; &lt;value&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
value
</blockquote>
<blockquote>
Specifies the time to add, query, or set:
</blockquote>
<blockquote>
add - Must be between 0 and 2,147,483,647 (inclusive, without the commas)
query - Must be daytime or gametime.
set - Must be between 0 and 2,147,483,647 (inclusive, without the commas), day, or night.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly.
</blockquote>
<blockquote>
On success:
</blockquote>
<blockquote>
add - adds value to the world's game time
query - returns the day time (game ticks since midnight) or the game time (game ticks since world start)
set - sets the world game time to value (day = 1,000, night = 13,000).
</blockquote>
<p>
Examples
</p>
<blockquote>
To set the time to 1,000: time set 1000 or time set day
</blockquote>
<blockquote>
To add one day to the world time: time add 24000
</blockquote>
<p>
title
title
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w20a)
</p>
<p>
Manages screen titles.
</p>
<p>
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 can include 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).
</p>
<p>
Syntax
</p>
<blockquote>
The command has five variations, each with different arguments.
</blockquote>
<blockquote>
title &lt;player&gt; clear (removes a screen title from the screen)
title &lt;player&gt; reset (resets options to default values)
title &lt;player&gt; subtitle &lt;raw json title&gt; (specifies the subtitle text)
title &lt;player&gt; times &lt;fadeIn&gt; &lt;stay&gt; &lt;fadeOut&gt; (specifies fade-in, stay, and fade-out times)
title &lt;player&gt; title &lt;raw json title&gt; (displays the screen title)
</blockquote>
<p>
Arguments
</p>
<blockquote>
player
</blockquote>
<blockquote>
Specifies the player(s) to display a screen title to. Must be a player name or target selector.
</blockquote>
<blockquote>
raw json title (subtitle and title mode only)
</blockquote>
<blockquote>
Specifies the text to display as a title or subtitle. Must be valid raw JSON text (for example, {text:"Chapter I",bold:true}).
</blockquote>
<blockquote>
fadeIn, stay, and fadeOut (times mode only)
</blockquote>
<blockquote>
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), default to 20 (1 second), 60 (3 seconds), and 20 (1 second).
</blockquote>
<p>
Result
</p>
<p>
Example result of the title command.
</p>
<blockquote>
Fails if arguments are not specified properly, or if player fails to evaluate to one or more online players.
</blockquote>
<blockquote>
On success:
</blockquote>
<blockquote>
clear — Clears the screen title from the screens of the specified player(s). If no screen title is currently being displayed, has no effect.
reset — Resets the subtitle text to blank text, the fade-in time to 20 (1 second fade-in), the stay time to 60 (3 seconds), and the fade-out time to 20 (1 second fade-out) for the specified player(s).
subtitle — If a screen title is currently being displayed to the specified player(s), changes the currently-displayed subtitle to the new specified text; otherwise, specifies the subtitle for the next screen title to be displayed to the specified player(s).
times — If a screen title is currently being displayed to the specified player(s), changes the fade-in, stay, and fade-out times of the current screen title (and of all future screen titles); otherwise, specifies the times for future screen titles to be displayed to the specified player(s).
title — Displays the specified text to the specified player(s), or changes the currently-displayed text to the new specified text. After fade-out, resets the subtitle back to blank text, but does not reset fade-in, stay, and fade-out times.
</blockquote>
<p>
Examples
</p>
<blockquote>
To display a bold screen title "Chapter I" with a gray italic subtitle "The story begins…" to all players:
</blockquote>
<blockquote>
title @a subtitle {text:"The story begins…",color:gray,italic:true}
title @a title {text:"Chapter I",bold:true}
</blockquote>
<p>
toggledownfall
toggledownfall
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w16a)
</p>
<p>
Toggles the weather.
</p>
<p>
Syntax
</p>
<blockquote>
toggledownfall
</blockquote>
<p>
Result
</p>
<blockquote>
Always succeeds. If weather is currently clear, rain or snow will start. If weather is currently rain or snow, it will stop.
</blockquote>
<p>
tp
tp
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
Alpha 1.0.16_01
</p>
<p>
Teleports entities (players, mobs, items, etc.).
</p>
<p>
Syntax
</p>
<blockquote>
tp [target player] &lt;destination player&gt;
tp [target player] &lt;x&gt; &lt;y&gt; &lt;z&gt; [&lt;y-rot&gt; &lt;x-rot&gt;]
</blockquote>
<p>
Arguments
</p>
<blockquote>
target player (optional)
</blockquote>
<blockquote>
Specifies the targets to be teleported. Must be either a player name or a target selector (@e is permitted to target entities other than players). If not specified, defaults to the command's user. Not optional in command blocks.
</blockquote>
<blockquote>
destination player
</blockquote>
<blockquote>
Specifies the targets to teleport the target player to. Must be either a player name or a target selector (@e is permitted to target entities other than players).
</blockquote>
<blockquote>
x y z
</blockquote>
<blockquote>
Specifies the coordinates to teleport the targets to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be at least 0. May use tilde notation to specify a position relative to the target's current position.
</blockquote>
<blockquote>
y-rot (optional)
</blockquote>
<blockquote>
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 north, before wrapping back around to -180.0). Tilde notation can be used to specify a rotation relative to the target's previous rotation.
</blockquote>
<blockquote>
x-rot (optional)
</blockquote>
<blockquote>
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.
</blockquote>
<p>
Result
</p>
<blockquote>
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 fail to resolve to a single entity (a named player must be online).
</blockquote>
<blockquote>
On success, teleports the targets to the specified destination.
</blockquote>
<p>
Examples
</p>
<blockquote>
To teleport yourself to Alice: tp Alice
</blockquote>
<blockquote>
To teleport all players to yourself: tp @a @p
</blockquote>
<blockquote>
To teleport yourself to (x,z) = (100,100) but three blocks above your current position: tp 100 ~3 100
</blockquote>
<blockquote>
To rotate the nearest player 10 degrees to the right without changing their position: tp @p ~ ~ ~ ~10 ~
</blockquote>
<p>
trigger
trigger
Restrictions
</p>
<p>
None
First introduced
</p>
<p>
1.8 (14w06a)
</p>
<p>
Sets a trigger to be activated.
</p>
<p>
Syntax
</p>
<blockquote>
trigger &lt;objective&gt; &lt;add|set&gt; &lt;value&gt;
</blockquote>
<p>
Description
</p>
<blockquote>
Used together with /tellraw to let players activate systems made by operators or mapmakers. The objective must be an enabled scoreboard objective of the criteria "trigger". The given value is either added to its existing value, or becomes its new value, depending on whether the second argument is add or set. The value of the objective is only changed for the player who uses the command.
</blockquote>
<p>
Success Conditions
</p>
<blockquote>
objective must have the "trigger" criteria and the player who is running the command must be able to modify objective.
</blockquote>
<p>
weather
weather
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.4.2 (12w32a)
</p>
<p>
Sets the weather.
</p>
<p>
Syntax
</p>
<blockquote>
weather &lt;clear|rain|thunder&gt; [duration in seconds]
</blockquote>
<p>
Arguments
</p>
<blockquote>
clear
</blockquote>
<blockquote>
Specifies to set the weather to clear weather.
</blockquote>
<blockquote>
rain
</blockquote>
<blockquote>
Specifies to set the weather to rain (or snow in cold biomes).
</blockquote>
<blockquote>
thunder
</blockquote>
<blockquote>
Specifies to set the weather to a thunderstorm (or a thunder snowstorm in cold biomes).
</blockquote>
<blockquote>
duration in seconds
</blockquote>
<blockquote>
Specifies the time for the specified weather to last. Must be between 1 and 1,000,000 (inclusive, without the commas).
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly.
</blockquote>
<blockquote>
On success, changes the weather for the specified duration (in seconds).
</blockquote>
<p>
Examples
</p>
<blockquote>
To get clear weather for one Minecraft day: weather clear 1200
</blockquote>
<blockquote>
To make it rain, but let it end at its own pace: weather rain 1
</blockquote>
<p>
whitelist
whitelist
Restrictions
</p>
<p>
Multiplayer
Operator
No command blocks
First introduced
</p>
<p>
Beta 1.3
</p>
<p>
Manages the server whitelist.
</p>
<p>
Server ops will always be able to connect when the whitelist is active, even if their names do not appear in the whitelist.
</p>
<p>
Syntax
</p>
<blockquote>
The command has six variations.
</blockquote>
<blockquote>
whitelist add &lt;player&gt;
whitelist list
whitelist off
whitelist on
whitelist reload
whitelist remove &lt;player&gt;
</blockquote>
<p>
Arguments
</p>
<blockquote>
player (add and remove mode only)
</blockquote>
<blockquote>
Specifies the player(s) to add or remove from the whitelist.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if player doesn't exist
</blockquote>
<blockquote>
On success:
</blockquote>
<blockquote>
add — Adds the player name to the whitelist. The player does not need to be online.
list — Displays all player names in the whitelist.
off — Disables the server's use of a whitelist.
on — Enables the server's use of a whitelist.
reload — Reloads the list of player names in white-list.txt (1.7.5 or earlier) or whitelist.json (1.7.6 or later) from disk (used when white-list.txt or whitelist.json has been modified outside of Minecraft).
remove — Removes the player name from the whitelist. The player does not need to be online.
</blockquote>
<p>
worldborder
worldborder
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.8 (14w17a)
</p>
<p>
These commands manage the world border.
</p>
<p>
Syntax
</p>
<blockquote>
The command has eight variations, each with different arguments:
worldborder add &lt;sizeInBlocks&gt; [timeInSeconds] (increases the world border diameter)
worldborder center &lt;x&gt; &lt;z&gt; (recenters the world boundary)
worldborder damage amount &lt;damagePerBlock&gt; (specifies world border damage rate)
worldborder damage buffer &lt;sizeInBlocks&gt; (specifies world border damage buffer distance)
worldborder get (returns the world border diameter)
worldborder set &lt;sizeInBlocks&gt; [timeInSeconds] (sets the world border size and speed)
worldborder warning distance &lt;blocks&gt; (specifies the world border warning distance)
worldborder warning time &lt;seconds&gt; (specifies the world border warning time)
</blockquote>
<p>
Arguments
</p>
<blockquote>
sizeInBlocks (add, damage buffer, and set modes only)
</blockquote>
<blockquote>
Specifies a distance in blocks:
</blockquote>
<blockquote>
add — specifies the number of blocks to add to the world border diameter.
damage buffer — specifies the distance outside the world buffer before players start taking damage. Must be at least 0.0. Initially set to 5.0.
set — Specifies the new diameter for the world border. Must be between 1.0 and 60,000,000 (inclusive, without the commas).
</blockquote>
<blockquote>
timeInSeconds (add and set modes only)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
x z (center mode only)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
damagePerBlock (damage amount mode only)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
blocks (warning distance mode only)
</blockquote>
<blockquote>
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.
</blockquote>
<blockquote>
seconds (warning time mode only)
</blockquote>
<blockquote>
Specifies the time in seconds before a moving world border overruns a player when they will begin to see a visual warning of the world border's proximity. For example, if seconds is 5, players will get a visual warning when the moving world border is 5 seconds or less away from passing their position. Must be at least 0. Initially set to 15.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if new world diameter will be less than 1.0 or greater than 60,000,000.
</blockquote>
<blockquote>
On success:
</blockquote>
<blockquote>
add — The world border begins changing its diameter. If sizeInBlocks is positive, the world border will turn green and start increasing; if negative, the world border will turn red and start decreasing. If timeInSeconds is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of (sizeInBlocks/2)/timeInSeconds blocks per second.
</blockquote>
<blockquote>
center — The center of the world border immediate moves to the specified coordinates.
</blockquote>
<blockquote>
damage amount — 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.
</blockquote>
<blockquote>
damage buffer — 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.
</blockquote>
<blockquote>
get — Shows the current world border diameter in the chat.
</blockquote>
<blockquote>
set — The world border begins changing its diameter. If sizeInBlocks 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 timeInSeconds is 0 or unspecified, the change occurs immediately; otherwise the change proceeds at a rate of ((sizeInBlocks-&lt;cirrent diameter&gt;)/2)/timeInSeconds blocks per second.
</blockquote>
<blockquote>
warning distance — Sets the world border warning distance to this value.
</blockquote>
<blockquote>
warning time — Sets the world border warning time to this value.
</blockquote>
<p>
xp
xp
Restrictions
</p>
<p>
Operator
First introduced
</p>
<p>
1.3.1 (12w16a)
</p>
<p>
Adds experience to a player.
</p>
<p>
Syntax
</p>
<blockquote>
xp &lt;amount&gt; [player]
xp &lt;amount&gt;L [player]
</blockquote>
<p>
Arguments
</p>
<blockquote>
amount
</blockquote>
<blockquote>
Specifies the amount of experience to give to the player. Must be between 0 and 2,147,483,647 (inclusive, without the commas).
</blockquote>
<blockquote>
If an L 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.
</blockquote>
<blockquote>
player (optional)
</blockquote>
<blockquote>
Specifies the target of the command. Must be a player name or a target selector. If not specified, defaults to the command's executor. Not optional in command blocks.
</blockquote>
<p>
Result
</p>
<blockquote>
Fails if arguments are not specified properly, or if player fails to resolve to one or more online players.
</blockquote>
<blockquote>
On success, adds experience or adds/removes levels. Total experience and levels will not be reduced below 0.
</blockquote>
<p>
Examples
</p>
<blockquote>
To give 7 experience to yourself: xp 7
</blockquote>
<blockquote>
To give 3 levels to Alice: xp 3L Alice
</blockquote>
<blockquote>
To remove all levels from all players: xp -2147483648L @a
</blockquote>
</body>
</html>