Hello. Is there a way to get a leftclick, rightlick or shift + leftclick action in an opened inventory?
Thanks for help!
Hello. Is there a way to get a leftclick, rightlick or shift + leftclick action in an opened inventory?
Thanks for help!
What’s your goal?
If you want to create a custom inventory, try this: Inventory · SimonFlash/TeslaPowered Wiki · GitHub Simon_Flash / TeslaPowered
For listening to click events in inventories in general, have a look at these: https://jd.spongepowered.org/7.1.0/org/spongepowered/api/event/item/inventory/ClickInventoryEvent.html
My goal is to deactivate shift + leftclick crafting
The official way is to use the nested events in the click inventory event.
Something like
ClickInventoryEvent.Secondary
There are many nested interfaces so take a look at the last link RandomByte left
Plus some docs on events in general: Events — Sponge 7.2.0 documentation Cancel the shift primary (left) click.