Minecraft Spigot 1.8 open player book?

Tr
5

I want a player to click on an item in the inventory to open a written book.

My question is, how can I open the book without the player holding a book in hand?

My source is here:

Ma

https://www.spigotmc.org/...ui.131470/

((org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) p) .getHandle (). OpenBook (CraftItemStack.asNMSCopy (book));

https://www.spigotmc.org/...ui.359339/

Tr

Can you explain that to me too?

Ma

In the second link, the plugin sends a packet, which pretends to the client to open the book.

In the first guest you see the player as an entity and open the book.

I still think that you can't get away on the way around the book in the inventory.

Tr

In what order should I do it?

Should I send the packet first (i.e. The 2 link).

Thanks in advance. I'm not that fit in Java / Spigot yet

Ma

First run the book and hand and then the code.