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

The "score" and "selector" text component isn't being applied properly in all cases

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Minecraft 1.13-pre1
    • None
    • Unconfirmed

      Technically it's valid JSON, but the problem is that it doesn't seem to be able to grab a score from the scoreboard. My idea is that I was thinking it'd be neat if you could have a number variable for something like RPG levels displayed alongside a name. For example, the following command should work for this, but doesn't:

      /summon husk ~ ~ ~ {Invulnerable:1,NoAI:1,CustomName:"[{\"text\":\"Level \"},{\"score\":{\"name\":\"@s\",\"objective\":\"rpglevel\"}}]"}

      For the record, this functionally identical one doesn't either:

      /summon husk ~ ~ ~ {Invulnerable:1,NoAI:1,CustomName:"{\"text\":\"Level \",\"extra\":[{\"score\":{\"name\":\"@s\",\"objective\":\"rpglevel\"}}]}"}

      This just summons a husk named "Level " with nothing at the end of it instead of a number equal to my "rpglevel" score. Using my actual player name or a fake player name (or even @p) doesn't change this fact.

      Looking at its data through "/data get" shows that the "value" argument gets added to the "score" section, but it'll always be empty by default. You can manually set the value to whatever you want it to be and it'll show up in the name, but the expected behaviour in this context is that "value" should be automatically determined upon running the command. Otherwise it's no different than having another "text" section.

      I dunno how difficult it is to implement, but the simplest-sounding solution would be adding what I just described in that last bit: A way for the game to grab a score and automatically apply it to the "value" section of a CustomName's "score" component upon running the command instead of always leaving it blank like it currently does. Maybe the problem is that it's not properly recognizing the "name" section of "score" when used in CustomName? Because the entity data shows that it uses the literal text when writing things like @s, @p, etc.. Thinking about it that way, maybe it's best if CustomName just immediately converts "score" components into "text" ones that match up with what the "value" would have been? I imagine one of the potential drawbacks of doing it the other way is a custom name that'd be endlessly checking itself for score updates (maybe this is a main reason why it's not already in the game), whereas immediately converting a "score" component into a "text" one wouldn't have that issue.

            Unassigned Unassigned
            Remin Remin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: