Keep minecraft book opened after click event
A written book is always closed upon clicking a JSON click event within the book unless it is a change_page
click event, which will change the page of the book. The only way around this is to have the book on a lectern instead of in-inventory.
It is also impossible to update data dynamically while the book is being read. This is due to component resolution:
When you use the JSON text components
score
,selector
, andnbt
, the system cannot render the value directly. Instead, these components must be resolved, meaning, converted into a text tag with the correct value. For example:This means that the component is only resolved once, so the value displayed will not dynamically update.
- This:
{"score":{"name":"@p","objective":" text"}}- must be converted into…
{"text":"16"}with the correct value, of course
So you can have your book on a lectern instead, which will prevent the automatic closure, but be warned that updating info of the book while someone is reading it may cause them to be kicked out.
You may instead want to interest yourself in having the book display a single button "Adjust Status" that when clicked, closes the book and /tellraw
s the buttons to change the status into the chat.