Detect change in a chest

Discussion in 'Plugin Development' started by paletas, Jan 22, 2011.

  1. Offline


    Hi there,

    I'm trying to do my first plugin that requires that I can detect if any items were removed from the chest. My first approach is to detect when the chest is opened and then if the inventory is changed while a chest is opened I will check if the new item came from the chest.

    But I got two problems with that:
    1. I don't like it.
    2. I don't know how to check if an item came from the chest.
    I'm sure there is or will be a better way, so if anyone does know please tell me.

    EDIT: After thinking about it my solution wasn't taking in account that this is a server plugin (my bad), but I still would like to see if there is a way to detect changes to a chest.

    Thanks in advance,
  2. Offline

    Chuck Lieb

    I'm not sure how much use you will find in this, and if they even work, but here ya go!

    Called when a player opens an inventory
    : add javadoc see comment
    INVENTORY_CLOSE Called when a player closes an inventory.
    : add javadoc see comment
    INVENTORY_CLICK Called when a player clicks on an inventory slot.
    : add javadoc see comment
    INVENTORY_CHANGE Called when an inventory slot changes values or type.
    : add javadoc see comment
    INVENTORY_TRANSACTION Called when a player is attempting to perform an inventory transaction.
    : add javadoc see comment
  3. Offline


    Thanks, but I don't seem to find that in the API. Maybe it is not yet implemented, but still it's good to know it will be in the future.
  4. Offline

    Chuck Lieb

    If you can get any of them to work, PM me please. Some of my plugins need some (or in one case, all) of these hooks.
  5. Offline


    Really waiting for this events too !
    Ho pleaaaase :)
  6. Offline


    do there are some possibility that those event are usable in the close future ?
  7. Offline

    Edward Hand

    To confirm, those event hooks are not yet implemented (for reasons nobody can explain).
    We all just have to be patient.
  8. Offline


    Yeah it was added on the 7th of January
    This is probably something they should add on soon, I also need it :)

Share This Page