Posted September 12, 201312 yr 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.
September 12, 201312 yr 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
September 12, 201312 yr “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 @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 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
September 12, 201312 yr Author I'm not sure how to do that. Here you can check my code: https://github.com/DavidJotta/KorgeCookie/blob/master/common/com/davidjotta/kcookie/items/ItemHolyCookie.java
September 12, 201312 yr Author Ok, I've been looking into the ItemFood class of Minecraft and I know how to do it, now I only have to modify the code and make it work! Thx for all.
September 12, 201312 yr Its the least we can do. We all uphold Minecraft Forge's reputation this way. It helps us feel a little important too 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
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.