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
selectedTeam colours must be lowercase with underscores
The old run-together spellings are no longer accepted.
/team modify red color darkpurple/team modify red color dark_purple26.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.
/time of <clock> set dayCommands 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.
/gamerule keepInventory true/gamerule keep_inventory true1.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.
{"text":"Go","clickEvent":{"action":"run_command","value":"/spawn"}}{"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.
/give @p stone[custom_name='{"text":"Rock"}']/give @p stone[custom_name={text:"Rock"}]Enchantments flattened
The levels wrapper was removed, and tooltip hiding moved to the tooltip_display component.
[enchantments={levels:{"minecraft:sharpness":5}}][enchantments={"minecraft:sharpness":5}]SNBT gained new number literals
Hexadecimal, binary, underscore separators and scientific notation all became valid in SNBT.
{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.
/attribute @s generic.max_health base set 40/attribute @s minecraft:max_health base set 40Commands 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.
/give @p diamond_sword{display:{Name:'{"text":"Frostbite"}'}}/give @p diamond_sword[custom_name='{"text":"Frostbite"}']Particle options became SNBT
Trailing loose numbers were replaced by a named compound.
/particle dust 1.0 0.0 0.0 1.0 ~ ~ ~/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
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.
/effect give @a night_vision 1000000 0 true/effect give @a night_vision infinite 0 trueCommands 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.
/locatebiome minecraft:desert/locate biome minecraft:desertCommands added: /place
1.17 – 1.17.1
/replaceitem became /item replace
The slot names carried over unchanged; only the command around them moved.
/replaceitem entity @p armor.head diamond_helmet/item replace entity @p armor.head with diamond_helmetCommands 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.