-
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.
- is duplicated by
-
MC-124008 scores in JSON for CustomName don't display
- Resolved
-
MC-124419 display.Name and CustomName json tags don't work with "selector" or "score" inputs
- Resolved
-
MC-132614 JSON CustomName will parse, but does not resolve score
- Resolved
-
MC-132887 Selector not working with /summon
- Resolved
-
MC-133781 JSON - Entity data problem with selector input
- Resolved
-
MC-135970 Some JSON tags don't work in Team's name and Objective's name
- Resolved
-
MC-137570 Selectors And Scores Don't Work In Custom Entity Names
- Resolved
-
MC-144357 data modify ignores selectors in text
- Resolved
-
MC-146443 The raw JSON "score" function does not work properly with block/item names and lore.
- Resolved
-
MC-146598 Item Name not displaying nbt JSON component
- Resolved
-
MC-230273 Advancement title and description json ignore targets and selectors
- Resolved
-
MC-241138 Score cannot be included in item lore
- Resolved
-
MC-251567 Raw JSON text does not working when using /give, scores, and target selectors
- Resolved
-
MC-278055 Storage text component does not work on item name and lore
- Resolved
-
MC-278227 The text component's selector can't work in entities' nbt data
- Resolved