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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Duplicate
    • Affects Version/s: Minecraft 1.8, Minecraft 1.8.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Multiplayer Vanilla Server
    • Confirmation Status:
      Unconfirmed

      Description

      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.

      TL;DR:
      Expected:
      /stats @a set QueryResult @p currentXP
      stores the query result of each individual player in his currentXP score

      Reality:
      /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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                crushedpixel CrushedPixel
              • Votes:
                9 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: