Mojira Archive
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.

Fixed

Maxim Rait

2018-05-15, 04:09 PM

2024-04-27, 10:40 PM

2024-04-27, 10:40 PM

6

5

Confirmed

(Unassigned)

UUID, commands, scoreboard

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

23w46a