mojira.dev
MC-96505

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

The value key is meant to be used as a priority display instead of a processed score. For example, given the following score:

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

The following would show "hello" in 1.8, but still shows "1" in 1.9:

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

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

/setblock ~ ~1 ~ standing_sign 0 replace {Text1:"{\"score\":{\"name\":\"@p\",\"objective\":\"TEST\",\"value\":\"hello\"}}",Text2:"[\"\"]",Text3:"[\"\"]",Text4:"[\"\"]"}

/give @p written_book 1 0 {title:"",author:"",resolved:0b,pages:["{\"score\":{\"name\":\"@p\",\"objective\":\"TEST\",\"value\":\"hello\"}}"]}

In 1.9, the book sets value as the player's processed score, overwriting the original value of "hello", and at that point it does work as the priority display. As such, setting resolved to 1 does allow it to work based on my input in 1.9, but it's a feature only available for books (and in 1.8, resolved can be 0 and my inserted value takes precedence):

/give @p written_book 1 0 {title:"",author:"",resolved:1b,pages:["{\"score\":{\"name\":\"@p\",\"objective\":\"TEST\",\"value\":\"hello\"}}"]}

This is likely related to the issue described in MC-88957.

Linked issues

Comments 3

What is the 'purpose' of value? I never understand what it's supposed to be used for.

As far as Minecraft uses it, it would prevent the need to constantly re-process the score, as value is set to the processed value afterwards. Now we cannot manually set a value for it ourselves like we could in 1.8 (except for books under a specific circumstance). Why map-makers would bother do that in the first place is beyond me, though!

Fixed alongside the fix of MC-101457.

Skylinerw

(Unassigned)

Confirmed

Minecraft 16w04a, Minecraft 16w05a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 16w07a, ..., Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w43a

Minecraft 1.11 Pre-Release 1

Retrieved