How do I register INVENTORY_CHANGE events???

Discussion in 'Plugin Development' started by oxguy3, Oct 31, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    oxguy3

    In the Event.Type enums of org.bukkit.event, there are several enums for Inventory stuff - INVENTORY_CHANGE, _CLICK, _OPEN, etc. However, there doesn't seem to be any Listener able to handle these events. How can I monitor inventory changes if I can't just register these events to an InventoryListener???

    If it helps, I am trying to make sure that the player keeps an item in a certain slot (slot 0) of their inventory. I have to listen to stop them if they try to throw it out, move it, whatever.

    Thanks!
     
  2. You use a player listener for PLAYER_INVENTORY_EVENT. I cannot find the enums you have posted.
     
  3. Offline

    oxguy3

  4. The methods for those don't appear to be implemented yet. I can register them but the InventoryListener class only has methods for furnaces.
     
  5. Offline

    Ziden

    Try using Spout InventoryListener, works very well and doesnt need the client-side spoutcraft
     
  6. Offline

    jblaske

    InventoryListener does require a spout craft client for some of those events. Such as the inventory open event - this event will never trigger on the server if the user doesn't have a spout craft client.

    This is the whole reason i had to add an alternative method to claim your rewards in ChallengeMaps. Since non spout users couldn't trigger the inventory open event.
     
  7. Offline

    Ziden

    You dont need to use spoutcraft client to use the inventory listener, even the open event, only needs the plugin. I used it for a long time.
     
  8. Offline

    oxguy3

    Actually, my project is going to require Spoutcraft anyway, so whether or not Spoutcraft is required for inventory events doesn't matter. Anyway, I don't need the inventory open events; I'm only watching to make sure an item doesn't get moved from its slot. Thanks so much everyone; Ima go read up on SpoutAPI's javadocs.
     
Thread Status:
Not open for further replies.

Share This Page