Eat/Drink Event

Discussion in 'Plugin Development' started by microgeek, Feb 1, 2013.

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

    microgeek

    Hey, is there any easy way to check for an eating/drinking event? I need it to work with both food/potions, so FoodLevelChangeEvent(Something like that) won't work. The only thing that I can get working is starting a timer in a PlayerInteractEvent(and checking for a potion as held item) and then see if they are holding a glass bottle after the timer expires , and using FoodLevelChangeEvent for food. Sorry for any spelling/grammar, used my tablet to type this up.
     
  2. Offline

    Burnsalan18

    I guess you would start by checking if the item is edible, something like if(item.isedible)
    Not to sure really maybe someone can correct me on this as i am interested as well.
     
  3. Offline

    chasechocolate

    Since (currently) there is no event for that, you might have to start a BukkitRunnable on PlayerInteractEvent and if the item changes (gets reduced by one of switches to a glass bottle) do whatever.
     
  4. Offline

    polo2673

    Bukkit should really implement that command it would be usefull!
     
  5. Offline

    Milkywayz

    I agree with the notion of adding an event for drinking potions, but maybe a PotionApplyEvent for whenever an potion is applied to an entity. It would be more useful then the PotionSplashEvent where you can't even get the Potion object of the thrown potion and doesn't cover regular potions...
     
Thread Status:
Not open for further replies.

Share This Page