Skip to content

Type to search across every guide and reference page.

CommandsBoth · 26.x

Minecraft Commands: Syntax and Examples for Both Editions

Minecraft commands with real syntax for Java and Bedrock, examples you can paste straight into chat, and the edition differences that make a command fail.

By minecraft.bd Editorial Team·Updated

Commands let you change almost anything in a Minecraft world: give items, spawn mobs, move players, edit terrain and automate whole minigames. Every page in this section gives the syntax for both Java and Bedrock, several examples you can paste straight into chat, and the mistakes that cause “Unknown or incomplete command”.

New to commands? Start here

  1. Turn cheats on. Our cheat codes guide shows how for each edition, and what it costs (Bedrock disables achievements for the world).
  2. Learn the four you’ll use daily: /gamemode, /give, /tp and /time and /weather.
  3. Browse the rest in the full command list, grouped by what each command does.

Why the same command fails on another edition

Java and Bedrock share most command names but not always the arguments. The common traps:

  • Items with extras. Java 1.20.5 replaced item NBT with components: /give @s diamond_sword[enchantments={sharpness:5}]. Bedrock has no enchant option on /give at all; use /enchant instead.
  • Mobs with extras. Java’s /summon takes NBT like {powered:true}. Bedrock uses spawn events like minecraft:become_charged.
  • Short forms. /gamemode c works on Bedrock, not Java.
  • Names. Java’s /locate structure #village vs Bedrock’s /locate structure village.
  • Gamerules. Java 1.21.11 renamed them to snake_case (keep_inventory), so older tutorials break.

When a command from a video doesn’t work, check its version first.

For builders and mapmakers

/fill changes up to 32,768 blocks at once. /execute runs commands as or at other entities and only when conditions are met. Command blocks run all of it on redstone or every tick. Put those three together and you can make parkour courses, arenas and puzzle maps without mods.

Finding things

The /locate command gives coordinates for the nearest structure or biome. It pairs well with our structures guide and biomes guide when you want to know what’s worth finding.

Things that aren’t commands

There’s no vanilla /fly command, even though servers often add one. Private messages work without cheats, though, as does /me. Experience is handled by /xp on both editions with different syntax.

Sources & verification

Facts on this page are checked against these references and in-game behavior for the stated edition(s). how we verify.

In this section