mojira.dev
MC-129608

Scoreboard doesn't handle entity UUIDs correctly

The bug

The scoreboard and commands related to it do not handle entity UUIDs correctly. They treat them like regular player / fake names instead of matching the entity with the respective UUID.

Affected commands

  • /scoreboard

    • /scoreboard players list

    • /scoreboard players set

    • /scoreboard players get

    • /scoreboard players add

    • /scoreboard players remove

    • /scoreboard players reset

    • /scoreboard players enable

    • /scoreboard players operation

  • /team

    • /team join

    • /team leave

  • /execute

    • /execute if score ... matches

    • /execute if score ... = ... (all operators)

    • /execute store ... score

Reproduction steps

  1. Add a scoreboard objective

    /scoreboard objectives add test dummy
  2. Summon an entity with a specific UUID

    /summon armor_stand ~ ~ ~ {UUID:[I;0,0,0,0]}
  3. Set a score for the entity using a selector

    /scoreboard players set @e[type=armor_stand,limit=1] test 1
  4. Set a score for the entity using the UUID

    /scoreboard players set 0-0-0-0-0 test 2
  5. List the scores

    /scoreboard players list

    ❌ There are two entries instead of only one for the entity

Code analysis

1.16.2, Mojang names

net.minecraft.commands.arguments.ScoreHolderArgument.parse(StringReader) only parses the argument as selector (which also covers UUIDs) if the value starts with @ (which is not the case for UUIDs). Otherwise it treats it as literal name.

Linked issues

Attachments

Comments 5

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Please do not mark unreleased versions as affected.
You don't have access to them yet.

Can confirm in 20w51a.

Can confirm in 21w05b.

It seems that this bug has been fixed. I can't reproduce it in 1.20.5

Maxim Rait

(Unassigned)

Confirmed

(Unassigned)

UUID, commands, scoreboard

Minecraft 18w19b, Minecraft 18w20a, Minecraft 18w22b, 1.16.2, 20w51a, 21w05b

23w46a

Retrieved