Command syntax changes in Java 1.21

Compared with 1.20.6: 0 commands added, 0 removed and 1 with a changed syntax. Measured by comparing the command trees that the two game versions generate.

Welcome to the 9Minecraft Commands update guide for Minecraft Java Edition 1.21. By comparing the command trees directly from the game files of 1.20.6 and 1.21, we can see what changed in the total set of 83 commands.

This release focuses entirely on updating how the /attribute command handles modifiers.

What changed for players

/attribute
Attribute modifiers now use a single <id> argument instead of requiring a <uuid> and <name> when adding, removing, or getting values. For example, you now use /attribute <target> <attribute> modifier add <id> <value> add_value to apply a modifier, and /attribute <target> <attribute> modifier remove <id> to remove it.

Map makers, datapack creators, and server owners who use /attribute modifiers in their command blocks or functions will need to update their scripts to replace the old UUID and name arguments with the new single ID format.

/attribute +5 −5

+ /attribute <target> <attribute> modifier add <id> <value> add_multiplied_base+ /attribute <target> <attribute> modifier add <id> <value> add_multiplied_total+ /attribute <target> <attribute> modifier add <id> <value> add_value+ /attribute <target> <attribute> modifier remove <id>+ /attribute <target> <attribute> modifier value get <id> [<scale>]− /attribute <target> <attribute> modifier add <uuid> <name> <value> add_multiplied_base− /attribute <target> <attribute> modifier add <uuid> <name> <value> add_multiplied_total− /attribute <target> <attribute> modifier add <uuid> <name> <value> add_value− /attribute <target> <attribute> modifier remove <uuid>− /attribute <target> <attribute> modifier value get <uuid> [<scale>]