Commands

From Better Than Wolves Wiki
Jump to: navigation, search

Commands may be used by players, operators and the Command Block while in multiplayer connected to a Minecraft server, and in singleplayer when the user has cheats enabled for the world. Some commands are also available in singleplayer even when cheats are not enabled. Commands may be entered from a Minecraft client while in the game or on the host computer's server console.

Commands being entered into the Minecraft client itself must be prefixed by a slash (example: /toggledownfall). The command window is identical to the chat window and can be accessed by pressing T or starting directly by entering a slash.

Commands being executed via the console are not preceded by a slash. Commands in command blocks can be preceded by a slash, but this is not required.

Pressing Tab ↹ cycles through possible commands or arguments.

In the following tables, required arguments appear in <angle brackets>, and optional arguments appear in [square brackets]. Arguments in italics should be replaced by an appropriate value; arguments in plain text must be entered exactly as shown.

Player commands

These commands can be used in the chat window by any player who is allowed to connect to a server, and can also be used in singleplayer whether or not cheats are enabled.

Command Description Success Conditions<ref group="note" name="success">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.</ref>
me <actiontext> Similar to the /emote or /action, and the same as the /me commands in IRC clients, the /me command sends a narrative message to the other players in the form of "* Yourname actiontext" (e.g., "* Notch sneezes." or "* Notch exploded." ). If a multi-person target selector (e.g. @a) is used in actiontext, 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 actiontext, this command will only output once. All target selectors (e.g. @p) in actiontext must evaluate.
help [page | commandname] or ? [page | commandname] Shows a list of available commands or further information to the commandname. Note: the multiplayer-only commands are not listed in single-player games, even when open to LAN players. Succeeds if page is valid or no page/commandname is specified. Technically fails if commandname is specified, although it displays the usage of the command.
tell <playername> <message> Used to send a private message to a player on the server. Very useful on servers if you need to ask/tell something from/to another player without other players seeing. If a multi-person target selector (e.g. @a) is used in message, 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 message, this command will only output once - however, a selector for playername can send a message to multiple people. All target selectors (e.g. @p) in message must evaluate, and playername must be online.

<references group="note"/>

Operator-only commands

These commands are usable by ops (operators) from the server console as well as through the chat window when prefixed by the command character (a forward slash). These commands are also available in SSP with enabled cheats or for players hosting a world.

Note: Op commands are broadcasted to the other ops online.

Command Description Success Conditions
clear <playername> [item] [metadata] Clears the inventory of playername or the specified item:data. At least one item must be removed, and playername must be online.
debug <start | stop> Starts a new debug profiling session or stops the session currently running. It notifies about potential performance bottlenecks in the console when active and creates a profiler results file in the folder debug when stopped. Can only stop if a session is running. Cannot be used in a command block.
defaultgamemode <survival | creative | adventure> 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; i.e., if the default game mode is creative, new players will start in creative. The game modes can be abbreviated to "s/c/a" or "0/1/2" respectively. This command cannot enable or disable Hardcore mode. Must be a valid game mode.
difficulty <peaceful | easy | normal | hard> Changes the difficulty. The difficulties can be abbreviated to "p/e/n/h" or "0/1/2/3" respectively. Must be a valid difficulty.
effect <player> <effect> [seconds] [amplifier] Gives the targeted player the specified effect for the specified time (default is 30 seconds). Effects have a limit of 1,000,000 seconds, and the amplifier field has a limit of 255. Effect id's can be found on the potion effects page. Setting seconds to 0 clears this effect. If you put the amplifier to a number of a variably high value, it will not give the desired amplifier. If clearing an effect, the player must have this effect. Must be a valid effect. Player must be online.
enchant <playername> <enchantment ID> [enchantment level] Enchants the item that the player is currently holding, according to enchantment ID. Note that this works within the normal limitations of enchanting items. Enchantments can only be applied to items which can normally receive that specific enchantment. Enchantment levels can not be above the normal highest achievable for the selected enchantment. Conflicting or overpowering enchantment combinations usually prevented are also prevented with this command. The enchantment ID must be valid, the level must be valid for this enchantment (unless the held item is also invalid), and playername must be online. Note that the enchanting may still be blocked if the item is not valid or if a conflicting enchantment exists; this is still considered a "success".
gamemode <survival | creative | adventure> [playername] Changes the game mode for playername. The game modes can be abbreviated to "s/c/a" or "0/1/2" respectively. If no playername is given, it will set your own gamemode. Remember, this will only affect playername and no one else. Player must currently be online, and gamemode must be valid. Playername is not optional for command blocks.
gamerule <rulename> [true | false] Activates or deactivates the rulename. If true/false is not given, displays the current status of rulename. Available rules are:
  • commandBlockOutput - Whether command blocks should notify admins when they perform commands.
  • doFireTick - Whether fire should spread.
  • doMobLoot - Whether mobs should drop items.
  • doMobSpawning - Whether mobs should naturally spawn.
  • doTileDrops - Whether blocks should have drops.
  • keepInventory - Whether the player should keep items in their inventory if they die.
  • mobGriefing - Whether creepers, endermen, ghasts, and withers should be able to change blocks, or zombies, skeletons, and zombie pigmen can pick up items.
Succeeds in literally all cases - even absent/invalid rulename or a property besides 'true' or 'false'.
give <playername> <item> [amount] [metadata] Spawns amount (defaults to 1) of the item defined by item with the specified metadata (defaults to 0) at playername 's location. For example typing /give John 5 30 1 will give a player called John 30 blocks of Spruce Wood Planks. Item must be a valid ID, amount must be from 0 to 64, and playername must be online.
kill Inflicts 1000 (Heart.png × 500) damage to the user, killing them unless an extremely powerful /effect for resistance is in use. Useful when lost, stuck or to restore health and hunger (assuming you can get your items back easily). Also displays message "Ouch. That looks like it hurt." Cannot be used in a command block.
publish Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats. Cannot be used in a command block.
say <message> 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. All target selectors (e.g. @p) in the message must evaluate.
scoreboard <objectives|players|teams> See Scoreboard for more information. Scoreboard-specific commands. Main Article
seed Displays the seed. This command can always be used in single-player mode, regardless of whether cheats are enabled. Always succeeds (if user is a command block, player in singleplayer, or server op).
spawnpoint <player> [x y z] Sets the spawnpoint of that player to that position, or to the current position if x y and z are not specified. Player is optional if x y z are not specified; will set the spawnpoint of the user to their current location. NOTE: Spawnpoint coordinates must be specified in whole numbers. No decimals. Player must be online, and x, y, and z must be within the range -30,000,000 to 30,000,000 (inclusive).
time set <number | day | night> Sets the world time. number is an integer between 0 and 24000, inclusive, where 0 is dawn, 6000 midday, 12000 dusk and 18000 midnight. Number can be greater than 24000, but the time of day simply wraps around. "time set day" sets the time to 0, and "time set night" sets the time to 12500. Number must be 0 or positive, or "day" or "night".
time add <number> Increments the world time, as above. Number must be 0 or positive.
toggledownfall Toggles rain and snow. Always succeeds.
tp [playername] <targetplayer> Teleports player playername to targetplayer 's location. If no player is specified, it will teleport yourself. Playername is not optional in command blocks. Both players must be online.
tp [playername] <x> <y> <z> Teleports player playername (or yourself if no player is specified) to coordinates x,y,z. (the y value cannot be smaller than 0). Can also relatively move the player by adding the ~ character before the coordinate value. For example typing /tp John ~3 64 ~3 will teleport a player called John 3 blocks away from his current x and z, and to y 64. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive), and y must be at least 0. Playername is not optional in command blocks, and the player must be online.
weather <clear | rain | thunder> [seconds] Changes the weather for the specified duration. Seconds must be at least 1, and cannot be greater than 1000000. Oddly enough, the command will succeed even if an invalid weather is input, although nothing will happen.
xp <amount> [playername] Gives the specified user the given number of orbs. Maximum is 2,147,483,647 per command. Negative amounts may not be used to remove experience points. Amount can be at most 2,147,483,647. Playername is not optional in command blocks, and player must be online.
xp <amount>L [playername] Gives playername the amount number of experience levels. Maximum is 2,147,483,647 - if a player is given levels pushing them past this limit, they get reset to 0. Negative amounts may be used to remove experience levels. Amount must be between -2,147,483,648 and 2,147,483,647, inclusive. Playername is not optional in command blocks, and player must be online.

Multiplayer-only Commands

These commands are usable by ops (operators) from the server console as well as through the chat window when prefixed by the command character (a forward slash). These commands are only available in SMP. With the exception of the list command, none of these commands can be executed by a command block, and none make use of target selectors. 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.

Command Description Success Conditions
ban <playername> [reason] Blacklists the name playername from the server so that they can no longer connect. Note: Bans supersede any whitelisting in place. Always succeeds.
ban-ip <ip-address | playername> Blacklists an IP address so that all subsequent connections from it are rejected. ip-address must be valid or playername must be online.
banlist [ips] Displays the banlist. To display banned IP addresses, use the command "banlist ips" Always succeeds.
deop <playername> Revokes a player's operator status. Always succeeds.
kick <playername> [reason] Forcibly disconnects playername from the server, displaying an optional reason to them. Playername must be online.
list Shows the names of all currently-connected players (the same can be achieved when pressing tab) Always succeeds, even in a command block.
op <playername> Grants playername operator status on the server. Always succeeds.
pardon <playername> Removes playername from the blacklist, allowing them to connect again. Always succeeds.
pardon-ip <ip-address> Removes ip-address from the IP blacklist, allowing players from that IP address to connect to the server. ip-address must be valid.
save-all Forces the server to write all pending changes to the world to disk. Always succeeds.
save-off Disables the server writing to the world files. All changes will temporarily be queued. Always succeeds.
save-on Enables the server writing to the world files. This is the default behavior. Always succeeds.
stop Gracefully shuts down the server. Always succeeds.
whitelist <add | remove> <playername> Adds or removes playername from the whitelist. Always succeeds.
whitelist list Displays all players in the whitelist. Always succeeds.
whitelist <on | off> Enables/disables the server's use of a whitelist. Note: Server ops will always be able to connect when the whitelist is active, even if their names do not appear in the whitelist. Always succeeds.
whitelist reload Reloads the list of playernames in white-list.txt from disk (used when white-list.txt has been modified outside of Minecraft). Always succeeds.

Command-Block-only commands

These commands can be used only in a Command Block and cannot be used in other ways. Command blocks are only obtainable via the /give <playername> 137 command.

Command Description
testfor <playername | selector> Used to test whether playername is online, or if selector has matches. A Redstone Comparator as output from a command block with this command will indicate the number of players matched by selector. For example, "testfor @a[r=3]" will output the number of players within 3 meters of the command block. More information about selectors may be found here.

Video

Commands/video

History

Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History Template:History

Trivia

  • When the game rule "doFireTick" is set to "false", fires, though they will not spread, will burn eternally and be immune to rain, regardless of the block type they are attached to. This can be a large nuisance during thunderstorms, since lightning bolts can start a significant number of fires, and players need to put them out manually.
  • If you have "Resistance" Status effect level 5, /kill command does not work.

See also