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

/stats Command: can't store value in player's own scoreboard


    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.8, Minecraft 1.8.1
    • None
    • Multiplayer Vanilla Server
    • Unconfirmed

      Executing a /stats command is wierd in Multiplayer:
      On a fill clock I have a command /execute @a ~ ~ ~ /xp 0L @p
      I want to store the XP value in a scoreboard using QueryResult.
      In singleplayer this works fine:
      /stats @a set QueryResult @p currentXP

      However, as soon as I join a server, I want to track the XP for every player - I expected the above command to do exactly this.

      However, for some reason the @p selector appears to be executed from the command block - I can't really tell which player the command block takes to score the QueryResult in.

      /stats entity oleoleMC set QueryResult oleoleMC currentXP
      works fine for a single player however.

      Edit: Skylinerw found this out:
      Digging a bit into this: it appears that it's the player selector itself in the /stats command that's the problem. Non-op'd players aren't able to use player selectors in commands that are available to them, and it seems that functionality leaked over to CommandStats, even though they shouldn't be expected to be hindered like that. Replacing @p with my in-game name allows it to work, but obviously that's a very poor alternative. I've found the bug report you've made (couldn't find any others either) and will mention this there.

      Duplicate with MC-72574.

      /stats @a set QueryResult @p currentXP
      stores the query result of each individual player in his currentXP score

      /stats @a set QueryResult @p currentXP
      stores the query result of every player in the currentXP score of the player closest to the command block

            Unassigned Unassigned
            crushedpixel CrushedPixel
            9 Vote for this issue
            1 Start watching this issue