Discussion in 'Plugin Development' started by m4rku1s, Jan 26, 2016.

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


    Hi! Is there something as EatEvent? I would like to write a plugin to make a infinity porkchop and I have no idea how should I do it. I was wondering to make something like "if player ate porkchop, give it him back"
  2. Offline



    It's the PlayerInteractEvent and check if they have food in their hand, if I recall correctly.
  3. Offline


    I believe you can also you the PlayerItemConsumeEvent but I think either one will work.
  4. Offline


    Last edited: Jan 26, 2016
  5. Offline


    Also a FoodLevelChangeEvent :3
  6. Offline


    That gets triggered after the the player consumes the food.
  7. Offline


    yes but before the food level gets modified (I believe)
  8. Offline


    Yes, it does trigger before it is modified, because you can cancel it or change the amount of health restored, but that still happens after the food item is consumed. Because of that, if you add a new food item after it is consumed, it will "flash" as the old object disappears and the new object takes it's place. It would be better to add the item before the food item is consumed, that way it does not "flash".
Thread Status:
Not open for further replies.

Share This Page