Hub / Minecraft / Minecraft Commands

Last updated: 8 November 2026

CommandsReferenceJava & Bedrock✓ Verified for Minecraft Java 26.3

The Essential Minecraft Commands for Java & Bedrock

Updated November 20269 min readBy

Turn on cheats for your world, press T to open chat, and type a command starting with / — for example /gamemode creative or /time set day. Below are the commands players actually use, with exact syntax for Java and Bedrock and the places where the two editions differ.

Official screenshot from Minecraft
Official screenshot — Minecraft (Mojang Studios) · source

01How to Enable and Run Commands

Commands need cheats. In Java the world-creation option is called Allow Commands; Bedrock calls it Allow Cheats. Both can be switched on later from the world options (Java) or the Cheats tab in world settings (Bedrock). In Java, opening a singleplayer world to LAN also gives a temporary cheat allowance.

Open chat with T (or press /, which opens chat with the slash already typed) and enter the command. Tab completion lists valid arguments as you type. Commands typed in a server console do not take the slash.

02Target Selectors: @p, @a, @r, @e, @s, @n

Most commands take a target. Selectors let you aim at players or mobs without typing names.

Add filters in square brackets, separated by commas. Java examples: @e[type=zombie,distance=..20] (zombies within 20 blocks), @a[gamemode=survival], @e[type=cow,limit=1,sort=nearest]. Java filters include distance, type, limit, sort, level, gamemode, name, tag, team and scores. Bedrock uses shorter names: r/rm for maximum/minimum distance, c for count, l/lm for level and m for game mode.

Note: in Java the type filter cannot be combined with @a, @p or @r. To pick a random mob in Java use @e[sort=random,limit=1].

03Player and World Commands

The commands below cover most day-to-day cheating. Java syntax first, Bedrock differences after.

04Items, XP and Effects

05Building Commands: /fill, /setblock and /clone

/setblock places one block: /setblock <x y z> <block> [destroy|keep|replace]. keep only places into air; destroy breaks the old block as if mined. Java also has a strict mode that skips block updates.

/fill fills a box between two corners: /fill <from> <to> <block> [mode]. Modes:

A fill that is too large simply fails. Java controls the limit with a gamerule, which was renamed to max_block_modifications in 1.21.11; check it with /gamerule max_block_modifications and raise it if a big build is rejected. Bedrock uses fixed limits.

/clone copies a region: /clone <begin> <end> <destination> [replace|masked|filtered] [normal|move|force]. move leaves air behind, masked skips air in the source. The same block-count limit applies in Java; Bedrock caps clone at 655,360 blocks.

06Gamerules Worth Knowing

/gamerule <rule> [value] changes world behaviour; leave the value off to read it. Rule names are case-sensitive in Java. Current Java versions use snake_case names for many rules, for example:

Bedrock names stay camelCase and are case-insensitive — if a name is rejected, type /gamerule and use tab completion to see what your version accepts. Older Java worlds and tutorials (before the 1.21.11 rename) use names like keepInventory and doDaylightCycle.

07Summoning Mobs and Using Command Blocks

/summon: /summon <entity> [x y z] [nbt], e.g. /summon minecraft:cow ~ ~ ~. Players cannot be summoned, and hostile mobs cannot be summoned on Peaceful difficulty in recent Java versions. Bedrock adds optional rotation, spawn event and name tag arguments.

Command blocks run commands automatically. Get one with /give @s minecraft:command_block or from the creative Operator Utilities tab (needs the Operator Items Tab option). Only an operator in Creative mode can place or edit them. On Java, the gamerule command_blocks_work must be true — this replaced the old enable-command-block server.properties setting in 1.21.9. On Bedrock enable Command Blocks in the world options. Several admin commands (ban, op, stop and similar) are blocked inside them. Command blocks are a gateway to automation; for redstone-based builds start with redstone basics.

08Java vs Bedrock: Quick Differences

Commands such as /fill, /clone and /kill are hard to undo, so back up the world before experimenting.

FAQ

How do I enable commands in Minecraft?

Turn on Allow Commands (Java) or Allow Cheats (Bedrock) when creating the world, or switch it on later in the world options. In a Java singleplayer world you can also open it to LAN with cheats allowed. Then press T and type a command starting with /.

How do I get a command block?

Run /give @s minecraft:command_block, or take one from the creative Operator Utilities tab. You must be an operator in Creative mode, and command blocks must be enabled (Java gamerule command_blocks_work; Bedrock world option).

What is the command to change gamemode?

/gamemode creative, /gamemode survival, /gamemode adventure or /gamemode spectator. Add a player name or selector to change someone else, such as /gamemode creative @a. Only Bedrock accepts shortcuts like c and s.

How do I teleport to coordinates?

Use /tp @s x y z, for example /tp @s 100 70 -250. Relative coordinates with ~ work too: /tp @s ~ ~20 ~ moves you 20 blocks up. /tp teleports one player to another.

How do I make it day or stop rain?

/time set day makes it morning (tick 1000) and /weather clear stops rain or thunder. To keep it from changing again, set the gamerules advance_time and advance_weather to false in current Java versions.

How do I keep my inventory when I die?

Run /gamerule keep_inventory true in current Java versions. If your version rejects that name, try keepInventory — tab completion in chat shows which spelling your version uses.

Why does /fill say it is too large?

The region exceeds the block-modification limit. In Java it is controlled by a gamerule (max_block_modifications since 1.21.11); raise it, or split the build into several smaller /fill commands.

How do I find a village or structure with a command?

Use /locate structure minecraft:village_plains (or the #village tag in Java) and click the coordinates in chat. /locate biome finds biomes. Both only search a limited area around you.

Sources

Where the facts on this page were checked. If one of them now says something different, we want to know — tell us and we will fix the guide.

  1. Commands Minecraft Wiki
  2. Target selectors Minecraft Wiki
  3. Permission level Minecraft Wiki
  4. Command block Minecraft Wiki
  5. /give Minecraft Wiki
  6. /fill Minecraft Wiki
  7. /gamerule Minecraft Wiki
  8. /teleport Minecraft Wiki
  9. /time Minecraft Wiki
  10. /weather Minecraft Wiki
  11. /setblock Minecraft Wiki
  12. /gamemode Minecraft Wiki
  13. /effect Minecraft Wiki
  14. /experience Minecraft Wiki
  15. /locate Minecraft Wiki
  16. /clone Minecraft Wiki
Stay in the loop

New & updated guides ship every week. Follow the Atom feed or get notified when new Minecraft guides land.

Note: Minecraft receives regular updates that can adjust mob behaviour, world generation and crafting recipes — always cross-check with the official Minecraft Wiki for the version you are playing.
Was this guide helpful?