Detect change in a chest

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

  1. Offline

    paletas

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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,
    PaletaS
  2. Offline

    Chuck Lieb

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I'm not sure how much use you will find in this, and if they even work, but here ya go!

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

    paletas

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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

    tickleman

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Really waiting for this events too !
    Ho pleaaaase :)
  6. Offline

    tanaka141

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    do there are some possibility that those event are usable in the close future ?
  7. Offline

    Edward Hand

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    To confirm, those event hooks are not yet implemented (for reasons nobody can explain).
    We all just have to be patient.
  8. Offline

    Crash

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    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