mojira.dev
MC-76884

Written Books that use Json scores do not update if the book was created after points have been added to a players score.

The bug

Written Books that use Json scores do not update if the book was created after points have been added to a players score.

How to reproduce

Setup dummy scoreboard

/scoreboard objectives add bug dummy
/scoreboard objectives setdisplay sidebar bug

Create Book (via command block). The book that will work.

give @p written_book 1 0 {title:"Bug",author:"Steve",pages:[
	"{text:'Bug score: ',extra:[
		{color:red,score:{name:@p,objective:bug}}
	]}"
]}

Read open/read the book you just created.

Give yourself a point to be added to the scoreboard.

/scoreboard players add @p bug 1

Create second book (via command block(same command as before)). This book wont work.

give @p written_book 1 0 {title:"After",author:"Steve",pages:[
	"{text:'Bug score: ',extra:[
		{color:red,score:{name:@p,objective:bug}}
	]}"
]}

Read this book.

Both books will show "Bug score: 1"

Add more points.

/scoreboard players add @p bug 5

The first book will now show 6 points.
The second will only show 1 point.

If you reset your score the first book will go bank and the second will stay at 1 point.

Attachments

Comments 13

Confirmed for

  • 1.8.2-pre4

Reason:

Working book

{"extra":[{"color":"red","score":{"name":"Marcono1234","objective":"bug","value":""}}],"text":"Bug score: "}

Bugged book

{"extra":[{"color":"red","score":{"name":"Marcono1234","objective":"bug","value":"1"}}],"text":"Bug score: "}

So when no "value" is set, it uses the current value, but if one is set, it uses the existing one. But don't ask me why it is like this.

This relates strongly to: MC-57508

Confirmed for 1.8.2-pre6.

Confirmed for 1.8.2-pre7.

A more informative title would be useful, we are not trying to create clickbait here.

Confirmed for 1.8.2.

3 more comments

In 1.13 Book doesn't get the updated score when opened. A new book will get the latest values but you don't want to keep getting new books!

This bug still definitely happens in 1.13+ Why is it marked as resolved?

The resolution is still awaiting responses and this is still active in 19w13a for 1.14... Can we say it's a bug still please?

Also after the book is given and opened, there is a tag "value":"#" added into the book tag in the score:{X} area which has the scores. Why can't the score just be pulled every time the book is open instead of constantly updating?

Still in 1.15.2 except the scores won't update at all in either book (following steps to reproduce).

The issue that was reported here can no longer be reproduced. It appears many of the recent comments on this ticket are describing MC-145930 instead.

lucky

(Unassigned)

Community Consensus

JSON, book, nbt-tags, written, written-book

Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.2-pre4, Minecraft 1.8.2-pre6, Minecraft 1.8.2-pre7, ..., Minecraft 1.8.8, Minecraft 15w39b, Minecraft 1.13.2, Minecraft 19w12b, Minecraft 19w13a

Retrieved