FANDOM


257 This article is about Multiplayer experiences and content.

Information below may not be integral to the main experience of Minecraft. Some aspects of this article may differ between separate multiplayer servers.

257

Commands are advanced functions activated by typing certain strings of text.

When a Player creates a new world, they will have the option of having "cheats" on or off. If a player chooses off, they will be unable to use cheats in that world, unless the world is opened to LAN with cheats enabled.

Commands can also be used with Command Blocks.

List of commands

Syntax

If one sees... Then...
plain text Enter this exactly as shown
<angle brackets> This is a required argument.
[square brackets] This is an optional argument.
x|y Pick one of the options shown. Available options are separated by vertical bars.
ellipsis (...) The argument may consist of multiple words separated by spaces

The List

Command Syntax (Usage) Action Operator Only? Success conditions (activates comparator and stats) Bugs
/help /help [page] Shows a list of all available commands No
/me /me <text> Shows a player's username then <text> (i.e. /me ran outputs *Player ran) No/Yes (Depends on the server) If <text> parameter is entered in
/whisper (/msg /tell) /whisper <player> <message> Tells a private message to <player> No If <player> and <message> parameters are entered and <player> must be online
/achievement /achievement give <stat_name> [player] Gives an achievement or +1 value to a statistic to [player]. If an achievement is given, all of its prerequisites will be given as well. Yes If no player is specified, defaults to the command's executor. Must be specified if in a command block. <stat_name> must be a valid Statistic or achievement name.
/advancement

/advancement <grant|revoke|test> <player> <advancement> [criterion]

Gives or takes an advancement from a player, or tests whether a player has an advancement Yes If no player is specified, defaults to the command's executor. Must be specified if in a command block. The advancement must be valid.
/blockdata /blockdata <x> <y> <z> <dataTag> Gives the block at the specified coordinates the data in <dataTag>. Yes Block at the coordinates specified must be a block that holds NBT Data.
/clear /clear <player> [item ID] [DV] [maximum amount taken] [DataTag] Clears <player> from [Item ID] if [DV] and [DataTag] match the one in the inventory. If [item ID] is not specified, it completely erases a player's inventory Yes All tags, dv, stack count, and item id must match.

<player> must be online.

/clone /clone <x> <y> <z> <dx> <dy> <dz> <x2> <y2> <z2> [type] Copies the area within the first two set of coordinates and pastes it at the third. Yes Maximum cube volume is 32,768 blocks (2^15)(8 chunks).
/debug /debug <start - stop> Starts profiling a debug session or stops one. Yes
/defaultgamemode /defaultgamemode <survival - creative - adventure - spectator> Sets the server's default gamemode for when players join for the first time. Yes Gamemode must be specified.
/difficulty /difficulty <peaceful - easy - medium - hard> Changes the difficulty of the server. Yes Difficulty must be specified.
/effect /effect <player> <effect ID(numerical)> [Time(seconds)] [amplifier] Gives <player> <effect ID> [amplifier] for [Time] seconds. Yes <player> must be online

<Effect ID> must be a valid ID.
[Amplifier] cannot go below 0 and cannot exceed 255
[Time] cannot exceed 1000000

/enchant /enchant <player> <ID> [Enchantment level] Enchants the item in the <player>s hand with <ID>. Yes <player> must be online. <ID> must be an applicable enchantment ID (e.g. sharpness on a sword, but not on a bow). If [Enchantment level] is specified, it cannot go over the maximum level for the enchant. Fails if the enchantment is already on the item.
/execute /execute <player or entity> <x> <y> <z> <command> <Other command parameters> Executes <command> at the location of <player or entity>, relative to <z> <y> <z>. Yes If a player is specified, he/she must be online.
/fill /fill <x> <y> <z> <dx> <dy> <dz> <block Name> [DataValue] [oldBlockHandling] [dataTag] OR /fill <x> <y> <z> <dx> <dy> <dz> <block Name> [DataValue] replace <Block Name> <ReplacedDataValue> Fills the between the 2 coordinates with <block Name>. If replace is used for oldBlockHandling, the next parameter tells what block <block Name> should be replaced. Yes Maximum cube volume is 32,768 blocks (2^15)(8 chunks).

Block name must be a valid name.

