Minecraft Commands: Full List With Examples (Java and Bedrock)
Want daytime forever, a stack of diamonds, or a quick trip across the map? Minecraft commands let you control almost everything in your world by typing a short line in chat. This guide shows you how to turn on cheats, how command syntax works, and gives you a full list of the most useful Minecraft commands with ready-to-copy examples for Bedrock (Minecraft PE) and Java Edition.
The commands work in the latest Minecraft APK, Bedrock Edition and Java Edition. Small differences are marked.

What Are Minecraft Commands?
Minecraft commands are text instructions that start with a slash (/). Type them in the chat box and the game carries them out instantly: change the time, give items, teleport, spawn mobs, change rules and much more. Builders use them to save time, map makers use them to create adventures, and server owners use them to manage players.
How to Enable Cheats (Commands)
Bedrock and Minecraft PE
- Create a new world or tap the pencil icon to edit an existing one.
- Open the Cheats section and turn on Activate Cheats.
- Confirm the warning. Achievements are turned off for that world.
- In the game, tap the chat button and type a command starting with /.
Java Edition
- When creating a world, set Allow Commands to ON.
- For an existing world: press Esc, choose Open to LAN, turn on Allow Commands and start the LAN world. This lasts until you leave.
- Press T or / to open chat and type the command.
Tip: back up your world before experimenting. Our guide on how to back up Minecraft worlds shows how.
Command Basics: Syntax and Target Selectors
All Minecraft commands follow a similar pattern. Most commands follow the pattern /command target value. The target tells the game who the command affects:
| Selector | Targets |
|---|---|
| @s | Yourself (the player running the command) |
| @p | The nearest player |
| @a | All players |
| @r | A random player |
| @e | All entities (mobs, items and players) |
| PlayerName | One specific player |
Coordinates are written as X Y Z. A tilde (~) means “relative to where I am”, so ~ ~10 ~ means 10 blocks above you. The Minecraft Wiki commands page lists every option. Press Tab on Java, or look at the suggestions above the chat on Bedrock, to auto-complete commands.
Most Useful Minecraft Commands
| Command | What It Does | Example |
|---|---|---|
| /gamemode | Change game mode | /gamemode creative |
| /time set | Change the time of day | /time set day |
| /weather | Change the weather | /weather clear |
| /give | Give items | /give @s diamond 64 |
| /tp | Teleport | /tp @s 100 70 -200 |
| /summon | Spawn a mob or entity | /summon wolf |
| /kill | Remove entities | /kill @e[type=zombie] |
| /clear | Empty an inventory | /clear @s |
| /difficulty | Change difficulty | /difficulty peaceful |
| /locate | Find structures or biomes | /locate structure village |
| /spawnpoint | Set a player’s respawn point | /spawnpoint @s |
| /setworldspawn | Set the world spawn | /setworldspawn |
| /fill | Fill an area with blocks | /fill ~ ~ ~ ~10 ~5 ~10 stone |
| /clone | Copy an area | /clone 0 64 0 10 70 10 20 64 20 |
| /say | Send a message to everyone | /say Hello world |
Game Mode, Time and Weather Commands
- These are the Minecraft commands players use most every day.
/gamemode survival,/gamemode creative,/gamemode adventureand/gamemode spectatorswitch modes./time set day,night,noonormidnightchange the time. Bedrock also acceptssunriseandsunset./time add 1000moves time forward by 1,000 ticks (a full day is 24,000 ticks)./weather clear,/weather rainor/weather thunderchange the weather. Add a number of seconds to set how long it lasts.
Item and Inventory Commands
/give @s netherite_sword 1gives you an item. Use item IDs with underscores./enchant @s sharpness 5enchants the item in your hand (up to the normal maximum level)./clear @s dirtremoves only dirt from your inventory./give @s command_blockgives you a command block (Creative and cheats only).
Teleport and Location Commands
/tp @s 0 100 0teleports you to exact coordinates./tp @s FriendNameteleports you to another player./locate structure villageor/locate structure ancient_cityshows the coordinates of the nearest structure. On Java, villages have biome names likevillage_plains./locate biome cherry_grovefinds the nearest biome.
Want permanent fast travel without cheats? See how to make portals in Minecraft.
Mob and Effect Commands
/summon zombiespawns a mob at your position. Learn about each variant in our Minecraft zombies guide./kill @e[type=creeper]removes every creeper in loaded areas.- Java:
/effect give @s night_vision 300 0gives Night Vision for 300 seconds. - Bedrock:
/effect @s night_vision 300 0does the same. /effect clear @s(Java) or/effect @s clear(Bedrock) removes all effects.
World Rule Commands (Gamerules)
Gamerule Minecraft commands change how your world behaves. These are the Bedrock names; Java Edition renamed many gamerules in recent versions, so type /gamerule and use auto-complete to see the exact names in your version.
| Command (Bedrock) | Effect |
|---|---|
| /gamerule keepinventory true | Keep your items when you die |
| /gamerule dodaylightcycle false | Stop the day and night cycle |
| /gamerule doweathercycle false | Stop weather changes |
| /gamerule mobgriefing false | Stop creepers and other mobs from breaking blocks |
| /gamerule showcoordinates true | Show your coordinates on screen |
| /gamerule domobspawning false | Stop mobs from spawning naturally |
Building Commands
/fill and /clone are huge time savers for big builds. For example, /fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 oak_planks creates an 11 by 11 wooden floor under you. Combine them with our guide on how to build a house in Minecraft to finish projects faster. Most game versions limit how many blocks one command can change, so split very large areas into parts.
Advanced: /execute and Command Blocks
The most powerful Minecraft commands are /execute and command blocks. /execute runs another command as or at a different entity, or only when a condition is true. Example (Java and Bedrock): /execute as @a at @s run summon lightning_bolt strikes lightning on every player. Command blocks run commands automatically with Redstone power, which is how map makers create minigames and adventure maps.
Java vs Bedrock Command Differences
| Task | Java Edition | Bedrock / PE |
|---|---|---|
| Give an effect | /effect give @s speed 60 1 | /effect @s speed 60 1 |
| Add experience levels | /xp add @s 10 levels | /xp 10L @s |
| Show world seed | /seed | Seed is shown in world settings |
| Show coordinates | Press F3 | /gamerule showcoordinates true |
| Achievements | Not affected | Disabled when cheats are on |
Planning to try new worlds? See our guide to Minecraft seeds.
Common Command Errors and Fixes
| Error | Fix |
|---|---|
| “You do not have permission” | Turn on cheats or ask the server owner for operator rights |
| “Unknown command” | Check spelling and that the command exists in your edition |
| Item not found | Use the item ID with underscores, like golden_apple |
| Nothing happens | Check the target selector and coordinates |
| Too many blocks | Split /fill or /clone into smaller areas |
Frequently Asked Questions
Do Minecraft commands work on mobile?
Yes. Turn on Activate Cheats in your world settings, tap the chat button and type the command.
Do commands disable achievements?
On Bedrock and Minecraft PE, yes: turning on cheats disables achievements for that world. Java Edition advancements are not affected the same way.
What is the command to keep inventory?
On Bedrock type /gamerule keepinventory true. On Java, type /gamerule and use auto-complete to find the keep inventory rule name for your version.
How do I find a village with commands?
Use /locate structure village on Bedrock, or /locate structure with a village type such as village_plains on Java.
Can I use commands on servers?
Only if the server gives you operator permissions. Most public servers do not allow players to use cheat commands.
Final Thoughts
Minecraft commands turn you into the boss of your world. Turn on cheats, learn the target selectors, and start with the basics like /gamemode, /time, /weather, /give and /tp. Then move on to /locate, /fill, gamerules and /execute as you get comfortable. Keep a backup, remember that Bedrock disables achievements with cheats, and use auto-complete when you are unsure of a name. New to the game? Read how to play Minecraft first.
