How to get the drop reason for a item

Discussion in 'Plugin Development' started by Roelyboely12, Aug 27, 2014.

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

    Roelyboely12

    I want to listen for playerpickupitemevent
    and then i want to get the drop reason
    how do i achieve this?
     
  2. Offline

    kunhunjon

    You cant get the "drop reason" from that event yo. You could use the PlayerDropItemEvent and save who dropped it if you're looking for a specific player. Or find an event that handles all drops or the kind of drops you want and see if you can derive the "drop reason", whatever that means, from that.
     
  3. Offline

    mine-care

    You could make a enum with reasons. Like
    PLAYERDROP,BLOCKBREAK,SPAWN,MOBDROP,UNKNOWN and ou could have a hashmap of the itemstack and enum so when a player breaks a block for instance you put in the hashmap the itemstack and enum.blockbreakbut this is custom handling :/ sorry if I am out of point or you can't understand what I mean :-(
     
  4. Offline

    Roelyboely12

    I understand what you mean but i don't know how to make/call enums :(
     
Thread Status:
Not open for further replies.

Share This Page