Player Drinking Event?

Discussion in 'Plugin Development' started by zachoooo, Jan 8, 2013.

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

    zachoooo

    How do you get when a player drinks a water bottle?

    FoodLevelChange doesn't work because drinking water doesnt change your hunger
     
  2. Offline

    RainoBoy97

    PlayerInteractEvent > Check item in hand and action
     
  3. Offline

    zachoooo

    that does it right away though, I want it after you finish
     
  4. Offline

    Terradominik

    i think the only way is to start a schedular there and check if they have drunk it after like 10 or 30 seconds and than start what ever you want to do
     
  5. Offline

    zachoooo

    Tried this. Its possible to throw the glass bottle or switch it slots in time to avoid the items destruction
     
  6. Offline

    Terradominik

    make two scheduler, on loop which checks every tick if the bottle is still in the handslot and a other one which goes till the bottle is empty
     
  7. Offline

    RainoBoy97

    Check if they have the water bottle in hand, and if the action is right click, then check if the bottle went to an empty bottle.
     
  8. Offline

    fireblast709

    make the waterbottle instadrink. That is the only solid solution I know to prevent the bypass
     
  9. Offline

    caxco93

    PlayerInteractEvent, action right click, iteminhand water bottle, after the time it takes to drink water bottle, check if iteminhand bottle
     
  10. Offline

    fireblast709

    *starts drinking and switches to empty bottle*
     
    zachoooo likes this.
  11. Offline

    RainoBoy97

    shhhhhhhh
     
  12. Offline

    Rprrr

    If you do what caxco93 said and if you check for added potions effects.. it's possible. ;)
     
  13. Offline

    fireblast709

    Rprrr then what about water bottles ;3
     
  14. Offline

    zachoooo

    There are too many possible problems with this, I wish they would just add a player consume event or something like that
     
  15. Offline

    Rprrr

    fireblast709
    Yea, that's a problem. :l :s
    Indeed, a consume event would be nice, but I'm not sure if it's actually possible.
     
  16. Offline

    fireblast709

    Yes it is possible. It would require a count of water bottles before and afterwards. And you need to log when a player drops a waterbottle, picks one up and interacts with chests
     
Thread Status:
Not open for further replies.

Share This Page