Uploaded image for project: 'BuildTools'
  1. BuildTools
  2. BUILDTOOLS-255

InventoryCloseEvent firing when item in hand

XMLWordPrintable

    • Custom plugin

      I just found that for some reason when opening a Bukkit inventory on the new update (1.10), latest Spigot with an item in hand, it fires the "InventoryCloseEvent", even though the menu wasn't closed.

      Example 1:

      • Right click cauldron (Nothing in hand, null)
      • Creates inventory
      • Opens Bukkit Inventory/Menu
      • Player can interact with the menu, click items and change settings.

      Example 2: (Bug)

      • Right click cauldron (With anything in hand)
      • Creates inventory
      • Opens Bukkit Inventory/Menu
      • InventoryCloseEvent triggered
      • When player interacts with anything, error with inventory being "null"

      In my plugin I used the "InventoryCloseEvent" as a way to remove an inventory I've created and placed on a HashMap. Removing it was done for memory reasons. So whats happening for some reason is the InventoryCloseEvent is triggering without me even closing the menu, which leads it to be deleted upon the HashMap, which then leads to the null when InventoryClickEvent is fired.

            Unassigned Unassigned
            Qazoa Laura Green
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: