InventoryClickEvent on Creative Mode (1.8.8)

Discussion in 'Plugin Development' started by Blendy, Aug 21, 2020.

Thread Status:
Not open for further replies.
  1. I'm trying to make an item that will allow you to open a custom GUI and I need to make that item unmovable.
    The plugin is made for server admins so its gonna be used on creative mode.
    When I cancel the event for creative mode it works fine the first time I click it, but the second it doesnt register the event at all. It also dupes items if you shiftclick or use numpad. Everything works fine in survival though,,,
     
  2. Offline

    KarimAKL

    @Blendy Can you show us the code? We don't have much to go on here.
     
    pietermantel likes this.
  3. Its not an error on the code because it works just fine on survival. I've been told that creative holds the inventory in a much different way.

    Anyways I'll more or leds replicate the code here: (Hand written here, dont mind spelling or syntax)

    @EventHandler
    public void onInvClick (InventoryClickEvent e) {
    if (e.getItem().equals(myitem){
    e.setCancelled(true);
    }
    }

    Also I have some more Code for cancelling pressing the hotbar Burton on another slot to move the item and to cancell dropping it.

    In Creative it works very weirdly and starts duping itself with numkeys...
     
    Last edited: Aug 24, 2020
  4. Offline

    KarimAKL

    @Blendy I believe you need to handle the creative inventory differently from the survival one. We probably need the actual code to tell what's wrong.
     
Thread Status:
Not open for further replies.

Share This Page