Articles on: Minecraft

Vanilla Commands



Before we start, we need to understand the meaning of the arguments for each command that we will use:

- ❓ The ones between ' <> ' are necessary for the command to work, you need to fill that campus with the correct argument.
- ❓ The ones between ' [] ' are not necessary for the command and usually are extra features. You can use the command leaving those spaces empty and it will still work.



🌲 Target Selectors 🌲



A target selector is a syntax used to target a player or entity in Minecraft.

- @p - Targets the nearest player.
- @r - Targets a random player.
- @a - Targets all players.
- @e - Targets all entities.
- @s - Target yourself.


🔌 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 single-player whether or not cheats are enabled. Please note that all Commands are case sensitive, and will not succeed if the case does not match.

Commands entered via the Multicraft console do not need the / in front of the command.



Bukkit Commands:



/help [page | commandname]



🔎 Alternative: /? [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.


🤔 Examples:


/help 1
Will show page one of the help list.

/help essentials
Will show the possible commands for the Essentials plugin.


/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 "* Yournameactiontext" (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.

🤔 Examples:

/me Notch_sneezes.
Will set your narrative message to 'Notch_sneezes.'.


/tell <playername> <message>


🔎 Alternative: /msg <playername> <message>

🔎 Alternative: /w <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.

🤔 Examples:

/tell player1 Hello!
Will send the message 'Hello!' to the player1.


/plugins


Lists all installed plugins on the server. If used in the game it will also show with red the ones that are not working and with green the ones that are working properly.


/version


Gives the version number of CraftBukkit which is installed on the server


🔌 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 single player with enabled cheats or for players hosting a world.

NOTE: Op commands are broadcast to the other ops online.

/advancement grant <targets> <everything¦from¦only¦through¦until> [advancementID]


Gives a player an advancement, and all prerequisite achievements.

- targets is the name of a player (or a target selector).

- everything - grant/revoke all advancements.

- from - grant/revoke a specific advancement and all of its child advancements.

- only - grant/revoke a specific advancement.

- through - grant/revoke a specific advancement, all of its parent advancements, and all of its child advancements.

- until - grant/revoke a specific advancement and all of its parent advancements.

- advancementID is the Minecraft ID of the advancement to grant/revoke.

🤔 Examples:

/advancement grant player1 only minecraft:adventure/adventuring_time
Will give to player1 the advancement 'minecraft:adventure/adventuring_time'.


/clear <playername> [item] [metadata]


Clears the inventory of playername or the specified item:data.

🤔 Examples:

/clear player1
Will clear the inventory of player1.

/clear player1 diamond_sword
Will clear the 'diamond_sword' item from player1 inventory.


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


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

🤔 Examples:

/defaultgamemode creative
Will set the default game mode to creative.


/difficulty peaceful | easy | normal | hard


Changes the difficulty. The difficulties can be abbreviated to "p/e/n/h" or "0/1/2/3" respectively.

🤔 Examples:

/difficulty hard
Will set the difficulty to hard.


/effect <playername> <effect> [seconds] [amplifier]


Gives the targeted player the specified effect for the specified time (default is 30 seconds). The effects have a limit of 1,000,000 seconds, and the amplifier field has a limit of 255. Effect ids 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.

🤔 Examples:

/effect give player1 conduit_power 5000
Will give player 1 the 'onduit_power' effect for 5000 seconds.


/effect <playername> clear


Clears all effects on playername.


/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 that can normally receive that specific enchantment. Enchantment levels can not be above the normal highest

🤔 Examples:

/enchant player1 knockback 2
Will enchant the item that the player1 is currently holding with the enchantment 'knockback' and with the level '2'.


/gamemode [adventure|creative|spectator|survival] [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.

🤔 Examples:

/gamemode survival
Will set your own gamemode to survival.

/gamemode survival player1
Will set the player1 gamemode to survival.


/gamerule <rulename> [true | false]


Activates or deactivates the rulename. If true/false is not given, displays the current status of rulename. Available rules are:

-announceAdvancements - Whether advancements are announced.

-commandBlockOutput - Whether command blocks notify admins when commands are executed.

-disableElytraMovementCheck - Whether the server should skip checking player speed when the player is wearing elytra.

-disableRaids - Disables Raids (added in 1.14.3).

-doDaylightCycle - Whether time advances in the day/night cycle. If set to false, time will stop at the current moment.

-doEntityDrops - Whether entities should have drops.

-doFireTick - Whether fire should naturally spread and then extinguish.

-doImmediateRespawn - Whether the player immediately respawns without seeing the respawn menu (the respawn menu displays the message that you died with the options to respawn or go to the main menu) (added in 1.15).

-doInsomnia - Whether phantoms will spawn at night if a player hasn't slept (added in 1.15).

-doLimitedCrafting - Whether players should be able to craft only those recipes that they've unlocked first.

-doMobLoot - Whether mobs should have drops.

-doMobSpawning - Whether mobs should spawn naturally.

-doPatrolSpawning - Whether patrols should spawn (added in 1.15.2).

-doTileDrops - Whether blocks should have drops.

-doTraderSpawning - Whether wandering traders should spawn (added in 1.15.2).

-doWeatherCycle - Whether weather changes. If set to false, weather will stop at the current cycle.

-drowningDamage - Whether drowning causes damage (added in 1.15).

-fallDamage - Whether falls cause damage (added in 1.15).

-fireDamage - Whether fire causes damage (added in 1.15).

-KeepInventory - Whether players keep their inventory after dying.

-logAdminCommands - Whether admin commands are added to the server log.

-maxCommandChainLength - Maximum length of the command chain (number).

-maxEntityCramming - Maximum number of entities that can be crammed (number).

-mobGriefing - Whether mobs can pick up items or change blocks.

-naturalRegeneration - Whether players can regenerate health naturally through their hunger bar.

-randomTickSpeed - Sets the speed of how fast things grow or decay (number).

-reducedDebugInfo - Whether the debug screen shows all or reduced information; and whether the effects of F3+B (entity hitboxes) and F3+G (chunk boundaries) are shown.

-sendCommandFeedback - Whether feedback from player commands appears in the chat.

-showDeathMessages - Whether a message appears in the chat when a player dies.

-spawnRadius - Controls how far from the world spawn point you can spawn (number).

-spectatorsGenerateChunks - Whether spectators can generate chunks in the game.


/give <playername> <item> [amount] [metadata] [dataTag]


Spawns amount (defaults to 1) of the item defined by item with the specified metadata (defaults to 0) at playername 's location, using dataTag for the "tag" NBT tag.

🤔 Examples:

'/give player1 gold_block 4'
Will give player1 four gold blocks.

/give player1 5 30 1 {display:{Lore:["Wooden planks"]}}
Will give player1 thirteen blocks of Spruce Wood Planks with Lore that says "Wooden planks".


/kill <playername>


Inflicts 1000 ( × 500) void damage to the user, killing the user instantly even if in creative (a high-level Resistance effect cannot protect the player either). The text "Ouch! That looks like it hurt." will be displayed after executing. Useful when lost, stuck, or to restore health and hunger (assuming you can get your items back easily or the keepInventory gamerule is set to "true"). Death message displays as "playername fell out of the world"

🤔 Examples:

/kill player1
Will kill the player1.


/publish


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


/playsound <sound> <playername> [x] [y] [z] [volume] [pitch] [minimumVolume]


Plays the selected sound to the selected player. The format for sound is as follows:

Sound located at .minecraft\assets\sound\mob\pig\death.ogg

The value for sound would be written as mob.pig.death, as the command originates from the sound folder. For sequentially numbered files pertaining to the same event (Example: various walking sounds), the player must exclude the number of the sound.

🤔 Examples:
Sound located at .minecraft\assets\sound\mob\pig\say[1-3].ogg

/playsound mob.pig.say player1 44 0 123 1.0 1 0.5

The value for sound would be written as 'mob.pig.say' in this case. Since there are multiple mob.pig.say files (say1, say2, and say3), the command will play a randomly selected sound out of the three available.

The coordinates x, y, and z are the coordinates to play the sound from. If prefixed with "~", they will be relative to the player's current location. Note that "~" is shorthand for "~0", and thus "~ ~ ~" can be used as a substitute for the player's current location.

The volume argument controls the distance from which a sound may be heard. At values less than 1.0, the sound will be quieter and have a smaller sphere within which it may be heard. At 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.

The minimumVolume argument controls the volume of the sound outside its normal audible sphere. Note that the sound inside this sphere may actually be less than the volume of the sound outside this sphere, if volume is less than minimumVolume.

The pitch argument alters both the pitch and the duration of the sound (which means that it's actually changing its speed). It can be a value between 0.0 and 2.0. The higher the value, the higher the pitch.


/op <playername>


Turns a player into a server operator.

🤔 Examples:

/op player1
Will OP the player1.


/reload


Stops and restarts all plugins on the server


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

🤔 Examples:

/say START!
Will broadcast the 'START!' message to all players.


/scoreboard [objectives | players | teams]


Changes scoreboard settings/options with the used parameters.

For more details about the /scoreboard command please visit our article about it.


/seed


Displays the seed. This command can always be used in single-player mode, regardless of whether cheats are enabled or not.


/setblock <x> <y> <z> <tilename> [datavalue] [oldblockHandling] [dataTag]


Places the block in the x, y, and z coordinates specified. This command is working for Minecraft version lower than 1.12 (ex. 1.8, 1.9, 1.10, 1.11, 1.12).

🤔 Examples:

/setblock ~1 ~0 ~1 planks 2
Will replace a block that is 1 block East and 1 block South with a birch wood plank.

/setblock -128 55 229 obsidian
Will replace the block at the coordinates (-128, 55, 229) with obsidian.

/setblock <pos> <block> [destroy¦keep¦replace]


Places the block in the specified position. This command is working for the Minecraft version higher than 1.12 (ex. 1.13, 1.14, 1.15, 1.16).

🤔 Examples:

/setblock ~1 ~ ~1 birch_planks
Will replace a block that is 1 block East and 1 block South with a birch wood plank

/setblock -178 64 7 jungle_trapdoor
Will replace the block at the coordinates (-209, 69, 2) with a jungle trapdoor.


/setworldspawn [x] [y] [z]


Sets the world's spawn to the specified coordinates. If no coordinates are specified, the world spawn will be set to the executor's current location.

🤔 Examples:

/setworldspawn 22 11 234
Will set the world spawn at the coordinates mentioned above.


/spawnpoint <playername> [x] [y] [z]


Sets the spawn point 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, and z are not specified; will set the spawnpoint of the user to their current location. NOTE: Spawnpoint coordinates must be specified in integers. No decimals.

🤔 Examples:

/spawnpoint player1 22 11 234
Will set the spawnpoint for the player1 to the mentioned coordinates.


/spreadplayers <x> <z> [spreadDistance] [maxRange] [respectTeams] <playernames>


This command allows players to spread out over a long or short distance.

The x and z mark the center of the area across which players are to be spread. spreadDistance is the rough minimum distance players will be spread apart.

The maxRange is the maximum distance from x, z where players will be put. Note that this distance is not a circular radius; it represents the maximum distance on either coordinate (thus forming a box ranging from x-maxRange to x+maxRange and z-maxRange to z+maxRange).

The respectTeams may be true or false and represents whether players should be moved individually or teams should be kept together.

The playernames is the list of players to spread. Names are separated by spaces.

🤔 Examples:

/spreadplayers ~ ~ 15 40 false player1 player2
Will teleport player1 and player2 to random locations that are within 40 blocks of the current coordinate and each player must be at least 15 blocks from another player.


/summon <EntityName> [x] [y] [z] [dataTag]


Spawns desired entity.

🤔 Examples:

/summon Pig ~ ~ ~ {Saddle:1,CustomName:"Mr. Pig",CustomNameVisible:1}
Will create a saddled pig named Mr. Pig at the player's current location.

/summon Skeleton ~ ~ ~ {SkeletonType:1}
Will summon a Whiter Skeleton for versions lower than 1.12 (ex. 1.8, 1.9, 1.10, 1.11, 1.12).

/summon wither_skeleton
Will summon a Whiter Skeleton for versions higher than 1.12 (ex. 1.13, 1.14, 1.15, 1.16).


/tellraw <playername> <raw message>


Sends a message to a specified player, or to every player online on a server. Links can also be sent, with customizable actions when they are clicked, for example giving an apple to a player or teleporting the player to another location. This command can also be used to fake player messages.

Raw message uses JSON. Note that in the game, the color will default to white if not given and all formatting (bold, italic, etc.) will default to false if not given, so you don't have to use the exact command the tool gives you.

🤔 Examples:

/tellraw player1 {"text":"Creeper joined the game","color":"yellow"}
Will send the private message "Creeper joined the game" in a yellow text to the player1.


/testforblock <x> <y> <z> <tilename> [datavalue] [dataTag]


Used to test whether a particular block is in the x, y and z coordinates specified. This command is working only on Minecraft version lower than 1.12 (ex. 1.8, 1.9, 1.10, 1.11, 1.12).

🤔 Examples:

/testforblock ~ ~-1 ~ iron_ore
Will test whether there is a iron ore directly below you in Minecraft.

/testforblock -132 96 273 chest 2
Will test whether there is a chest at coordinate (-132 96 273) that is facing North (a data value of 2 denotes North facing).

/testfor <player or entity> [datavalue] [dataTag]


Tests for a player or entity, and specified data if needed. This command is working only on Minecraft version lower than 1.12 (ex. 1.8, 1.9, 1.10, 1.11, 1.12).

🤔 Examples:

/testfor @a[r=5]
Will test if there are any players within a 5 block radius.

/testfor @e[type=mooshroom,r=100]
Will test if there are mooshrooms within a 100 block radius.

/testfor @p {XpLevel:30}
Will test if the nearest player has an experience level of 30.


/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; in this case, the time of day wraps around, but the moon's phase is advanced. However, Setting the time "backward" (earlier than the current time) does not change the moon. "time set day" sets the time to 1000, and "time set night" sets the time to 13000.

🤔 Examples:

/time set day
Will set the time to day.

/time set 1000
Will set the time to 1000.


/time add <number>


Increments the world time, as above.

🤔 Examples:

/time add 1000
Will add 1000 to the world time.


/toggledownfall


Toggles rain and snow.


/tp [playername] <targetplayer>


Teleports player playername to targetplayer 's location. If no player is specified, it will teleport yourself.

🤔 Examples:

/tp player1 player2
Will teleport the player1 to the location of player2.


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

🤔 Examples:

/tp 22 11 234
Will teleport yourself to the mentioned coordinates.

/tp player1 22 11 234
Will teleport the player1 to the mentioned coordinates.


/weather <clear | rain | thunder> [seconds]


Changes the weather for the specified duration.

🤔 Examples:

/weather rain 100
Will make it rain into your world for 100 seconds.


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

🤔 Examples:

/xp 1000000 player1
Will give 1,000,000 orbs to player1.


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

🤔 Examples:

/xp 100L player1
Will give 100 experience levels to player1.


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

Except for 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.

/ban <playername> [reason]


Blacklists the name playername from the server so that they can no longer connect. Note: Bans supersede any whitelisting in place.

🤔 Examples:

/ban player1 cheating
Will ban the player1 from your server with the reason 'cheating'.


/ban-ip <ip-address | playername> [reason]


Blacklists an IP address so that all subsequent connections from it are rejected.

🤔 Examples:

/ban-ip 173.20.77.128 cheater
Will add the IP '173.20.77.128' to the banlist with the reason 'cheater', so no player with this IP will not be able to join anymore.

/ban-ip player1
Will add the IP of the player1 to the banlist, so no player with this IP will not be able to join anymore.


/banlist [ips]


Displays banned players. To display banned IP addresses, use the command "banlist ips"

🤔 Examples:

/banlist
Will display the players banlist.

/banlist ips
Will display the IP's banlist.


/deop <playername>


Revokes a player's operator status.

🤔 Examples:

/deop player1
Will remove the operator status from player1.


/kick <playername> [reason]


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

🤔 Examples:

/kick player1 afk
Will disconnect player1 with the reason 'afk'.


/list


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


/op <playername>


Grants playername operator status on the server.

🤔 Examples:

`/op player1'
Will give operator status to the player1.


/pardon <playername>


Removes playername from the blacklist, allowing them to connect again.

🤔 Examples:

/pardon player1
Will remove the ban from player1, removing him from the banlist/ blacklist.


/pardon-ip <ip-address>


Removes ip-address from the IP blacklist, allowing players from that IP address to connect to the server.

🤔 Examples:

/pardon-ip 173.20.77.128
Will remove the IP '173.20.77.128' from the banlist, so any player with this IP will be able to join again.


/save-all


Forces the server to write all pending changes to the world to disk.


/save-off


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


/save-on


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


/setidletimeout <Minutes until kick>


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

🤔 Examples:

/setidletimeout 600
Any player idle for 600 minutes will be kicked.


/stop


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


/whitelist <add - remove> <playername>


Adds or removes playername from the whitelist.

🤔 Examples:

/whitelist add player1
Will add player1 to the whitelist.

/whitelist remove player1
Will remove player1 from the whitelist.


/whitelist list


Displays all players in the whitelist.


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

🤔 Examples:

/whitelist on
Will enable the whitelist on your server.

/whitelist off
Will disable the whitelist on your server.


/whitelist reload


Reloads the list of playernames in white-list.txt from disk (used when white-list.txt has been modified outside of Minecraft).


🔌 Command-Block-only commands 🔌



These commands can be used only in a Command Block and cannot be used in other ways.

Command blocks are obtainable via the /give 137 command only for Minecraft versions lower than 1.12 (ex. 1.8, 1.9, 1.10, 1.11, 1.12), and via the /give @s minecafrt:command_block command only for versions higher than 1.12 (ex. 1.13, 1.14, 1.15, 1.16).

We have a guide here explaining Command Blocks.

/testfor <playername | selector>


Used to test whether playername is online, or if selector has matched. A Redstone Comparator as output from a command block with this command will indicate the number of players matched by selector. More information about selectors may be found here.

🤔 Examples:

/testfor @a[r=3]
Will output the number of players within 3 meters of the command block.


If you have any other issues regarding Vanilla commands please feel free anytime to contact us on live chat or via a ticket, we are here to help!


❕ Useful Links ❕



- Improve Your Server Performance
- How To: Add an Icon to a Minecraft Server
- How to install datapacks on your server

Updated on: 04/21/2021

Was this article helpful?

Share your feedback

Cancel

Thank you!