Player open/close book event #11181
KioProject123
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
I'm not sure that the server knows if a player has a book open or not? [too dead too check] |
Beta Was this translation helpful? Give feedback.
2 replies
-
It does. Right-clicking a book causes the server to send a packet that then opens the GUI on the client. That also means that the PlayerInteractEvent would be the correct event for this. You can easily check for only Item interactions using useInteractedBlock() and useItemInHand(), a new event shouldn't be necessary for this. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is your feature request related to a problem?
Cancel the player opening a book, or perform an action when the player opens a book.
Describe the solution you'd like.
Add an event when the player to open/close a book.
Describe alternatives you've considered.
Listen for PlayerInteractEvent and check that the player is holding a book and that the player is not interacting with other blocks (such as opening a chest, a door, etc.)
It is impossible to check the behavior of all block interactions.
Other
No response
Beta Was this translation helpful? Give feedback.
All reactions