InventoryClickEvent firing 3 times when double clicking - How to filter SHIFT_LEFT

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

AlexDerProGamer

New member
Jun 8, 2024
1
0
1
Germany
Java:
    @EventHandler
    public void onClick(InventoryClickEvent e){
        Bukkit.broadcastMessage(String.valueOf(e.getSlot()));
        Bukkit.broadcastMessage(e.getClick().toString());
        Bukkit.broadcastMessage(e.getAction().toString());
        Bukkit.broadcastMessage(e.getCurrentItem().toString());
        Bukkit.broadcastMessage(e.getCursor().toString());

        if(e.getClickedInventory().getType() == InventoryType.CHEST && e.getCurrentItem().getType() == Material.CHEST){
            e.setCancelled(true);
        }

When double clicking on an item without holding shift the 3 clicks (from e.getClick()) are:
1. LEFT
2. LEFT
3. DOUBLE_CLICK
all good, you can filter out the 3rd so the event only fires 2 times when double clicking on an item

but when holding shift and double clicking the 3 clicks are:
1. SHIFT_LEFT
2. SHIFT_LEFT
3. SHIFT_LEFT
and theres no way to filter the 3rd one out, thats executed automatically

so my question is: is there a way to do this?