Chest Interaction

Discussion in 'Plugin Development' started by ursa_arcadius, Feb 11, 2011.

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

    ursa_arcadius

    A plugin that I am working on needs to be able to see when someone takes an item out of the chest and places it in their inventory. Is this possible?

    The only way I have come up with is to copy the inventory of the chest (before) and the player. When the player then leaves the chest and moves I can look at the chest inventory (after) and make comparisons to see what was removed. There must be a better way than this.

    The Code --> https://github.com/ursa-arcadius/ChestTradingSystem
     
  2. Offline

    Isabaellchen

    Basically the Minecraft code is only sending an inventory changed event to the server, each time any inventory in the world changed.
    It does not recognize who changed what, only which chests inventory has been changed.
    So, no, basically you can only do what you were trying to do, but you should lock chests while someone is using them.
    Two players editing the same chest inventory can not be sepparated from each other.
     
  3. Offline

    ursa_arcadius

    Yea, I will also have to account for if they log off while the inventory screen is open or if they drop something on the ground. Thanks
     
Thread Status:
Not open for further replies.

Share This Page