New How much Minecraft really costs in South Africa — every edition in rand
MinecraftSA

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”. @p nearest player, @a all players, @e all entities, @s yourself.
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.

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”; ~5 means “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: @p nearest player, @r random player, @a all players, @e all entities (including mobs and items), @s the 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.
Advertisement

Movement and world

CommandExampleWhat 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 creative
Bedrock: /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 100000clear, rain, thunder, with an optional duration in seconds.
/locateJava: /locate structure minecraft:stronghold
Bedrock: /locate structure stronghold
Prints the nearest structure’s coordinates. Java also has /locate biome and /locate poi.
/spawnpoint/spawnpointSets your personal respawn point where you stand (or at given coordinates).
/setworldspawn/setworldspawn 0 70 0Sets where new players and bed-less players spawn.
/seed/seedShows the world seed. Works without cheats in single-player on Java.
/difficulty/difficulty hardpeaceful, 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

CommandExampleWhat it does
/give/give @s diamond 64
/give Steve netherite_pickaxe
Gives items. Count after the item name.
/clear/clear @s rotten_fleshRemoves items; with no item name it empties the inventory.
/enchant/enchant @s sharpness 5Enchants the held item, within normal level limits. Use the enchantments guide for names.
/effectJava: /effect give @s night_vision 600 1
Bedrock: /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 levels
Bedrock: /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_helmetPuts an item directly into a slot.
Advertisement

Building: fill, clone, setblock

CommandExampleWhat it does
/setblock/setblock ~ ~-1 ~ glowstonePlaces 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 100Copies the box from the first two corners to the third position.
/fill … air/fill ~-10 ~-1 ~-10 ~10 ~-1 ~10 air replace waterThe 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

GameruleEffect when set as shown
/gamerule keepInventory trueKeep items and XP on death.
/gamerule doDaylightCycle falseFreeze the time of day.
/gamerule doWeatherCycle falseFreeze the weather.
/gamerule mobGriefing falseCreepers stop destroying blocks, endermen stop moving them, villagers stop farming.
/gamerule doMobSpawning falseNo natural hostile spawns (spawners still work).
/gamerule doFireTick falseFire stops spreading. Useful on build servers.
/gamerule doInsomnia falseNo phantoms.
/gamerule randomTickSpeed 3Growth 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

CommandWhat it does
/op Name, /deop NameGrant or remove operator status.
/whitelist add Name, /whitelist onManage the allow-list. Bedrock calls it /allowlist.
/kick Name reason, /ban Name reason, /pardon NameModeration. Bans by name; /ban-ip by address.
/save-all, /save-off, /save-onForce a save; pause and resume saving for backups.
/stopShut down cleanly. Always this, never closing the window.
/listWho is online.
/tps (Paper)Server tick rate; 20 is healthy.
/say, /tellraw, /titleBroadcast, formatted chat, and on-screen titles.
/worldborder set 5000Limit 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 give is Java; Bedrock omits give. /gamemode 1 works 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. /fill and /clone only 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.

Advertisement
All guides →
Advertisement