Most Minecraft commands lists are alphabetical, which is useless when you do not know the name of the thing you want. This one is organised by what you are trying to do: change the world, get an item, move somewhere, or alter the rules.
Three things decide whether any of it works, and they come first: cheats have to be enabled, targets are chosen with a selector rather than a name, and Java and Bedrock do not share a command set. After that, the commands themselves are straightforward.
Minecraft Commands: The Three Things to Understand First
Before any individual command, these three decide whether it will work at all.
| # | Kind | Syntax | Worth knowing | |
|---|---|---|---|---|
| 1 | Turning commands on | Setup | No command needed | Single player achievements pause while cheats are on |
| 2 | Target selectors | Syntax | @p @r @a @e @s | Arguments in square brackets narrow the selection |
| 3 | Java and Bedrock differ | Platform | Java and Bedrock syntax diverges | Consoles and phones run Bedrock |
The Three Things to Get Right First
Skip these and half the commands below will fail with an error that does not explain itself.
1. Turning Commands On: Getting access in the first place

Where: World settings, or Open to LAN · Syntax: No command needed · Worth knowing: Single player achievements pause while cheats are on
Commands only work in a world where cheats are allowed. The switch is offered when a world is created, and most people turn it off without thinking and then want it later.
An existing single player world can be converted without starting again. Open the pause menu, choose Open to LAN, set Allow Cheats to on and start the LAN world. Commands work for the rest of that session, and repeating it each time you load the world is the standard workaround.
On a server, command access is controlled by operator status rather than by a world setting, so an administrator grants it per player.
Turning commands on download page
2. Target Selectors: Writing one command instead of ten

Where: Any command that takes a target · Syntax: @p @r @a @e @s · Worth knowing: Arguments in square brackets narrow the selection
Most commands need to know who they apply to, and typing a player name works but does not scale. Five shorthands cover it: @p is the nearest player, @r a random one, @a everybody, @e every entity including mobs, and @s whoever ran the command.
They become powerful with arguments in square brackets, which filter the selection. You can restrict by type, by distance, by team, by score or by how many targets to affect, so a single command can hit every zombie within forty blocks and nothing else.
This is the part worth learning properly. Once selectors make sense, commands stop being a list to memorise and become something you can compose.
3. Java and Bedrock Differ: Knowing why a command you found does not work

Where: Every platform · Syntax: Java and Bedrock syntax diverges · Worth knowing: Consoles and phones run Bedrock
Java Edition and Bedrock Edition are different programs that share a name, and their commands have drifted apart. Most of the basics match, and the moment you reach anything advanced they do not.
Bedrock has no function files and handles data differently, while Java supports NBT data tags that Bedrock does not read at all. Bedrock also accepts some shorthand Java rejects.
The practical rule is to check which edition any command you copy was written for. Consoles, phones, tablets and the Microsoft Store version of Windows all run Bedrock, and the PC version bought from Minecraft’s own store includes both.
Java and Bedrock differ product page
Changing the World: Mode, Time, Weather and Difficulty
These four are the commands people reach for most, and all of them take effect instantly.
- /gamemode creative switches you to flight and unlimited blocks. Survival, adventure and spectator are the other three values.
- /time set day jumps to morning. Night, noon and midnight all work, as does a raw number of ticks if you want a precise time.
- /weather clear stops rain. Rain and thunder force the opposite, and adding a number of seconds afterwards sets how long it lasts.
- /difficulty peaceful removes hostile mobs entirely and regenerates health. Easy, normal and hard are the others.
A command run in single player applies to you. On a server it applies to the world, so changing the weather affects everybody logged in, which is worth remembering before clearing a storm somebody else is farming in.
Getting Items, Enchantments and Effects
The item commands are where selectors start paying for themselves, because each one takes a target before it takes a thing.
- /give @s diamond_pickaxe 1 puts one item in your own inventory. Swap @s for @a to give it to everybody on the server.
- /enchant @s sharpness 5 applies an enchantment to the item you are holding, up to that enchantment’s normal maximum level.
- /effect give @s night_vision 300 1 grants an effect for three hundred seconds at amplifier one. /effect clear removes everything.
- /clear @s empties an inventory completely, which is quicker than throwing everything into lava when a creative test is finished.
Item names use the internal identifier rather than the display name, so it is diamond_pickaxe and not Diamond Pickaxe. The chat box autocompletes them as you type, which is the fastest way to find the right spelling.
Moving Around: Teleporting, Locating and Spawn
Navigation commands save more time than any other group, particularly on a large world.
- /tp @s 100 64 -200 moves you to those coordinates. Using a player name instead of coordinates teleports you to that player.
- /locate structure village reports the nearest match and its coordinates, which you then teleport to. Biomes work the same way with /locate biome.
- /spawnpoint sets where you respawn, and /setworldspawn does the same for everybody joining the world.
Coordinates can be relative instead of absolute. A tilde means your current position on that axis, so tp @s ~ ~50 ~ lifts you fifty blocks straight up without having to know where you are. A caret does the same relative to the direction you are facing.
The three numbers are always in the order sideways, height, forwards, and the height one is the one people get wrong. Teleporting into solid stone is survivable and alarming.
Game Rules and the Commands That Change the Rules
Game rules are settings rather than actions, and several of them transform how a world plays.
- /gamerule keepInventory true stops you dropping everything on death, which is the single most popular rule change in the game.
- /gamerule doDaylightCycle false freezes the sun where it is, useful for building without interruption.
- /gamerule mobGriefing false stops creepers cratering your work and endermen rearranging it.
- /gamerule randomTickSpeed 3 controls how fast crops grow and fire spreads. Large values will bring a world to a halt, so raise it carefully.
Rule names are case sensitive and use that run-together capitalisation, which is the most common reason a correctly spelled rule returns an error. Autocomplete avoids the problem entirely.
Command Blocks, and Running Commands Without Typing
Everything above is typed into chat and runs once. A command block stores a command and runs it when powered, which is how adventure maps, minigames and automatic systems are built.
You cannot craft one. /give @s command_block is the only way to obtain it, and it requires cheats like everything else here. Placing it opens an interface where the command goes, with no leading slash needed.
- Impulse runs once each time it receives power, which suits a button or a pressure plate.
- Chain runs immediately after the block pointing into it, so a row of them executes in order.
- Repeat runs every tick while powered, twenty times a second, which is how continuous effects are maintained.
Set Repeat blocks to Always Active sparingly. Twenty executions a second across several blocks is a real load on a server, and it is a common cause of a world that stutters for no obvious reason.
Frequently Asked Questions
How do you turn on cheats in Minecraft?
Enable them when creating the world, or in an existing single player world open the pause menu, choose Open to LAN, set Allow Cheats to on and start it. That lasts for the session and has to be repeated next time the world loads.
What is the command for creative mode?
Type /gamemode creative. The other values are survival, adventure and spectator. On a server you can change somebody else’s mode by adding their name or a selector, as in /gamemode creative @a for everybody.
How do you teleport in Minecraft?
/tp followed by coordinates, or by a player name to go to that player. A tilde before a number makes it relative to where you already are, so /tp @s ~ ~100 ~ puts you a hundred blocks above your current position.
Do commands disable achievements?
In single player, enabling cheats pauses achievement progress for that world. Servers handle it differently, since operator status rather than a world setting controls access, and normal progression continues for players without it.






