Minecraft Commands
Minecraft enables players to do just about anything. Throw mods, resource packs, and shaders into the mix, and Minecraft can turn in to a variety of different games. However, there are some tools already in Minecraft that can fulfill needs or make gameplay easier! Those tools are called commands, and when used properly, can create some amazing items or make running a server easier!
Commands can be executed in the following ways:
- Entered by a player in the chat window.
- Executed by a command block or Minecart with command block.
- In functions or scripts, as part of a data pack or add-on.
- In a multiplayer server, entered in the console.
Here are ten commands in Minecraft that you need to know that will make your life easier!
Clear
Command
/clear
Description
Clears items from player intentory
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/clear Storiofmylife will clear Storiofmylife’s whole inventory. /clear Storiofmylife minecraft:birch_planks will clear all birch planks from Storiofmylife’s inventory. /clear @a minecraft:wool will clear all wool blocks from every player’s inventory.
Message (Msg)
Command
/msg, alternative commands are /tell and /w.
Description
Send a private message to one or more players.
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 0 |
| Java Edition | 0 |
| Education Edition | 0 |
Examples
/msg Storiofmylife Hi! will tell Storiofmylife “Hi!” /tell @a Meet you at spawn will tell all online players “Meet you at spawn!”
Locate
Command
/locate
Description
Displays the coordinates for the closest generated structure of the specified type in the chat. Only the player who executed the command will see it.
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/locate village will give the coordinates for the nearest village.
Locate Biome
Command
/locatebiome
Description
Displays the coordinates for the closest biome of the specified type in the chat. Only the player who executed the command will see it.
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | No |
| Java Edition | Yes |
| Education Edition | No |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | N/A |
| Java Edition | 2 |
| Education Edition | N/A |
Examples
/locatebiome birch_forest will give the coordinates to the nearest birch forest biome.
Operator Status
Command
/op
Description
Gives operator status to a player. This can only be used on a multiplayer server
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 2 |
| Java Edition | 3 |
| Education Edition | 2 |
Examples
/op Storiofmylife will give Storiofmylife operator status.
Give
Command
/give
Description
Gives an item to one or more players.
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/give Storiofmylife minecraft:netherite_sword 1 will give Storiofmylife a netherite sword. /give @a minecraft:bread 10 will give every player 10 bread.
Gamerule
Command
/gamerule
Description
Sets a game rule value.
| Rule | Description | Java | Bedrock |
|---|---|---|---|
| announceAdvancements | Whether advancements should be announced in chat | Yes | No |
| doDaylightCycle | Whether the daylight cycle and moon phases progress | Yes | Yes |
| doFireTick | Whether fire should spread and naturally extinguish | Yes | Yes |
| doInsomnia | Whether phantoms can spawn in the nighttime | Yes | Yes |
| doWeatherCycle | Whether the weather can change naturally. The /weather command can still change weather. | Yes | Yes |
| keepInventory | Whether the player should keep items and experience in their inventory after death | Yes | Yes |
| playersSleepingPercentage | What percentage of players must sleep to skip the night. | Yes | No |
A full list of game rules can be found here.
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/gamerule doDaylightCycle false will stop the day-night cycle. /gamerule keepInventory true will allow players to respawn with their inventory if they die. /gamerule commandBlockOutput false will stop command blocks from posting what they do in the chat.
Fill
Command
/fill
Description
Fills all or parts of a region with a specified block
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/fill 100 10 -129 52 20 -150 stone fills all blocks in that area with stone. /fill 100 10 -129 52 20 -150 water turns all the blocks into water sources. /fill ~-15 ~-15 ~-15 ~15 ~15 ~15 stone hollow creates a cube of stone at the execution’s location that is hollow on the inside. /fill 100 10 -129 52 20 -150 minecraft:stone replace minecraft:purple_concrete replaces all purple concrete in the selected area with stone.
Gamemode
Command
/gamemode
Description
Sets a player’s game mode
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/gamemode creative sets the game mode as creative for whoever executed the command. /gamemode survival @a changes everyone’s game mode to survival.
Enchant
Command
/enchant
Description
Adds an enchantment to a player’s selected item, subject to the same restrictions as an anvil. Check out this guide for a list of the top 10 enchantments!
Version Availability
| Version | Available? |
|---|---|
| Bedrock Edition | Yes |
| Java Edition | Yes |
| Education Edition | Yes |
Requirements
| Version | OP Level |
|---|---|
| Bedrock Edition | 1 |
| Java Edition | 2 |
| Education Edition | 1 |
Examples
/enchant Storiofmylife unbreaking 3 will enchant whatever item Storiofmylife is holding with Unbreaking 3. /enchant @a infinity will enchant all players holding a bow with Infinity.