Games

Minecraft Console Commands 2026: The Most Useful Cheats for Bedrock and Java

What people call Minecraft "cheat codes" are really commands: short lines typed into chat, starting with a forward slash (/). Switching game modes, keeping it daytime, holding on to your items when you die or finding the nearest village each takes a single line. The only catch is writing the command the way your edition expects it.

Minecraft on Xbox, PlayStation, Nintendo Switch, Android, iOS and Windows is Bedrock Edition. The classic PC version, available on Windows, macOS and Linux, is Java Edition. On Windows the same Minecraft Launcher starts both editions, so check which one you are running. Most commands share the same name on both, but some are written differently, so where they differ, the table below lists the Bedrock and Java versions separately. Java syntax follows Java 26.3, released in September 2026.

How to turn on cheats

Bedrock: consoles, mobile and Windows

Turn on the Cheats option when you create a world, or later by editing an existing world's settings.

Warning: on Bedrock, enabling cheats permanently disables achievements for that world, even if you turn cheats off again afterwards. If you are hunting achievements, experiment in a separate world.

Java Edition (PC)

  • New world: switch on Allow Commands on the world creation screen.
  • Existing world (26.2 and later): press Esc, open World Options and switch on Allow Commands. The option is not available in Hardcore worlds.
  • Older Java versions: press Esc, choose Open to LAN, set Allow Cheats to on and start the LAN world. This only enables commands for that session.

On a server or a Realm, the world setting alone is not enough: you need operator permission. As the owner of a Realm you have it by default, but on a server you host yourself it is not automatic: give it to yourself by typing op PlayerName in the server console.

Steve and Alex in a Minecraft cherry blossom landscape

How to enter a command

  1. Open chat. On a keyboard, press T. In Java, the / key also opens chat with the slash already typed. On consoles, use the controller's chat button; on phones and tablets, tap the chat icon on screen.
  2. Start with /. Without the slash, the text is sent as a normal chat message. As you type, the game suggests matching commands, and on a keyboard Tab completes the highlighted option.
  3. Send it. If something is wrong, the command does not run and the game shows an error. With chat open, the up arrow key brings back your previous commands.

Most used Minecraft commands

@s targets you, @a all players, @p the nearest player and @e every entity, including animals and dropped items.

CommandWhat it does
/gamemode creativeSwitches you to Creative. Use survival to go back.
/difficulty peacefulMost hostile mobs vanish and stop spawning, and your health regenerates quickly on its own. A few exceptions such as shulkers and the Ender Dragon remain, and falling or drowning can still kill you.
Bedrock: /gamerule keepinventory true
Java: /gamerule keep_inventory true
You keep your items when you die instead of dropping them. Use false to turn it off.
/tp 100 70 -200Teleports you to those coordinates. /tp ~ ~10 ~ moves you 10 blocks straight up.
/tp PlayerNameTeleports you to that player.
/tp PlayerName 100 70 -200Teleports the named player, not you, to the coordinates.
/give @s diamond 64Gives you 64 diamonds. Items are written with their English IDs.
Bedrock: /locate structure village
Java: /locate structure #village
Shows the coordinates of the nearest village. Java treats villages as a tag, hence the #. stronghold, ancient_city and trial_chambers are written the same way in both editions.
/time set daySets the time to morning. Use night for nighttime.
Bedrock: /gamerule dodaylightcycle false
Java: /gamerule advance_time false
Stops the day-night cycle so the time stays fixed.
/weather clearClears the sky. rain brings rain, thunder a storm.
/summon wolfSpawns a wolf where you stand.
Bedrock: /effect @s night_vision 600
Java: /effect give @s night_vision 600
Night vision for 600 seconds (10 minutes). Use infinite instead of a number for no time limit.
Bedrock: /effect @s clear
Java: /effect clear @s
Removes all your active effects.
/kill @e[type=item]Removes only items lying on the ground.
Bedrock: /xp 100 @s
Java: /xp add @s 100
Gives you 100 experience points. In Java, add levels at the end to give levels instead.
/enchant @s sharpness 5Adds Sharpness V to the sword in your hand. Fails on items that cannot take the enchantment or above the maximum level.
/spawnpointMoves your spawn point to where you are standing.
/clear @s dirtRemoves only dirt from your inventory. Leave out the item and your whole inventory is wiped.
Bedrock: /gamerule showcoordinates true
Java: None
Keeps your coordinates on screen at all times. This rule exists only on Bedrock.

Be careful with /kill: the often-suggested /kill @e[type=!player] does not just clear out monsters. Your pets, villagers, item frames, armor stands and dropped items go too. If you only want to clean up items on the ground, /kill @e[type=item] is enough. And /kill with no target kills you.

Steve on horseback with villagers and an iron golem

Old syntax that no longer works

Some commands from older guides now throw errors. In most cases the command did not go away; only the way you write it changed:

  • /gamemode 1 and /gamemode 0: Java dropped numeric game modes in 1.13 (2018), so you need creative or survival. On Bedrock the numbers still work: 0 is Survival, 1 Creative, 2 Adventure.
  • /give @s 264: numeric item IDs also disappeared from Java in 1.13, and Bedrock's current command documentation identifies items by name too. Type diamond in both editions.
  • /toggledownfall: removed from Java in 1.13; use /weather clear or /weather rain instead. On Bedrock it still exists and toggles precipitation.
  • Old game rule names such as keepInventory and doDaylightCycle: Java 1.21.11 (December 9, 2025) moved every game rule to lowercase names with underscores, and some got entirely new names: doDaylightCycle is now advance_time and doMobSpawning is spawn_mobs. The old names return an error in Java. Bedrock's names (keepinventory, dodaylightcycle) have not changed.
  • /effect without give in Java: /effect @s speed 60 works on Bedrock but fails in Java, where effects are applied with /effect give and removed with /effect clear.
  • Curly-brace NBT in /give: since Java 1.20.5 (April 2024), item data is written as item components in square brackets instead of {...}. For example, /give @s stick{foo:'bar'} is now /give @s stick[custom_data={foo:'bar'}].
Aerial view of a cherry grove biome

Command not working? Check these

  • Are cheats on? Check the Cheats option in the world settings on Bedrock, or Allow Commands in Java.
  • Do you have permission? On a server or Realm you need operator status, and on a server you host yourself you have to give it to yourself first. On Bedrock, the "Operator Commands" permission, found in the player permissions menu next to your name in the pause menu, must also be on.
  • Are you using the right edition's syntax? Java syntax (keep_inventory, /effect give) fails on consoles, and Bedrock syntax fails in Java on PC.
  • Any typos? Commands use English IDs. A missing space or a wrong bracket breaks the whole command, so follow the suggestion list as you type.
  • Is the game up to date? Some syntax only exists from a certain version on. The infinite effect duration, for example, arrived in Java 1.19.4, and enabling commands from World Options came with Java 26.2.

If you forget how a command is written, type /help followed by the command name. For the full reference, see the Microsoft Learn commands guide for Bedrock and the Minecraft Wiki commands page for Java.

NE
Editör
The Nedese editorial team covers competitive gaming guides, patch notes, and strategy breakdowns across all major titles. With over 15 years of coverage, our writers combine deep game knowledge with practical in-match experience.
Reader Comments
Discussion
0 comments
No comments yet. Be the first to share your thoughts.
Write a Comment
Did you find this article helpful? Share your thoughts with other readers.
Community
Want to showcase your own server?
Add your community-run server to our directory and reach more players. Join our Discord to connect with the community, or submit your server now.
Submit Your Server