Saving people. Hunting things. The family business.
Minecraft commands list for Java and Bedrock

Minecraft commands list for Java and Bedrock

A command is text you type into the chat that starts with a slash. With one line you can switch to daytime, give yourself 64 diamonds, jump to the other end of the map or make sure you do not lose your items when you die. First, though, you have to enable them in your world. Below you will find how to do that in Java and Bedrock, how to write a command correctly and a table of the most used ones. It applies to Java 26.3 and Bedrock 26.50+ (Wilderness Bound drop, September 2026).

How to enable commands (cheats)

Java: new world

When you create a world, switch on Allow Commands. This is not possible in Hardcore mode or in a demo world.

Java 26.3: world that already exists

The procedure changed in version 26.3, so a lot of guides on the internet are out of date. It used to be advice to open the world to LAN and enable cheats there. As the host, you can no longer do that in Java 26.3.

  1. Press Esc in the game.
  2. Click World Options…. The button is where Open to LAN used to be (see the 26.3 changelog).
  3. In the General section, switch on Allow Commands.

The same menu also has the default and personal game mode, the difficulty and the Edit Game Rules… button. If you want to allow commands for other players in your LAN game, you will find that in World Options in the Multiplayer section.

Bedrock

Open the world settings, the Game or Cheats tab, and switch on Activate Cheats (or Allow Cheats). Careful: turning on cheats in Bedrock permanently disables achievements in that world. They stay disabled even if you turn cheats off again. If you care about achievements, make a separate world for trying out commands.

Server and Realm

On a server or in a Realm you need operator permissions. Whoever created the server or Realm has them automatically and can give them to other players with the command /op name. On someone else’s server, ask the admin for commands. Servers often run plugin commands too, but those are not part of the game itself and this article does not cover them.

How to write a command

  • You open chat with the T key, or straight with the / key, which types the slash for you. In Bedrock there is a chat button, and on a controller it is D-pad right.
  • The Tab key completes command names, item names and arguments. The up arrow brings back your previous command.
  • If you make a mistake, only you see the error message.
  • In a command block and in the server console you do not type the slash.
Minecraft chat with a slash and a list of commands from advancement to defaultgamemode
After typing a slash, the game suggests available commands. Source: Mojang Studios (minecraft.net)

Selectors: who the command targets

SelectorWho it selects
@syourself
@pthe nearest player
@aall players
@ra random player
@eall entities (players, mobs, items on the ground)
@nthe nearest entity

Coordinates

You write coordinates in three forms. Absolute ones like 100 64 -20 are an exact place in the world. Relative ones with a tilde like ~ ~1 ~ are counted from you, and this one is one block up. Local ones with a caret like ^ ^ ^5 are counted by where you are looking, and this one is 5 blocks in front of you.

The most used commands: table for Java and Bedrock

Most commands are written the same or almost the same in both editions. Where they differ, you will find it in the Bedrock column.

CommandWhat it doesJava 26.3Bedrock
/gamemodeswitches the game mode/gamemode creative, also survival, adventure, spectatorthe same, plus the shortcuts s, c, a and the numbers 0, 1, 2
/givegives an item/give @s diamond 64the same, optionally with extra data and components
/tp (/teleport)moves to coordinates or to a player/tp @s 100 64 -20, /tp Alex Stevethe same, optionally with a check of the blocks at the destination
/timesets the time/time set day (= 1000), also noon, night, midnight or a number; time add, time query; new: time pause, resume, rate/time set day, plus sunrise and sunset; time query daytime, gametime, day
/weatherchanges the weather/weather clear, also rain, thunder and an optional durationthe same, plus weather query
/gamerulechanges a game rule/gamerule keep_inventory true/gamerule keepinventory true
/effectgives or removes an effect/effect give @s night_vision infinite, /effect clear/effect @s night_vision 600, /effect @s clear
/locatefinds a structure or biome/locate structure minecraft:stronghold, also locate biome and locate poilocate structure and locate biome
/fillfills an area with blocks/fill ~-5 ~ ~-5 ~5 ~ ~5 stone, modes replace, keep, outline, hollow, destroy, strictthe same, with a mode
/clonecopies an area elsewhere/clone 0 64 0 10 70 10 20 64 0similar
/killkills the target/kill @e[type=zombie]the same
/seedshows the world seed/seedthe command does not exist in Bedrock
/summonsummons an entity/summon minecraft:zombiethe same
/enchantenchants the item in your hand/enchant @s sharpness 5, limits like at the anvilthe same, enchantments also by numeric ID
/xp (/experience)adds experience/xp add @s 30 levels, also xp set and xp query/xp 30L @s (L means levels)

