Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-129608

Scoreboard doesn't handle entity UUIDs correctly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 23w46a
    • Minecraft 18w19b, Minecraft 18w20a, Minecraft 18w22b, 1.16.2, 20w51a, 21w05b
    • Confirmed
    • (Unassigned)

      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.

            Unassigned Unassigned
            Alexius13 Maxim Rait
            Votes:
            6 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: