Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-1218

InventoryUpdateEvent

XMLWordPrintable

      Well I noticed there is no way for getting the event where a players' inventory is updated.
      There could be plenty of reasons for an inventory to update:

      1. An inventoryholder pickups an item
      2. A player drags an item into his inventory
      3. Another plugin updates the inventory (Adding item, removing item, clearing inventory)
      4. A player drops an item
      5. A dispenser equips armor on a player
      6. A dispenser gives something to the player
      7. A player drags an item into another inventory
      8. Items enter a hopper
      9. Items are transmitted from a hopper
      10. InventoryHolder dies
        I suggest to put all these in an InventoryUpdateEvent, which would have the following arguments:
        Inventory getInventory() - the inventory updated
        UpdateType getUpdateType() - the way the inventory was updated (An enum with ways of an inventory being updated)
        InventoryHolder getSource() - who updated the inventory (I dont know if this should be an inventoryholder since it can be a plugin aswell)
        InventoryType getInventoryType() - the inventory that was updated's type

      And another event, PlayerInventoryUpdateEvent which extends InventoryUpdateEvent:
      Player getPlayer() - the player who's inventory was updated
      And all the variables from InventoryUpdateEvent

      Now, of course these are all listenable - I can listen for pickup, dragging, clicking, dispensing, death and all that stuff, but I cannot listen for another plugin updating an inventory. That is a major flaw in bukkit & spigot and I think spigot is the place to change it.

            Unassigned Unassigned
            NonameSLdev SL Dev
            Votes:
            6 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: