In the video you linked from sethbling, he is actually just detecting the snowballs that are thrown, as snowballs are throw able. He's not detecting right clicks.
If you want to detect when an item is right clicked, the simplest method is to have an armor stand teleported exactly to you, and when you click the item, it the item will actually be put in to the armor stand's hand, which can then be detected. Once that's detected, you give the player another item, and set the armor stand's hand to empty. Rinse and repeat.
More info and commands can be found in this video:
and many others.
For books what you need to do is add on things called clickEvents after each command. So if you had a command that looked like this:
/tellraw @p ["",{"text":"Tp","clickEvent":{"action":"run_command","value":"/tp @p 100 100 100"}}
This gives you a tp
command simply called Tp ("text":"Tp") that teleports you to 100 100 100.
What you would do to add a command is add a comma and start the next line of command:
,{"text":"Tp","clickEvent":{"action":"run_command","value":"/tp @p 120 100 100"}}]
This will teleport them 20 blocks higher then the last command. If we add both commands together the end result should look like this:
/tellraw @p ["",{"text":"Tp","clickEvent":{"action":"run_command","value":"/tp @p 100 100 100"}},{"text":"Tp","clickEvent":{"action":"run_command","value":"/tp @p 100 100 100"}}]
There are book generators out there that will do this for you without the need to type it out yourself, This is a link to one that is fairly popular and works great: https://www.minecraftjson.com/
Best Answer
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:
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.