PlayerDropItemEvent bug

Discussion in 'Plugin Development' started by KittyKatt, May 13, 2014.

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

    KittyKatt

    Code:java
    1. @EventHandler
    2. public void onPlayerDropItem(PlayerDropItemEvent event)
    3. {
    4. event.setCancelled(true);
    5. return;
    6. }


    Works, it don't allow players to drop items. Problem is..

    BUG: Hold an item on mouse cursor and press ALT + F4 / get logged out / get kicked. Item will be deleted instead of dropped (or as it should do: item put back in inventory since the event was cancelled, but.. it gets deleted!).

    Any solution?
     
  2. Offline

    Konkz

    Get item clicked and after 1 second if they don't have it give it back I guess. I cancel the inventory click event so even if they are not allowed to drop it they can't click on it so I never had this problem.
     
Thread Status:
Not open for further replies.

Share This Page