Tracking items moved from a chest to another inventory

Discussion in 'Plugin Development' started by Derek Peterson, Sep 15, 2011.

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

    Derek Peterson

    Hey everybody,

    I've been trying for the past few days to get a system working to allow my players to buy/sell items through a public trade chest by simply moving items between the two inventories.

    The closest thing I could find to help me do this is Spout's InventoryClickedEvent. This works extremely well for all but one case. I am able to restrict where and when players are able to click. I can even keep the user from "dropping" the item by clicking out of the inventory window. The problem, however, is that if an item is hovering/attached to the cursor, and they hit escape to close the chest interface, the item will still drop, essentially giving them a free item.

    Does anybody know if there is a better way to do this? I saw some things hinting toward a INVENTORY_TRANSACTION hook, but it looks like it's not actually implemented yet.

    If anybody can shed any light on this, I would greatly appreciate it!
    Thanks,
    Derek
     
  2. Offline

    Derek Peterson

    I hate to bump, but is there anybody who could help me out with this? I'd really appreciate any help I can get.

    Thank you!
     
  3. Offline

    Afforess

    You can cancel InventoryClose events if they have something in the cursor.
     
    ItsHarry likes this.
Thread Status:
Not open for further replies.

Share This Page