Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello I am Geert4321,

 

I am creating a mod at the moment which semi - requires an onFoodEaten event. It is not neccesary because it is just for a temporary hold and for an optional feature, but I would highly appreciate it to have that event. It might also be helpful for other modders.

 

It would make my christmas merry if you were to implement this feature. I was originally going to add it through ASM, but soon realised that I was unable to do that (as myself, so I couldnt do it, maybe others can) as when I edited the base files directley, the event wouldnt even trigger. So yeah, that is pretty much it :)

 

Greetings, Geert4321

Please look at the forge method files next time.

 

onItemUseFinish Used for when item use count runs out, ie: eating completed

 

I'm always happy to help others!

 

Java is not my main programming language but I have alot experience in PHP/HTML/JS/CSS3/C#/SQL

  • Author

Yes but if you look even further, the method is protected. So I cannot access it, also it does not tell me which food the player is eating. I could go check every tick if the player is using something and then get the ItemStack but really that is a pain in the ***. So an event would be MUCH easier

  • 2 weeks later...

Try using the net.minecraftforge.event.entity.player.PlayerDestroyItemEvent. It's given an EntityPlayer (the player) and an ItemStack (the stack consumed or destroyed). It's called whenever an item is eaten or when destroyed after a rightclick event (there may be other conditions, but it's basically just called when an temstack is destroyed (size<=0)). Just check to see if the itemstack was the food you are looking for and tell it to do something.

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.