mojira.dev
MC-74972

Written Book NBT cannot change specific page

I put a book with 10 pages written to it into an Item Frame, then attempted to change a single page in the book using /entitydata.

The Expected outcome was page 5 changing to say "hello".

What happened is all pages were erased and page 1 edited to say "hello"

Steps to recreate issue:
1: Place Written Book, with more than 1 page filled out, into an item frame.
2: Use command /entitydata @e[type=ItemFrame] {Item:{tag:{pages:[X:"Text"]}}}
NOTE X is the page number you wish to change

Attachments

Comments 8

[^7c2bd6600c[1].png]
[^8262d7e87c[1].png]
[^be46bd1505[1].png]
[^dd15d4cd09[1].png]

Books are arrays

["Page text","Page Text"]

not Dictionaries

{"key":"value"}

Using your method results in the same problem.

When I used the command: /entitydata @e[type=ItemFrame] {Item:{tag:{pages:["","","","Hello"]}}}

Pages 1-3 had "null" written over the pages i had as they should not have, and page 4 changed to "Hello" as it should have.

Yup, because you're setting page one, two, and there to "", which results in null. You can't change a specific page because it's an Array

Thanks for clearing that up. Still it would be nice to be able to Edit a Specific page using Commands, That way we could create an "Adventure Log" like item that can update specific pages after a player completes a pre-determined task.

It would have to have
pages:["{text:\"\"}","{text:\"\"}","{text:\"\"}","{text:\"Hello\"}"]
to work correctly, however I believe that it would make the command too long to paste in the chat bar, but would work in command blocks.

Conor, that would overwrite the earlier pages.

Arrays are not 'merged'.

John Dame

Erik Broes

Unconfirmed

Minecraft 1.8.1

Retrieved