Detect different types of inventory clicks


#1

How to get which button was clicked, as ClickInventoryEvent seemingly only runs when the left mouse click is pressed on an itemstack.


#2

How you would detect it would be to use the nested interfaces inside the ClickInventoryEvent. Such as the following

ClickInventoryEvent.Primary
ClickInventoryEvent.Secondary

However based on what your message is inferring, im guessing that hasnt worked?


#3

If I understand correctly, the ClickInventoryEvent when no click is specified should be executing for both… but it doesn’t for right click for me…


#4

But I’ll try those and I’ll report if there’s any change


#5

It is correct that the ClickInventoryEvent should fire both. Infact it should fire all these https://github.com/SpongePowered/SpongeAPI/blob/stable-7/src/main/java/org/spongepowered/api/event/item/inventory/ClickInventoryEvent.java