raw json in books not working
I used a /replaceitem command to give the player a book which had json text in showing the items in the world and a sentence that could be clicked which would run the command: /kill @e[type=Item]
it worked fine until I clicked the command sentence then it ran the command and closed the book. When I opened it again it showed the raw json instead of the text it showed before and only stopped doing this when I dropped the book and got a new one using the same command.
the command to get the book is:
/replaceitem entity @a slot.hotbar.0 written_book 1 0 {pages:["{\"text\":\"\",\"extra\":[{\"text\":\"all items in this world: \"},{\"selector\":\"@e[type=Item]\"},{\"text\":\" to remove them click here\",\"underlined\":\"true\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/kill @e[type=Item]\"}}]}"],title:Items,author:Anon}
(the command was running on a loop)