Jump to content

[1.6] Eat food without being hungry


DavidJotta

Recommended Posts

Hey guys,

 

I've been looking for a way to make my food eatable even if the player doesn't have hungry (like Golden Apples), but I haven't find it. At the moment, you can eat my food when you are hunger and it gives you some effects. Could somebody tell me what can I add to make my food like a golden apple?

 

Thanks,

David.

Link to comment
Share on other sites

Are you extending ItemFood from the vanilla code? I think ItemFood checks for the hunger level of the player. I dont have my eclipse in front of me at the moment. If that is the case you could implement your own version of a class to handle food for your mod.

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

Link to comment
Share on other sites

“Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program.” - Linus Torvalds

 

Good programmers also debug... And like hearing people say WTF all the time xD

 

 

@OP: I recall there being a method in the Item class that goes along the lines of onEaten( args )... Am I wrong? If it is there, then override it and add your effects, then consume one of that item xD

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Its the least we can do. We all uphold Minecraft Forge's reputation this way. It helps us feel a little important too xD

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

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