Solved Question about PlayerDropItemEvent

Discussion in 'Plugin Development' started by bowlerguy66, Jan 30, 2016.

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

    bowlerguy66

    So, I was wondering if you can get how the player dropped the item. For example, if the player dragged the item out of their inventory, or if they just straight up dropped it from the hotbar. Thanks!
     
  2. Offline

    567legodude

    @bowlerguy66 If you also listen to InventoryClickEvent, you can use
    getAction() and check for all the drop actions (i.e. InventoryAction.DROP_ALL_CURSOR)

    That's how you can tell if they dropped an item by clicking in their inventory.
     
  3. Offline

    bowlerguy66

    @567legodude Okay, thats what I was looking for :p Thanks!
     
  4. Offline

    567legodude

    @bowlerguy66 Just remember, dropping something from your inventory also calls the drop event. So make sure you don't do the same action twice.
     
Thread Status:
Not open for further replies.

Share This Page