Command syntax changes in Java 1.20.5

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

Minecraft Java Edition 1.20.5 updates the command tree from version 1.20.4. This release brings the total number of commands in the game files to 83.

Players will find one brand new command alongside syntax updates to four existing commands: /attribute, /execute, /gamerule, and /playsound.

What changed for players

/transfer
This is a completely new command added to the game in version 1.20.5.
/attribute
When adding an attribute modifier, the operations add, multiply, and multiply_base have been removed. You now use add_value, add_multiplied_base, or add_multiplied_total, such as in /attribute <target> <attribute> modifier add <uuid> <name> <value> add_value.
/execute
You can now check for matching items inside specific block or entity slots before running a command. This is done with the new if items and unless items conditions, like /execute if items entity <entities> <slots> <item_predicate>.
/gamerule
A new rule allows you to check or change the spawn chunk radius using /gamerule spawnChunkRadius [<value>].
/playsound
Several arguments are now optional, allowing you to play a sound with just /playsound <sound> or by stopping after the source, such as /playsound <sound> master.

Datapack creators and map makers will need to update any existing /attribute commands to use the new modifier names, and they can simplify their item detection and sound scripts with the updates to /execute and /playsound. Server administrators should also take note of the new /transfer command and the spawnChunkRadius gamerule.

New commands

/transfer

/attribute +3 −3

+ /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 add <uuid> <name> <value> add− /attribute <target> <attribute> modifier add <uuid> <name> <value> multiply− /attribute <target> <attribute> modifier add <uuid> <name> <value> multiply_base

/execute +4 −0

+ /execute if items block <pos> <slots> <item_predicate> […execute]+ /execute if items entity <entities> <slots> <item_predicate> […execute]+ /execute unless items block <pos> <slots> <item_predicate> […execute]+ /execute unless items entity <entities> <slots> <item_predicate> […execute]

/gamerule +1 −0

+ /gamerule spawnChunkRadius [<value>]

/playsound +11 −0

+ /playsound <sound>+ /playsound <sound> ambient+ /playsound <sound> block+ /playsound <sound> hostile+ /playsound <sound> master+ /playsound <sound> music+ /playsound <sound> neutral+ /playsound <sound> player+ /playsound <sound> record+ /playsound <sound> voice+ /playsound <sound> weather