Guides

Minecraft Commands List: Java and Bedrock Commands With Examples

Blocky Minecraft-style player holding a glowing command block while transparent cube outlines fill in a stone castle at sunset
Written by Skye

Every key Minecraft command for Java 26.3 and Bedrock 26.60 with copy-paste examples: give, teleport, game mode, time, effects, locate, fill and game rules.

To use any command in this Minecraft commands list, turn on cheats for your world (Allow Commands on Java, the Cheats toggle on Bedrock), open chat with T or /, and type a command such as /gamemode creative, /give @s diamond 64 or /tp @s 100 64 -200. Most everyday commands are spelled the same on both editions. The differences are in /give extras, /effect, /xp and especially /gamerule, where Java switched to new snake_case names in December 2025.

This Minecraft commands list is written for Java Edition 26.3 (“Wilderness Bound”, released September 15, 2026) and Bedrock Edition 26.60 (released October 27, 2026). Checked October 28, 2026, 16:00 UTC. Every syntax line below comes from the Minecraft Wiki commands pages, Mojang’s Java 26.3 release notes and Bedrock 26.60 changelog, and Microsoft’s Bedrock commands documentation.

Minecraft commands list: the most used commands

  • Creative mode: /gamemode creative (both editions). Bedrock also accepts /gamemode c and /gamemode 1.
  • Give an item: /give @s diamond 64 (both).
  • Teleport: /tp @s 100 64 -200 (both). /tp and /teleport are the same command.
  • Make it day / stop rain: /time set day and /weather clear (both).
  • Keep items when you die: Java /gamerule keep_inventory true, Bedrock /gamerule keepinventory true.
  • Find a village: Java /locate structure #village, Bedrock /locate structure village.
  • Night vision forever: Java /effect give @s night_vision infinite 0 true, Bedrock /effect @s night_vision infinite 0 true.
  • Achievements: on Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.

How to enable cheats and commands in Minecraft

Java Edition (26.3)

  1. New world: in Create New World, set Allow Commands to ON.
  2. Existing singleplayer world (new in 26.3): press Esc, open World Options (it replaced the old Open to LAN button) and switch Allow Commands on. Mojang’s 26.3 notes describe it as “Controls whether you can use commands in this world or not”. It isn’t available in Hardcore worlds.
  3. Friends on LAN: in the same World Options screen, the Multiplayer section has Command Access, which decides whether players who join can use commands.
  4. Servers: you need operator status (permission level 2 for most commands, per the wiki).

Older guides tell you to use Open to LAN and then Allow Cheats to unlock commands in an existing world. Since 26.2 that LAN screen no longer gives the host commands, so use World Options instead.

Bedrock Edition (26.60)

  1. On the world list, select the Edit (pencil) button for your world, or start a new world.
  2. Open the Cheats section and turn cheats on. You can also do this mid-game from the settings menu.
  3. Confirm the warning. Microsoft’s docs say: “Be aware that enabling cheats will disable achievements for that world.”

Microsoft’s documentation also notes that setting a world’s default game mode to Creative turns cheats on, and that you may need the “operator commands” permission on older worlds. On consoles, the chat button on the controller’s d-pad opens the chat box.

Do commands disable achievements?

On Bedrock, yes. According to the Minecraft Wiki, enabling cheats “permanently prevents players from unlocking achievements in that world, even if cheats are later turned off”. The same applies to Creative mode, since it switches cheats on. If you want achievements, try commands in a copy of your world first.

On Java, no. Java Edition doesn’t have achievements. It replaced them with advancements years ago, so the Bedrock rule doesn’t apply.

Java vs Bedrock: the syntax differences that break commands

What you want Java Edition 26.3 Bedrock Edition 26.60
Give a potion effect effect give @s speed 60 1 effect @s speed 60 1
Clear effects effect clear @s effect @s clear
Add 30 XP levels xp add @s 30 levels xp 30L @s
Game rule names snake_case: keep_inventory one lowercase word: keepinventory
Mobs within 10 blocks @e[type=creeper,distance=..10] @e[type=creeper,r=10]
Item extras in /give components in brackets: diamond_sword[enchantments={"minecraft:sharpness":5}] amount, data value, then JSON: diamond_sword 1 0 {"keep_on_death":{}}
Show coordinates F3 debug screen gamerule showcoordinates true
Change dimension execute in minecraft:the_nether run tp @s ~ ~ ~ execute in nether run tp @s ~ ~ ~

Target selectors work the same way in both editions: @s (you), @p (nearest player), @a (all players), @r (random player), @e (all entities) and @n (nearest entity, added in Java 1.21 and Bedrock 1.21.100). Bedrock also has @initiator for NPC buttons. ~ means “relative to me” (~ ~5 ~ is 5 blocks up) and ^ means “relative to where I’m looking” (^ ^ ^5 is 5 blocks forward).

Give commands

Syntax: Java give <targets> <item> [<count>]. Bedrock give <player> <itemName> [amount] [data] [components]. Java won’t give more than 100 stacks in one command.

Goal Java Bedrock
64 diamonds to yourself give @s diamond 64 give @s diamond 64
Elytra to every player give @a elytra give @a elytra
Pig spawn egg to the nearest player give @p pig_spawn_egg give @p pig_spawn_egg
Sharpness V diamond sword give @s diamond_sword[enchantments={"minecraft:sharpness":5}] give @s diamond_sword, then hold it and run enchant @s sharpness 5
Night vision potion give @s potion[potion_contents={potion:"minecraft:night_vision"}] give @s potion 1 5
Sword you keep when you die use gamerule keep_inventory true give @s diamond_sword 1 0 {"keep_on_death":{}}

/enchant works on the item in your main hand and follows the same limits as an anvil, so enchant @s sharpness 10 fails. Java’s /give with an enchantments component can go past the normal maximum level.

Teleport commands (/tp)

Goal Command (both editions unless noted)
Go to exact coordinates tp @s 100 64 -200
Go 10 blocks straight up tp @s ~ ~10 ~
Go 5 blocks forward tp @s ^ ^ ^5
Teleport to a player tp @s Alex
Bring all players to you tp @a @s
Same spot in the Nether Java execute in minecraft:the_nether run tp @s ~ ~ ~, Bedrock execute in nether run tp @s ~ ~ ~
Only teleport if you won’t land inside a block (Bedrock) tp @s 100 64 -200 true
Minecraft player looking through a spyglass across a river toward tall striped badlands cliffs

Scouting the badlands. /tp @s ^ ^ ^5 moves you five blocks in the direction you're facing. Image: Mojang Studios

Game mode and difficulty commands

Goal Java Bedrock
Creative gamemode creative gamemode creative / gamemode c / gamemode 1
Survival for everyone gamemode survival @a gamemode survival @a
Spectator gamemode spectator gamemode spectator
Hard difficulty difficulty hard difficulty hard / difficulty h / difficulty 3

Java dropped the short forms (c, 1) in 1.13, so they only work on Bedrock. Java 26.3 also lets you change your own game mode from World Options (Personal Game Mode).

Time and weather commands

Goal Command (both editions unless noted)
Morning / noon / night / midnight time set day, time set noon, time set night, time set midnight
Sunrise or sunset (Bedrock) time set sunrise, time set sunset
Skip a full day time add 24000
Freeze time / unfreeze it time pause and time resume (Java 26.1+, Bedrock 26.60+)
Make days pass twice as fast (Java) time rate 2
Clear skies for one in-game day weather clear 24000
Rain or thunderstorm weather rain, weather thunder
Check the weather (Bedrock) weather query

Times are in game ticks: 20 ticks are one second and 24,000 ticks are a full day. time pause and time resume are new. Java got them with the world clocks system in 26.1, and Bedrock 26.60 moved them out of the Creator World Clocks experiment, according to Mojang’s changelog. If you just want permanent daytime, run time set day first, then time pause.

Effect commands

Goal Java Bedrock
Speed II for 60 seconds effect give @s speed 60 1 effect @s speed 60 1
Permanent night vision, no particles effect give @s night_vision infinite 0 true effect @s night_vision infinite 0 true
Remove all effects effect clear @s effect @s clear
Remove one effect from everyone effect clear @a haste effect @a clear haste

The amplifier starts at 0, so 1 means level II. The last true hides the particles.

Summon commands (spawn mobs)

Goal Java Bedrock
Spawn a mob on you summon zombie ~ ~ ~ summon zombie ~ ~ ~
Lightning 10 blocks west summon lightning_bolt ~-10 ~ ~ summon lightning_bolt ~-10 ~ ~
Named mob summon wolf ~ ~ ~ {CustomName:"Rex"} summon wolf Rex ~ ~ ~
Charged creeper summon creeper ~ ~ ~ {powered:true} use summon lightning_bolt next to a creeper
Baby zombie summon zombie ~ ~ ~ {IsBaby:true} no NBT on Bedrock
Patrol captain (Bedrock) not needed summon pillager ~ ~ ~ ~ ~ minecraft:spawn_as_patrol_captain

Bedrock has no NBT data tags, so the curly-bracket extras only work on Java. Bedrock uses spawn events (like the patrol captain example) and a name argument instead.

Locate commands (find villages, biomes and structures)

Find Java Bedrock
Any village locate structure #village locate structure village
Plains village only locate structure village_plains not split by type
Ancient city locate structure ancient_city locate structure ancient_city
Trial chambers locate structure trial_chambers locate structure trial_chambers
Stronghold (End portal) locate structure stronghold locate structure stronghold
Nether fortress (run in the Nether) locate structure fortress locate structure fortress
Desert or jungle temple locate structure desert_pyramid / jungle_pyramid locate structure temple
Cherry grove biome locate biome cherry_grove locate biome cherry_grove
Dappled forest (new 2026 biome) locate biome dappled_forest locate biome dappled_forest

The result shows the coordinates and the distance. On Java you can click the coordinates to put a ready-made /tp command in chat. The structure search ignores height, so the y value it prints is ~. Teleport to a high y value in Creative mode and fly down, or add the Bedrock true check.

Red, orange and yellow poplar trees in the dappled forest biome added to Minecraft in 2026, seen at dusk

The dappled forest arrived in Java 26.3 and Bedrock 26.50. Find one with /locate biome dappled_forest on either edition. Image: Mojang Studios

Fill and clone commands (for building)

Goal Command (both editions unless noted)
Solid stone box around you fill ~-3 ~ ~-4 ~3 ~4 ~4 stone
Hollow room (walls only, air inside) fill ~-3 ~ ~-4 ~3 ~4 ~4 stone hollow
Only fill the air, keep existing blocks fill ~-5 ~ ~-5 ~5 ~ ~5 glass keep
Swap one block for another Java fill 52 63 -1516 33 73 -1536 gold_block replace orange_glazed_terracotta, Bedrock fill 52 63 -1516 33 73 -1536 gold_block [] replace orange_glazed_terracotta
Copy a build 20 blocks east clone ~ ~ ~ ~10 ~10 ~10 ~20 ~ ~
Copy without the air blocks clone ~ ~ ~ ~10 ~10 ~10 ~20 ~ ~ masked

The first two coordinates are opposite corners of the area. On Java, one command can change up to 32,768 blocks by default. That cap is the max_block_modifications game rule, so split big builds into chunks or raise the rule. The third set of coordinates in clone is the lower northwest corner of where the copy goes.

Small Minecraft campsite in a forest with a chest, wool tent and flowers, the kind of build you can copy with clone

A forest campsite from the Wilderness Bound drop. /clone with masked copies a build like this without the surrounding air. Image: Mojang Studios

Gamerule commands (keep inventory, daylight cycle and more)

This is where most old command lists go wrong. In Java 1.21.11 (December 9, 2025) Mojang moved game rules into a registry and renamed every rule to snake_case, so keepInventory and doDaylightCycle don’t work on Java any more. Bedrock still uses its old one-word, lowercase names.

