Updated:
Check your edition first
"Minecraft: Java Edition" on a computer is Java. Switch, PlayStation, Xbox, phones and "Minecraft for Windows" from the Microsoft Store are Bedrock. A Windows PC running Minecraft for Windows is Bedrock too. Check which edition a guide is written for before copying from it.
Selector arguments
| Goal | Java | Bedrock |
|---|---|---|
| Within 5 blocks | @e[distance=..5] | @e[r=5] |
| Farther than 3 blocks | @e[distance=3..] | @e[rm=3] |
| Only one | @e[limit=1,sort=nearest] | @e[c=1] |
| Game mode | @a[gamemode=survival] | @a[m=survival] |
| XP level 10+ | @a[level=10..] | @a[lm=10] |
Bedrock also has hasitem and family. On Java, use the nbt argument or tags instead. More in target selectors.
/effect and /give
# Java
/effect give @p minecraft:speed 30 1
/effect clear @p
# Bedrock
/effect @p speed 30 1
/effect @p clear
The basic /give (target, item, amount) is the same. Differences start with names and enchantments: Java 1.20.5+ writes components after the ID, like diamond_sword[enchantments={…}]. Bedrock adds a data value and a JSON block after the amount, but only for a few fields such as can_destroy, can_place_on, keep_on_death and item_lock. It cannot set names or enchantments above the normal maximum.
/execute
Bedrock adopted the Java-style syntax in 1.19.50, so this works on both:
/execute as @a at @s run summon lightning_bolt ~ ~ ~
Old Bedrock forms such as /execute @a ~ ~ ~ summon lightning_bolt should be rewritten.
Text messages
Both have tellraw and title, but Bedrock uses {"rawtext":[{"text":"Hello"}]} and color codes like §c. Java uses text components with colors and click actions. See title and tellraw.
IDs that differ
Most IDs match, but some do not: the spawner is spawner on Java and mob_spawner on Bedrock; the snow layer is snow and snow_layer. A red ID or "unknown item" often means the other edition's ID. The ID search shows both.
Commands only one edition has
| Java only | Bedrock only |
|---|---|
/data, /attribute, /item, /bossbar, /trigger, /forceload, /datapack | /tickingarea, /camera, /hud, /scriptevent |
/tickingarea on Bedrock does roughly what /forceload does on Java. Java's NBT in /summon has no Bedrock equivalent; Bedrock uses spawn events and name tags.
Converting a command
Check the selector arguments, word order and IDs, in that order. The converter marks what needs changing and what Bedrock cannot reproduce.
Common questions
- I play on PC but Java syntax fails. Minecraft for Windows from the Microsoft Store or Xbox app is Bedrock. If the title screen does not say Java Edition, use Bedrock syntax.
- Crossplay servers? Servers using GeyserMC are usually Java servers, so type Java commands.
- Data packs and add-ons? Java .mcfunction files use Java syntax and Bedrock behavior pack functions use Bedrock syntax; they are not interchangeable.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.