Minecraft Commands Cheat Sheet: The Commands You Will Actually Use
Teleport, gamemode, give, time, weather, locate, effect, enchant, fill and more — the syntax, the Java/Bedrock differences and the mistakes that make commands silently fail.
The short answer
- Turn them on
- “Allow Cheats” (Java) or “Activate Cheats” (Bedrock) in world settings. On a server, only operators can use them.
- The syntax
- Start with
/. Coordinates are X Y Z.~means “relative to me”,^means “relative to the way I am looking”.@pnearest player,@aall players,@eall entities,@syourself. - The ten you will use
- tp, gamemode, give, time, weather, locate, effect, enchant, fill, gamerule.
- Java vs Bedrock
- Same commands, small syntax differences. Watch the autocomplete — it knows which edition you are on.
On this page
Enabling commands
In single-player, commands are controlled by the cheats setting. On Java, set “Allow Cheats: ON” when creating a world; on an existing world, pause, choose “Open to LAN”, enable cheats, and they work until you quit (or edit the world’s settings from the world list to make it permanent). On Bedrock, open the world settings and toggle “Activate Cheats”; this permanently disables achievements for that world, and the game warns you.
On multiplayer servers, commands are restricted to operators. If you run your own server, op PlayerName in the console grants it — see the hosting guide. Some servers give ordinary players a few plugin commands (/spawn, /home, /tpa); those are not vanilla and vary by server.
Reading the syntax
- Every command begins with
/in chat. Command blocks and the server console omit it. - Coordinates are written X Y Z, separated by spaces. Y is height.
~on its own means “my current value”;~5means “my value plus 5”.^is the same idea relative to where you are facing (^ ^ ^5= five blocks ahead). - Target selectors stand in for a player name:
@pnearest player,@rrandom player,@aall players,@eall entities (including mobs and items),@sthe one running the command. Selectors take filters in square brackets:@e[type=zombie,distance=..10]on Java;@e[type=zombie,r=10]on Bedrock. - Java item and block names are lowercase with underscores, optionally prefixed
minecraft:—diamond_sword,oak_planks. Bedrock uses the same names for nearly everything. - Press Tab (Java) or watch the pop-up (Bedrock) while typing. Autocomplete lists valid options and is the fastest way to learn any command.
Movement and world
| Command | Example | What it does |
|---|---|---|
/tp | /tp 100 64 -200/tp Alex Steve | Teleport to coordinates, or one player to another. /tp ~ ~20 ~ goes straight up 20. |
/gamemode | /gamemode creativeBedrock: /gamemode c | survival, creative, adventure, spectator (Java only). Add a player name to change someone else. |
/time set | /time set day/time set 18000 | day = 1000, noon = 6000, night = 13000, midnight = 18000. /time add 1000 advances. The tick converter decodes any value. |
/weather | /weather clear 100000 | clear, rain, thunder, with an optional duration in seconds. |
/locate | Java: /locate structure minecraft:strongholdBedrock: /locate structure stronghold | Prints the nearest structure’s coordinates. Java also has /locate biome and /locate poi. |
/spawnpoint | /spawnpoint | Sets your personal respawn point where you stand (or at given coordinates). |
/setworldspawn | /setworldspawn 0 70 0 | Sets where new players and bed-less players spawn. |
/seed | /seed | Shows the world seed. Works without cheats in single-player on Java. |
/difficulty | /difficulty hard | peaceful, easy, normal, hard. |
/kill | /kill @e[type=item] | Kills the target. The example clears dropped items (lag fix). /kill alone kills you. |
Items, effects and enchantments
| Command | Example | What it does |
|---|---|---|
/give | /give @s diamond 64/give Steve netherite_pickaxe | Gives items. Count after the item name. |
/clear | /clear @s rotten_flesh | Removes items; with no item name it empties the inventory. |
/enchant | /enchant @s sharpness 5 | Enchants the held item, within normal level limits. Use the enchantments guide for names. |
/effect | Java: /effect give @s night_vision 600 1Bedrock: /effect @s night_vision 600 1 | Applies an effect for a duration in seconds and an amplifier (0 = level I). /effect clear @s removes all. |
/xp | /xp add @s 30 levelsBedrock: /xp 30L @s | Adds levels or points. See the XP calculator for how many points a level is. |
/summon | /summon horse ~ ~ ~ | Spawns an entity at coordinates. Java accepts NBT data for custom mobs. |
/item (Java) | /item replace entity @s armor.head with diamond_helmet | Puts an item directly into a slot. |
Building: fill, clone, setblock
| Command | Example | What it does |
|---|---|---|
/setblock | /setblock ~ ~-1 ~ glowstone | Places one block. |
/fill | /fill 0 64 0 20 70 20 stone/fill ~-5 ~ ~-5 ~5 ~10 ~5 air | Fills a box between two corners. Up to 32,768 blocks per command on Java (larger with a gamerule). hollow at the end makes a shell; replace water only changes water. |
/clone | /clone 0 64 0 10 70 10 100 64 100 | Copies the box from the first two corners to the third position. |
/fill … air | /fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 air replace water | The standard “drain a pond” command. |
Two safety habits: stand where you can see the area first, and run a small test fill before a large one. There is no undo for a wrong /fill, which is why backups exist.
Game rules worth knowing
| Gamerule | Effect when set as shown |
|---|---|
/gamerule keepInventory true | Keep items and XP on death. |
/gamerule doDaylightCycle false | Freeze the time of day. |
/gamerule doWeatherCycle false | Freeze the weather. |
/gamerule mobGriefing false | Creepers stop destroying blocks, endermen stop moving them, villagers stop farming. |
/gamerule doMobSpawning false | No natural hostile spawns (spawners still work). |
/gamerule doFireTick false | Fire stops spreading. Useful on build servers. |
/gamerule doInsomnia false | No phantoms. |
/gamerule randomTickSpeed 3 | Growth speed; 3 is default. Raising it briefly grows crops fast but also spreads fire and kills grass under blocks. |
/gamerule playersSleepingPercentage 1 (Java) | One sleeping player skips the night on a server. Bedrock has the same as a world setting. |
/gamerule showCoordinates true (Bedrock) | Shows coordinates on screen. Java uses F3 instead. |
Server admin commands
| Command | What it does |
|---|---|
/op Name, /deop Name | Grant or remove operator status. |
/whitelist add Name, /whitelist on | Manage the allow-list. Bedrock calls it /allowlist. |
/kick Name reason, /ban Name reason, /pardon Name | Moderation. Bans by name; /ban-ip by address. |
/save-all, /save-off, /save-on | Force a save; pause and resume saving for backups. |
/stop | Shut down cleanly. Always this, never closing the window. |
/list | Who is online. |
/tps (Paper) | Server tick rate; 20 is healthy. |
/say, /tellraw, /title | Broadcast, formatted chat, and on-screen titles. |
/worldborder set 5000 | Limit the world to a 5,000-block square. Keeps file size and exploration sane on a public server. |
Why commands silently fail
- Wrong edition syntax.
/effect giveis Java; Bedrock omitsgive./gamemode 1works on Bedrock and old Java but not modern Java. When the autocomplete does not offer what you are typing, you are on the wrong edition’s syntax. - Selectors that match nothing.
@e[type=zombie]when no zombie is loaded does nothing and says so quietly. - Unloaded chunks.
/filland/cloneonly work in loaded chunks. Stand near the area or use/forceload(Java) //tickingarea(Bedrock). - Case and spelling. Player names are case-sensitive on Java. Item names are all lowercase.
- Command blocks with the slash. Command blocks and the server console take the command without a leading
/(Java tolerates it; the console does not). - Not an operator. On a server, the message is usually “You do not have permission”. On Bedrock, some world settings also block specific commands for non-hosts.
Frequently asked questions
How do I enable commands in my world?
On Java, turn on "Allow Cheats" when creating the world, or open the world to LAN with cheats enabled for the current session. On Bedrock, toggle "Activate Cheats" in world settings. Both disable achievements/advancements for that world on Bedrock; Java keeps advancements.
Why does my command say "Unknown command" or nothing happens?
Usually a typo, a missing slash, or a command that does not exist on your edition. Java and Bedrock share most commands but differ in syntax details — Bedrock uses /gamemode s and Java uses /gamemode survival, for example. Check the autocomplete suggestions that appear as you type.
How do I teleport to coordinates?
/tp X Y Z, for example /tp 100 64 -200. Use ~ for "relative to where I am": /tp ~ ~10 ~ moves you ten blocks up. On Bedrock the command is the same.
How do I find a village or stronghold with commands?
Java: /locate structure village_plains (or minecraft:stronghold, minecraft:fortress, and so on). Bedrock: /locate structure village. The command prints the nearest coordinates; click them in Java chat to fill a /tp command.
Can I use commands on a multiplayer server?
Only if the server operator has made you an operator. Regular players cannot run cheat commands on a server, which is the point. Some servers add their own plugin commands like /home or /spawn that everyone can use.
How do I keep my inventory when I die?
/gamerule keepInventory true. It applies to everyone in the world. Set it back to false to restore normal behaviour.
Teleporting between dimensions?
The Nether portal calculator converts Overworld coordinates to Nether coordinates for your /tp, and the distance calculator tells you how far apart two points really are.
Read next
Minecraft Enchantments Guide: Every Enchantment, Max Level and Best Setup
Every enchantment for every tool with its max level and what it actually does, the best full-set loadouts, and how to build a bookshelf table and anvil combos without wasting levels.
Minecraft Villager Trading Guide: Professions, Best Trades and Trading Halls
Every profession and its workstation, the trades worth cycling for, how to zombify-and-cure for cheap prices, and how to build a trading hall that does not fall apart.
Minecraft Nether Guide: Portals, Biomes, Fortresses, Bastions and Netherite
How to build and link portals, what lives in each Nether biome, finding fortresses and bastions, and the fastest safe way to netherite.