-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Labels
status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.Disputed bug is accepted as valid or Feature accepted as desired to be added.
Description
Is your feature request related to a problem?
There is no convenient way to detect which shelf slot a player has interacted with.
Describe the solution you'd like.
Like ChiseledBookshelf, I assumed Shelf blocks would have a getSlot method.
I need to be able to detect when a player has clicked on a specific shelf slot, so I can know which item, if any, is already present.
For example, I use this for chiseled bookshelves:
chiseledBookshelf.getInventory().getItem(chiseledBookshelf.getSlot(event.getClickedPosition()))
The 1.21.10 update tracking issue mentioned sharing this code between these blocks but nothing has come out of that.
Describe alternatives you've considered.
Only other way would be to calculate the slot from a vector myself which I'm not sure I can do purely from the API.
Other
No response
Brokkonaut and envizar
Metadata
Metadata
Assignees
Labels
status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.Disputed bug is accepted as valid or Feature accepted as desired to be added.