Be careful with /kill @e without a filter. It kills all entities, including you, and deletes every item lying on the ground. Let the Tab key suggest structure names for /locate.

A few more are handy: /setworldspawn sets the place where you appear in the world, /difficulty peaceful (or easy, normal, hard) changes the difficulty, and on a server you use /op, /kick and /ban.

Commands for building and Creative

There are officially no commands just for building, but these are the ones used most when you build:

  • /gamemode creative switches you to Creative.
  • /fill fills a whole area with one block. /clone copies a finished part of a build elsewhere. There is also /setblock for a single block.
  • /time set day and /weather clear, so you can see what you are building.
  • /gamerule advance_time false in Java (dodaylightcycle false in Bedrock) stops the day and night cycle, so it never gets dark on you.

In Creative, /give is also useful for items that cannot be crafted, /summon for spawning mobs, /enchant and /xp for enchanting and /tp for quick trips. You will find how everyday items are made in our crafting recipes guide.

/fill and /clone have a limit in Java on how many blocks they handle at once. If you hit it, you raise it with the game rule max_block_modifications.

Commands for Survival

  • /gamerule keep_inventory true (keepinventory in Bedrock): you keep your inventory after death.
  • /locate structure shows the coordinates of the nearest structure, such as a stronghold.
  • /seed tells you the world seed in Java. In singleplayer it works even without commands enabled.
  • /time set day skips the night.
  • /effect give @s night_vision infinite gives you permanent Night Vision in Java. That way you get the same effects as from potions without brewing.

In Bedrock, remember that turning on cheats in a world permanently disables achievements.

Game rules: gamerule in Java and Bedrock

This is where Java and Bedrock differ the most. In Java, game rules have been written with underscores since version 1.21.11 (keep_inventory, advance_time). Old names such as keepInventory or doDaylightCycle, which you will find in older guides, no longer work in Java. Bedrock still uses one-word names.

What it doesJava 26.3Bedrock
you keep your inventory after deathkeep_inventory truekeepinventory true
stops the day and night cycleadvance_time falsedodaylightcycle false
stops weather changesadvance_weather falsedoweathercycle false
mobs (such as Creepers) do not destroy blocksmob_griefing falsemobgriefing false
mobs do not spawn naturallyspawn_mobs falsedomobspawning false
instant respawn after deathimmediate_respawn truedoimmediaterespawn true
what percentage of players must sleepplayers_sleeping_percentageplayerssleepingpercentage
fall damagefall_damagefalldamage
shows coordinatesnone, in Java just press F3showcoordinates true
command blocks workcommand_blocks_workcommandblocksenabled

Put /gamerule in front of every rule in the table. In Java 26.3 you can also change rules without typing, through World Options and the Edit Game Rules… button.

The command block

A command block runs a stored command when it receives a redstone signal. It cannot be crafted or mined. In both editions you get it with the command /give @s command_block. In Java it is also in the Creative inventory in the Operator Utilities tab, if you switch on Operator Items Tab in the Controls settings.

  • You can only set it up and place it in Creative with commands enabled, or as an operator.
  • You type the command into the block without the slash.
  • On a Java server, the server.properties file must have enable-command-block=true. The default value is false.
  • A game rule controls it too: command_blocks_work in Java, commandblocksenabled in Bedrock.

Mojang explains the basics in its own commands guide. For more guides, head to our Minecraft guides. And if you want to change your character’s look, check out Minecraft skins.

Join our Discord GamersTogether to ask about commands, share your command block builds and find people to play with.

FAQ

How do you type a command in Minecraft?

Open chat with the T key or straight with the slash key, type a command starting with a slash and confirm with Enter. For it to work, commands have to be allowed in your world.

What is the teleport command?

For coordinates type /tp @s 100 64 -20, and for another player /tp Alex Steve (it teleports the player Alex to the player Steve). It works the same in Java and Bedrock.

What is the command for daytime?

Type /time set day. If you want it to stay day, stop the day and night cycle: in Java /gamerule advance_time false, in Bedrock /gamerule dodaylightcycle false.

How do you enable commands in a world that already exists?

In Java 26.3, press Esc, open World Options and switch on Allow Commands in the General section. As the host, you can no longer enable it through LAN. In Bedrock you find it in the world settings under Cheats, but that permanently disables achievements in the world.

How do you keep your items after death?

In Java type /gamerule keep_inventory true, in Bedrock /gamerule keepinventory true. The old spelling keepInventory does not work in current Java.

Information verified on 19 October 2026. The commands are valid for Java 26.3 and Bedrock 26.52. More in our Minecraft guides.

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Scroll to Top