/

What changed in Minecraft commands, version by version

Minecraft command syntax has broken backwards compatibility several times — item components in 1.20.5, the text component event renames in 1.21.5, the attribute id renames in 1.21.2. This is every change that affects how a command is written, from 1.16 to 26.2. Commands added and removed are read from the game's own command data for each version.

26.2

selected

Team colours must be lowercase with underscores

The old run-together spellings are no longer accepted.

before
/team modify red color darkpurple
after
/team modify red color dark_purple

26.1 – 26.1.2

/time works on named world clocks

Time queries and changes can target a specific clock, and the command gained pause, resume and rate subcommands. Query results report total elapsed ticks rather than time of day.

now written as
/time of <clock> set day

Commands added: /swing

1.21.9 – 1.21.11

Every game rule was renamed to snake_case

camelCase rule names were replaced wholesale: keepInventory became keep_inventory, doDaylightCycle became advance_time, doWeatherCycle became advance_weather. The list also roughly doubled, from 56 rules to 118. Any /gamerule command written before this is rejected as an unknown rule.

before
/gamerule keepInventory true
after
/gamerule keep_inventory true

1.21.5

Text component events were renamed

clickEvent became click_event and hoverEvent became hover_event, and their payloads were reshaped: open_url takes url, run_command and suggest_command take command, and show_text takes value instead of contents.

before
{"text":"Go","clickEvent":{"action":"run_command","value":"/spawn"}}
after
{"text":"Go","click_event":{"action":"run_command","command":"/spawn"}}

Item text components became native SNBT

Names and lore are written as SNBT compounds rather than a string holding JSON.

before
/give @p stone[custom_name='{"text":"Rock"}']
after
/give @p stone[custom_name={text:"Rock"}]

Enchantments flattened

The levels wrapper was removed, and tooltip hiding moved to the tooltip_display component.

before
[enchantments={levels:{"minecraft:sharpness":5}}]
after
[enchantments={"minecraft:sharpness":5}]

SNBT gained new number literals

Hexadecimal, binary, underscore separators and scientific notation all became valid in SNBT.

now written as
{a:0x1F,b:0b1010,c:1_000,d:1.5e2}

1.21.2 – 1.21.3

Attribute ids lost their prefixes

generic. and player. were dropped from every attribute id. This breaks any /attribute command and any attribute_modifiers component written earlier.

before
/attribute @s generic.max_health base set 40
after
/attribute @s minecraft:max_health base set 40

Commands added: /rotate

1.20.5 – 1.20.6

Item components replaced item NBT

The single biggest command change in years. Everything that used to live in a trailing {…} tag on an item became a named component in square brackets. A /give written for 1.20.4 does not run on 1.20.5.

before
/give @p diamond_sword{display:{Name:'{"text":"Frostbite"}'}}
after
/give @p diamond_sword[custom_name='{"text":"Frostbite"}']

Particle options became SNBT

Trailing loose numbers were replaced by a named compound.

before
/particle dust 1.0 0.0 0.0 1.0 ~ ~ ~
after
/particle dust{color:[1.0,0.0,0.0],scale:1.0} ~ ~ ~

@n selects the nearest entity

Equivalent to @e[limit=1,sort=nearest], and unlike @p it is not restricted to players.

Commands added: /transfer

1.20.2 – 1.20.4

Commands added: /random/tick

1.20 – 1.20.1

Commands added: /return

1.19.3 – 1.19.4

Effects can run forever

infinite became a valid duration. Before this, the convention was 1000000 seconds — a little under twelve days.

before
/effect give @a night_vision 1000000 0 true
after
/effect give @a night_vision infinite 0 true

Commands added: /damage/fillbiome/ride

1.19 – 1.19.2

/locatebiome folded into /locate

Structures, biomes and points of interest are all found through one command now.

before
/locatebiome minecraft:desert
after
/locate biome minecraft:desert

Commands added: /place

1.17 – 1.17.1

/replaceitem became /item replace

The slot names carried over unchanged; only the command around them moved.

before
/replaceitem entity @p armor.head diamond_helmet
after
/item replace entity @p armor.head with diamond_helmet

Commands added: /item

Pick a version at the top of any generator and the output switches to that version's syntax automatically. Start with /give, /tellraw or /execute.