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

CommandStats entity selectors will only work as long as they don't return multiple entities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Minecraft 1.8-pre3, Minecraft 1.8
    • None
    • Unconfirmed

      How to reproduce:

      Spawn two villagers whose scores we want to affect (run this command twice):

      /summon Villager ~ ~ ~ {CustomName:Max}

      Set up the scoreboard and start tracking the two villagers:

      /scoreboard objectives add testObj dummy
      /scoreboard objectives setdisplay sidebar testObj
      /scoreboard players set @e[name=Max] testObj 10

      Spawn a villager which we will use to run commands from and give him appropriate CommandStats tags:

      /summon Villager ~ ~ ~ {CustomName:Dave}
      /stats entity @e[name=Dave] set AffectedItems @e[name=Max] testObj

      Give yourself some stone which Dave can /clear later on:

      /give @p stone 64

      Let Dave clear your stone:

      /execute @e[name=Dave] ~ ~ ~ /clear @p minecraft:stone

      Notice how the scoreboard stats for the villagers named Max did not update. Kill one of the villagers named Max so there is only one entity named Max in your world, then give yourself some more stone and run the /execute command again. Notice how the scoreboard stat for the remaining villager Max did update this time.

            searge [Mojang] Searge (Michael Stoyke)
            redstonehelper [Mod] redstonehelper
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: