mojira.dev
MC-253717

"value" key in "score" object for text components does not function

The "value" key should take precedence regardless of the score, but why does the score show up more?  For example, given the following score.

/scoreboard objectives add TEST dummy
/scoreboard players set @p TEST 1

The following will result in a score of "1".

I really want "hello" to be displayed.

/tellraw @a {"score":{"name":"@p","objective":"TEST","value":"hello"}}
/title @a title {"score":{"name":"@p","objective":"TEST","value":"hello"}}

The wiki says it can be used.

Raw JSON text format – Minecraft Wiki (fandom.com)

Please make the "value" key available.

 

I wrote this using a translation software, so the text may be a little bit sloppy. I am sorry.

Best regards.

Comments 9

If the wiki is wrong, update it

@[Mod] tryashtar

I cannot do that.

Because I cannot say for sure that it is a specification.

The "value" key should have worked in the past.
If it is the case that the "value" key does not work, can you please post the URL of the release changelog that clearly states this?

The wiki is community made, and not a source of anything. It is wrong, so it should be corrected (by peoplelike yourself).

@tryashtar

@Dhranios

Someone asked the same question a long time ago, but the bug has apparently been fixed.

MC-96505

I am not reporting a bug to rewrite the wiki correctly.

I am saying that the "value" keys that worked in the past are no longer working and should be fixed.

If you did it intentionally, please post a URL to the changelog, patch notes, etc. of the release that clearly states this.

This is not the place to claim a bug is a spec, is it?

I'll be counting on you.

@@unknown:
Thanks for your comment, I was too hasty. And thanks for linking that older report.
Going back to see exactly when this changed, it looks like value last worked in 20w16a, and no longer works in 20w17a which refactored text components somewhat. The changelog doesn't appear to mention it (an unrelated value from hoverEvent is mentioned though).
In that version, score was changed to resolve to a simple text component instead of simply caching the value.
I'm curious, what's your use case for value in score, when it could be replaced with a simple text?

WAI. I would suggest using a text component and another line for this.

@tryashtar

@moesh

Thank you for your response.

Actually, it is not the score value that is important, but the ability to change the player-specific Japanese text that is displayed, depending on the player narrowed down by the target selector.

For example, to assign different positions to multiple players, the current specification requires the following statement.
 

execute as @a run execute if entity @s[tag=crew] run tellraw @a "私はクルーメイトです。"
execute as @a run execute if entity @s[tag=impostor] run tellraw @a "私はインポスターです。"
execute as @a run execute if entity @s[tag=guardian_angel] run tellraw @a "私は守護天使です。"
execute as @a run execute if entity @s[tag=scientist] run tellraw @a "私は科学者です。"
execute as @a run execute if entity @s[tag=engineer] run tellraw @a "私はエンジニアです。"
execute as @a run execute if entity @s[tag=shapeshifter] run tellraw @a "私はシェイプシフターです。"

 

This writing style increases the number of lines for each additional position.

Furthermore, when such commands must be executed multiple times, the number of command lines and executions can be enormous.

However, if only the "value" key works, you can write the following.

execute as @a run tellraw @a ["私は",{"score":{"name":"@s[tag=crew]","objective":"TEST","value":"クルーメイト"}},{"score":{"name":"@s[tag=impostor]","objective":"TEST","value":"インポスター"}},{"score":{"name":"@s[tag=guardian_angel]","objective":"TEST","value":"守護天使"}},{"score":{"name":"@s[tag=scientist]","objective":"TEST","value":"科学者"}},{"score":{"name":"@s[tag=engineer]","objective":"TEST","value":"エンジニア"}},{"score":{"name":"@s[tag=shapeshifter]","objective":"TEST","value":"シェイプシフター"}},"です。"]

It is a little long, but only one line is needed.

This is how we plan to use it.

Incidentally, if it is possible to give Japanese tags with the tag command, the same thing can be done.

@unknown: that would not work as you would expect. value was used in order to prevent name and objective from being processed again as a caching mechanism. value being specified would have meant that both name and objective are ignored. The result would instead be listing all text in every value no matter what, so all of the selectors are ignored.

@skylinerw

I see that name is also ignored.

Then, even if this bug is fixed, it is unlikely that I will be able to use it the way I envisioned.

Thank you for telling us about it.

akiramidnight

(Unassigned)

Confirmed

(Unassigned)

1.19

Retrieved