/gamemode /gamemode <0 - 1 - 2 - 3 OR s - c - a - sp OR survival - creative - adventure - spectator> [player] Changes [player]'s gamemode to <survival - creative - adventure - spectator> Yes Game mode must be specified. If a player is unspecified, defaults to the command's executor. Must be specified if in a command block.
/gamerule /gamerule <gamerule> [true|false|numerical value] Sets a gamerule to be true or false. If value is not specified, the gamerule's value is returned. If the gamerule does not exist, creates a new gamerule that does not impact gameplay except via commands. See below for existing gamerules. Yes <Gamerule> must exist if the value is not specified.
/give /give <player> <Item name> [Amount] [Data Value(i.e. color of wool)(Numerical Only)] [NBT data tag] Gives <player> [Amount] <Item name>s. If [Data Value] or [NBT data tag] is specified, that data will be put into the item/block. Yes If <player> and <Item name> parameters are entered, <Item name> must be a valid name, <player> must be online. If [Amount] is specified, the Amount value must be greater than at least 1 and at most 64.
/kill /kill [player] Deals 3.4*10^38 (2^128) void damage to [player]. Yes [player] must be online, if specified. If no player is specified, defaults to the command's executor. Must be specified if in a command block.
/locate /locate <structure> Enters the coordinates of the closest <structure> in the chat Yes Valid structures are: EndCity, Fortress, Mansion, Mineshaft, Monument, Stronghold, Temple (desert and jungle, plus witch huts and igloos), and Village
/particle /particle <name> <x> <y> <z> <dx> <dy> <dz> <speed> [count] [player] Displays the particle <name> at <x> <y> <z>, viewable only by [player] (if specified) [count] times at the specified <speed> and <dx> <dy> <dz>. Yes If a player is specified, he/she must be online.

Particle name must be valid.

/playsound /playsound <sound> <player> [<x> <y> <z>] [volume] [pitch] [minimumVolume] Plays <sound> to <player>. Yes <player> must be online.

<player> must be able to here the sound from the coordinates (if specified).
volume must be at least 0.0
pitch must be between 0.0 and 2.0
minimumVolume must be between 0.0 and 1.0

/publish /publish Opens the world to LAN. Yes
/recipe /recipe <give|take> [player] <name> Unlocks or locks the recipe <name> for [player] (only has an effect if the gamerule doLimitedCrafting is true). Yes If no player is specified, defaults to the command's executor. Must be specified if in a command block.
/reload /reload Reloads all functions, loot tables, etc. Yes Always works
/say /say <message> Broadcasts <message>. Appears as "[<player>] <message>" Yes
/scoreboard /scoreboard <objectives|players|teams> Changes scoreboard settings/options with the used parameters. See Scoreboard Yes
/seed /seed Tells the world seed. Yes
/setblock /setblock <x> <y> <z> <Block name> [dataValue] [oldBlockHandling] [dataTag] Sets <block name> at the coordinates listed. Yes The block name must be a valid Block name.
/setworldspawn /setworldspawn [x] [y] [z] Sets the server spawnpoint to [x] [y] [z]. If no coordinates are specified, it will be at the executor's position. Yes Range is -30000000 to 30000000 for x and z, and 0 to 255 for y.
/spawnpoint /spawnpoint <player> [x] [y] [z] Sets <player>'s spawnpoint at [x] [y] [z]. If no coordinates are specified, it will be at the executor's position. Yes Range is -30000000 to 30000000 for x and z, and 0 to 255 for y.
/spreadplayers /spreadplayers <x> <z> [spreadDistance] [maxRange] [respectTeams] <playernames> Spreads players out with a distance of [spreadDistance] between them within a radius of [maxRange]. Yes
/summon /summon <Savegame ID> <[x] [y] [z]> [dataTag] Spawns a <Savegame ID> at [x] [y] [z]. If [dataTag] is specified, the data will go into the mob. Certain mobs cannot be spawned. Yes <Savegame ID> must be an actual entity, and the coordinates must be between -30000000 and 30000000 for the x and z, and at least 0 for the y. If the coordinates are unspecified the entity, it is summoned at the executor's location.
/tellraw /tellraw <player> <raw json message> Sends a message to a player. When combined with /trigger, allows for non-ops to successfully click text. Yes <player> must be online.

<raw json message> must be correctly coded in JSON.

/testfor /testfor <player or entity> [dataTag] Tests for a player or entity, and specified data if needed. Yes Must find a player or entity with correct conditions.
/testforblock /testforblock <x> <y> <z> <blockname> [DataValue] [dataTag] Tests <x> <y> <z> for <blockname> with DV [DataValue] and data keys, if those two are specified. Yes <blockname> must match the block at <x> <y> <z>.
/testforblocks /testforblocks <x> <y> <z> <dx> <dy> <dz> <x2> <y2> <z2> <dx2> <dy2> <dz2> Compares two areas' blocks. Gives all block ids, data values, and data tags (except for coordinate tags for the block entity) must match. Yes Two areas must be the same.
/time /time set <value> OR /time add <value> Sets the time to <value> or adds <value> ticks to the current time Yes
/toggledownfall /toggledownfall Turns precipitation on or off. Yes
/tp /tp <player> <player2> OR /tp <player> [<x> <y> <z>] [<rx> <ry>] Teleports <player> to <player2> or <x> <y> <z> Yes <player> and <player2> must be online. <x> <y> <z> parameters must be in the range of -3000000 and 3000000.
/trigger /trigger <objective> <add|set> <value> Adds or sets <value> to the <objective> for a player. It proves useful in tellraw texts as it is non-op friendly. Partial (see scoreboard)
/weather /weather < clear|rain|thunder> [Time (seconds)] Changes the weather to < clear - rain - thunder> for [Time] seconds. Yes [Time] must be 1000000 or lower, and the weather type has to be specified. If the time is unspecified, it will end at a natural pace.
/worldborder /worldborder set <size> [delay] -OR- /worldborder center <x> <z> Sets an impassible border that is <size> blocks as its area, and is centered on a location when "/worldborder center" is used. Any mobs outside of the box will gradually take damage. Yes
/xp /xp <player> <amount> OR /xp <player> <amount>L Gives <amount> experience to <player>, or <amount>L levels to <player>. Yes <player> must be online.

For individual experience, must be between 0 and 2,147,483,647 (2^31); for levels, must be between -2,147,483,648 and 2,147,483,647.

The following commands are only available in multiplayer.
/ban /ban <player> [reason] Bans a player. Yes
/ban-ip /ban-ip <<address> - <player>> Stops a player's IP from coming on. Yes
/banlist /banlist [ips] Lets a player see the banned players. "IPS" makes players see banned ips. Yes
/deop /deop <player> Takes away operator powers from a player. Yes
/kick /kick <player> [reason] Disconnects a player from the server. Yes <player> must be online.
/list /list Lets players see all online players. No
/op /op <player> Gives a player operator powers. Yes
/pardon /pardon <player> Pardons, or unbans, a player. Yes
/pardon-ip /pardon-ip <ip address> Pardons, or unbans, an IP address. Yes
/save-all /save-all Forces the server to save changes to the world save. Yes
/save-off /save-off Stops the server from making changes to the save. Yes
/save-on /save-on Makes the server make changes to the save. Yes
/setidletimeout /setidletimeout <minutes> Automatically kicks players after idling (doing nothing) for <minutes> minutes. Yes
/stop /stop Saves all changes to the save, then shuts down the server. Yes
/whitelist /whitelist <add - remove> <player> OR /whitelist list OR /whitelist <on - off> OR /whitelist reload Whitelist options. Yes

Gamerules

Gamerule What it does
commandBlockOutput Enables/disables text output of command block commands to console
doFireTick Enables/disables fire spread.
doMobLoot Enables/disables mob drops.
doMobSpawning Enables/disables the spawning of mobs unless one wants them to ex: eggs and mob spawners will still spawn mobs.
doTileDrops Enables/disables blocks dropping items when broken (includes TNT destroying blocks).
keepInventory Enables/disables keeping inventory on death.
mobGriefing Enables/disables creepers, ghasts, and Wither blowing up blocks, endermen picking up blocks and zombies breaking doors.
naturalRegeneration Enables/disables regenerating health when hunger is full or close to full.
spectatorsGenerateChunks Whether players in Spectator Mode can generate chunks.
showDeathMessages Whether a message appears in the chat when a player dies
logAdminCommands Whether to log admin commands to server logs
spawnRadius The possible number of blocks outward from the world spawn coordinates that a player will spawn in when first joining a server or when dying without a spawnpoint
doDaylightCycle Whether the day-night cycle and moon phases should progress
sendCommandFeedback Whether the feedback from commands executed by a player should show up in chat.
reducedDebugInfo Whether the Debug Screen shows all or reduced information
randomTickSpeed How often a random block tick occurs (e.g. plant growth, leaf decay, etc.) per chunk section per game tick.

Selectors

Selectors are letters followed by an at sign (@) that can be used to apply the command to a player or entity without having to actually specify a player.

@p: Nearest player
@a: All players
@r: Random player
@e: All entities
@s: Command's executor (1.12)

Arguments

Brackets can be placed after a selector to specify conditions. If it is for "/testfor", or any command that allows the use of selectors, these are called arguments.

The layout for this is: <selector>[<argument=<value>,<argument>=<value>, ...]

Some include:

Argument Function / Action
x The X coordinate for the searched area. Also is one corner for cubic selection if dx is used.
y The Y coordinate for the searched area. Also is one corner for cubic selection if dy is used.
z The Z coordinate for the searched area. Also is one corner for cubic selection if dz is used.
dx The opposite corner of the value used for x.
dy The opposite corner of the value used for y.
dz The opposite corner of the value used for z.
rm The minimum search radius.
r The maximum search radius.
rx The maximum x rotation.
ry The maximum y rotation.
rxm The minimum x rotation.
rym The minimum y rotation.
m The gamemode of a player. Values: -1 = All, 0 = Survival, 1 = Creative, 2 = Adventure, 3 = Spectator.
c The number of players/entities to target.
l The maximum experience level amount.
lm The minimum experience level amount.
team The team this player is on. This is an argument that can have an ! in front of the value, meaning "not".
score_objectivename_min The minimum score for an objective.
score_objectivename The maximum score for an objective.
type The SaveGame ID for an entity. This is an argument that can have an ! in front of the value, meaning "not".
name The name of the entity. This is an argument that can have an ! in front of the value, meaning "not".
tag See scoreboard

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.