Cancel Inventory Close Event

Discussion in 'Spigot Plugin Development' started by Bladian, Aug 9, 2015.

  1. Title says it all.

    I cant' seem to find the method to do it.
     
  2. Have you tried simply reopening the Inventory provided in the InventroyCloseEvent? :)
     
  3. Use event InventoryCloseEvent ?
    and cancel it ?
     
    • Optimistic Optimistic x 3
  4. You cant. InventoryCloseEvent doesnt implement cancellable. Also, i belive closing an inventory is partally clientside so you cant cancel it.
     
  5. on InventoryCloseEvent wait 1 tick (start syncDelayedTask), and reopen closed inventory.
     
    • Agree Agree x 3
    • Winner Winner x 1
  6. Exactly what Mr. sipsy said.
     
  7. maldahleh

    Wiki Team

    You can't cancel the InventoryCloseEvent as it's client side, the event is just the client notifying the server that the inventory is being closed. As others have said, you would have to let it close then reopen it a tick or two later.