Effect Java 26.3 Bedrock 26.60
Keep items and XP on death gamerule keep_inventory true gamerule keepinventory true
Stop the day/night cycle gamerule advance_time false gamerule dodaylightcycle false
Stop weather changing gamerule advance_weather false gamerule doweathercycle false
Stop creepers and endermen breaking blocks gamerule mob_griefing false gamerule mobgriefing false
No phantoms gamerule spawn_phantoms false gamerule doinsomnia false
No mob spawning gamerule spawn_mobs false gamerule domobspawning false
Respawn instantly gamerule immediate_respawn true gamerule doimmediaterespawn true
One player sleeping skips the night gamerule players_sleeping_percentage 0 gamerule playerssleepingpercentage 0
Faster crop and tree growth gamerule random_tick_speed 10 (default 3) gamerule randomtickspeed 10 (default 1)
TNT doesn’t explode gamerule tnt_explodes false gamerule tntexplodes false
Coordinates on screen no rule (use F3) gamerule showcoordinates true

Type /gamerule on its own and the autocomplete list shows every rule your version accepts. Java 26.1 also added an in-game game rules screen with a search bar, under World Options > Edit Game Rules.

Other useful commands

Goal Java Bedrock
Delete dropped items (lag fix) kill @e[type=item] kill @e[type=item]
Enchant the held item enchant @s mending enchant @s mending
Set your respawn point here spawnpoint spawnpoint
Move the world spawn here setworldspawn setworldspawn
Remove all your levels xp set @s 0 levels xp -2147483648L @s

Be careful with kill @e[type=!player]. It removes every non-player entity, including item frames, armor stands, pets and minecarts.

Command changes in 2025 and 2026

Version (date) What changed
Java 1.21.11 (Dec 9, 2025) All game rules renamed to snake_case (for example doMobSpawning became spawn_mobs, doInsomnia became spawn_phantoms)
Java 26.1 (Mar 24, 2026) World Options screen added. /time now runs on world clocks, with pause, resume and rate
Java 26.3 (Sep 15, 2026) World Options replaces the Open to LAN button, with Allow Commands, Command Access and Personal Game Mode
Bedrock 26.60 (Oct 27, 2026) /time pause, /time resume, /time query time and /time of <clock> no longer need an experiment

Playing on the new Switch 2 version? Commands work the same there as on every other Bedrock platform. Our Minecraft Switch 2 upgrade guide covers what the free upgrade includes. If you’re building with /fill and /clone, our Minecraft cottage house ideas are a good starting point. For the spin-off, see our Minecraft Dungeons 2 best builds.

FAQ

How do I turn on cheats in an existing Minecraft Java world?

In Java 26.3, press Esc, open World Options and switch Allow Commands on. It works in singleplayer worlds but not Hardcore. On versions before 26.2, the old Open to LAN and Allow Cheats method gave you temporary command access.

Why does /gamerule keepInventory not work any more?

Java 1.21.11 renamed it to keep_inventory. Use /gamerule keep_inventory true on Java. On Bedrock, the name is still keepinventory.

Can you use commands on Minecraft for console, phone and Switch?

Yes. All Bedrock platforms, including Xbox, PlayStation, Switch, Switch 2, Android and iOS, use the same Bedrock syntax. Turn cheats on in the world settings and open chat with the chat button (on a controller, the d-pad).

Sources: Minecraft Wiki: Commands and individual command pages (give, teleport, gamemode, time, weather, effect, summon, locate, fill, clone, gamerule, enchant, kill, experience), Minecraft Wiki: Game rule, Minecraft Wiki: World Options, Minecraft.net: Java Edition 26.3, Minecraft Feedback: Bedrock 26.60 changelog, Microsoft Learn: Introduction to commands, Microsoft Learn: /fill. Checked October 28, 2026.

Featured image: AI-generated illustration

About the author

Skye

Skye is the AI writer for Fortnite and Minecraft at Gaming Route. She covers the Fortnite item shop, quests, seasons, codes and map codes, and Minecraft commands, seeds, mods, updates and builds, plus Hytale and Terraria, researched from Epic Games and Mojang announcements, patch notes and community wikis. Spotted a mistake? Get in touch through our contact page.

Leave a Comment