Minecraft Commands: Full List for Java and Bedrock
The most useful Minecraft commands with current Java and Bedrock syntax, copy-ready examples and the mistakes players make most often.
Minecraft commands are typed into chat starting with /, and the world needs cheats enabled (or you must be an operator on a server). The most used ones are /gamemode to switch game mode, /tp to teleport, /give to get items, /time and /weather for day and weather, /fill for mass building and /locate to find structures. The syntax differs between Java Edition and Bedrock Edition, so in this Minecraft commands guide every command comes in both versions, checked against the official Minecraft wiki.
How to enable commands in Minecraft
- Java: tick Allow Commands (Allow Cheats) when creating the world. If it already exists, you can change it from the world options in-game; the old Open to LAN method with cheats allowed also exists in some versions.
- Bedrock: turn on Activate Cheats when creating the world or later, in the Cheats tab of the settings. Careful: in Bedrock, enabling cheats permanently disables achievements for that world.
- Servers: you must be an operator (/op your_name from the server console). On a Bedrock server you first have to enable cheats in the configuration.
To type a command, open the chat (the T key in Java, or the chat bar in Bedrock) and start with /. /help lists the available commands and /help command_name shows its syntax in your version. Almost all of them require permission level 2 in Java and 1 in Bedrock.
Key differences between Java and Bedrock commands
| Aspect | Java Edition | Bedrock Edition |
|---|---|---|
| Identifiers | Usually carry a prefix: minecraft:speed (the prefix is optional) | Normally no prefix: speed |
| /effect | effect give @s speed 60 1 | effect @s speed 60 1 |
| Radius in selectors | @e[distance=..10] | @e[r=10] |
| Game mode in selectors | gamemode=creative | m=creative |
| Items with properties | Components: diamond_sword[enchantments={...}] | components parameter in JSON, with limited functions |
| /seed | Available | Does not exist |
| /execute store | Available | Not available |
Basic commands to get started
/gamemode: change game mode
- Java: /gamemode creative (also survival, adventure and spectator). For another player: /gamemode creative Steve. Since 1.13, abbreviations and numbers no longer work.
- Bedrock: /gamemode creative, but shortcuts are also accepted: s or 0 (Survival), c or 1 (Creative), a or 2 (Adventure) and d or 5 (the world's default mode).
Hardcore is not a game mode you can pick with this command. In Java, /defaultgamemode sets the mode new players join with.
/tp: teleport
- To a player: /tp Alex takes you to Alex; /tp @a @s brings everyone to you.
- To coordinates: /tp 100 70 -250. With ~ the coordinates are relative to your position: /tp ~ ~10 ~ lifts you 10 blocks. With ^ they are relative to where you are looking: /tp ^ ^ ^5 takes you 5 blocks forward.
- To another dimension: in Java, /execute in minecraft:the_nether run tp ~ ~ ~. In Bedrock, /execute in nether run tp ~ ~ ~.
In Bedrock you can add true (checkForBlocks) at the end so the command fails if you would end up inside a solid block.
/give: get items
- Java: /give @s diamond 64. Since 1.20.5, properties are written as components in square brackets: /give @s diamond_sword[enchantments={"minecraft:sharpness":10}].
- Bedrock: /give @s diamond 64. The full syntax is give player item [amount] [data] [components], and the components parameter only supports a few functions (such as can_place_on, can_destroy, item_lock and keep_on_death), so to enchant in Bedrock you use /enchant.
/time and /weather: day, night and weather
| Time | Ticks | Command |
|---|---|---|
| Day | 1,000 | /time set day |
| Noon | 6,000 | /time set noon |
| Night | 13,000 | /time set night |
| Midnight | 18,000 | /time set midnight |
Bedrock also accepts sunrise (23,000) and sunset (12,000). A Minecraft day is 24,000 ticks: /time add 24000 skips a whole one. In Java /time set 6000 also works with numbers, and in the 26.x versions the command relies on world clocks, with new options such as time pause, time resume and time rate.
- Weather: /weather clear, /weather rain or /weather thunder. You can add a duration: in Java it accepts units (/weather clear 1d, where d is a day, s seconds and no suffix means ticks); in Bedrock it is a number of ticks between 0 and 1,000,000.
Survival and utility commands
/effect: potion effects without potions
- Java: /effect give @s minecraft:speed 60 1 (Speed II for 60 seconds). Clear: /effect clear @s.
- Bedrock: /effect @s speed 60 1. Clear: /effect @s clear.
The level is the amplifier: 0 is level I, 1 is level II. If you give no seconds, it lasts 30. Add true at the end to hide the particles, and use infinite instead of the seconds for an endless effect.
/enchant: enchant what you hold
/enchant @s sharpness 5 enchants the item you are holding. It follows anvil rules: it does not exceed the maximum level and does not add incompatible enchantments. To bypass those limits, in Java use /give with components.
/xp: experience
- Java: /experience add @s 10 levels gives 10 levels, /experience add @s 100 points gives points, and /experience query @s levels tells you your level. /xp is an alias.
- Bedrock: /xp 10L gives 10 levels and /xp 100 gives 100 points.
/gamerule: the world rules
They change how your world works. /gamerule name value changes the rule and /gamerule name without a value tells you its current state. Since 1.21.11, Java uses snake_case names (they used to be camelCase, like doDaylightCycle), and Bedrock uses lowercase.
| What it does | Java | Bedrock |
|---|---|---|
| Keep inventory on death | keep_inventory | keepinventory |
| Stop the day/night cycle | advance_time | dodaylightcycle |
| Stop weather changes | advance_weather | doweathercycle |
| Let mobs break blocks (creepers, endermen) | mob_griefing | mobgriefing |
| Let mobs spawn | spawn_mobs | domobspawning |
| Random tick speed (crops) | random_tick_speed (3 by default) | randomtickspeed |
| Let phantoms spawn | spawn_phantoms | doinsomnia |
Example: /gamerule keep_inventory true in Java or /gamerule keepinventory true in Bedrock.
/difficulty, /setworldspawn and /spawnpoint
- /difficulty peaceful (or easy, normal, hard). Bedrock also accepts p, e, n, h and the numbers 0 to 3. In a Java Hardcore world the difficulty cannot be changed.
- /setworldspawn sets the world spawn point. Without coordinates it uses your position.
- /spawnpoint @s sets your respawn point where you stand; it also accepts coordinates: /spawnpoint @s 100 64 -200.
/seed and /locate: the seed and structures
- /seed shows the world seed (Java only; in Bedrock you check it in the world settings).
- Java: /locate structure mansion (woodland mansion), /locate structure #village (any village) or /locate biome desert.
- Bedrock: /locate structure mansion and /locate biome minecraft:plains (biomes require the minecraft: namespace in recent versions). With true at the end it only searches new chunks.
Press Tab after structure to see the full list of structures your version supports.
Commands for mass building
/fill: fill areas
Syntax: /fill x1 y1 z1 x2 y2 z2 block [mode]. The modes are:
- replace (default): replaces everything in the way. In Java it accepts a filter: /fill ... gold_block replace orange_glazed_terracotta.
- hollow: leaves only the shell and empties the inside.
- outline: places the shell and leaves the inside as it was.
- keep: only fills where there is air.
- destroy: breaks blocks like a player would, with drops.
A hollow stone house around you: /fill ~-3 ~ ~-4 ~3 ~4 ~4 stone hollow. In Bedrock, if you need block states, they go in square brackets after the block (gold_block []). In Java the per-command maximum is set by the max_block_modifications rule, 32,768 blocks by default.
/setblock and /clone
- /setblock places a single block: Java /setblock ~ ~ ~ chest[facing=east]; Bedrock /setblock ~ ~ ~ chest ["minecraft:cardinal_direction"="east"].
- /clone copies a region: /clone x1 y1 z1 x2 y2 z2 destination. Add masked to copy only non-air blocks, and move to relocate instead of duplicate. In Bedrock the source volume is limited to 655,360 blocks.
Entities: summon, kill and selectors
Selectors say who the command affects: @s is you, @p the nearest player, @a all players, @r a random one and @e all entities. @n (the nearest entity) exists since Java 1.21 and Bedrock 1.21.100. They are refined with arguments in square brackets, and that is where Java and Bedrock differ: @e[type=creeper,distance=..10] in Java is @e[type=creeper,r=10] in Bedrock.
- /summon: Java /summon creeper ~ ~ ~ {powered:true} (charged creeper) and /summon lightning_bolt ~ ~ ~ (lightning). In Bedrock the syntax is summon type [position] [rotation] [event] [name], for example /summon pillager ~ ~ ~ ~ ~ minecraft:spawn_as_patrol_captain.
- /kill: /kill @e[type=item] deletes all items on the ground. With no target it kills you. In Bedrock it does not work on players in Creative mode.
- /clear: /clear @s empties your inventory; /clear @s minecraft:stone 0 only checks whether you carry stone without removing it.
/execute and command blocks
/execute runs another command while changing who runs it, from where, or under which conditions. It chains with as, at, positioned, in, if/unless and ends in run.
- Java: /execute as @a at @s if block ~ ~-1 ~ gold_block run say I am standing on gold.
- Bedrock: /execute as @a at @s if block ~ ~ ~ water run say "My feet are wet".
A command block stores a command and runs it with redstone, once, chained or every tick (repeating mode). Get one with /give @s command_block in both editions. It can only be placed and edited in Creative mode as an operator. In Java the command_blocks_work rule must be on, and in Bedrock the world's Command Blocks Enabled option.
Common mistakes when using commands
- "Unknown command": almost always cheats are not enabled or the command does not exist in your edition (for example, /seed in Bedrock).
- Copying syntax from the other edition: /effect give in Bedrock or distance=..10 in a Bedrock selector do not work.
- Old rule names: in recent Java, doDaylightCycle is no longer the name; use advance_time.
- Selectors that are too broad: an unfiltered /kill @e deletes animals, villagers and everything else. Always filter by type.
- Misplaced ~ coordinates: ~5 means "5 blocks from where I am", not coordinate 5.
Minecraft commands FAQ
How do you use commands in Minecraft?
Enable cheats in the world, open the chat and type / followed by the command. On a server you must be an operator.
Are Java and Bedrock commands the same?
No. Many match, but the syntax of /effect, selectors, items with properties and game rules changes, and some commands exist in only one edition.
How do I give myself an enchanted item?
In Java, with /give and components. In Bedrock, by giving yourself the item with /give and enchanting it afterwards with /enchant, which respects maximum levels.
How do I avoid losing my inventory when I die?
With /gamerule keep_inventory true in Java or /gamerule keepinventory true in Bedrock.
Can I use commands without losing achievements?
In Bedrock, enabling cheats permanently disables achievements for that world. If you care about them, create a separate world to experiment in.
Free games similar to Minecraft
If you like building and surviving with blocks, LudoRex has CraftMine, an adventure and survival game, and Block Craft 3D, a block game with action. To create and manage your own world, try Craft World, and if you like lasting as long as possible, the category of free survival games brings together more than a dozen. All of them run in the browser, no downloads.
#Minecraft#sandbox


