Does your item class extend ItemFood? You need to if you haven't.
If you did extend ItemFood:
Did you override the onItemUseFinish() method? (You probably shouldn't override it, but that is the method that is supposed to call onFoodEaten()).
The only other thing I can think of is maybe you imported the wrong World class or something so that the method prototype doesn't match the parent class.
Thanks, but onFoodEaten still isn't getting called.
Have you actually created and registered an instance of this class?
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I would highly recommend learning Java properly before trying to make a mod. You need to at least understand the basics of OO programming like classes and instances.
Upload your item registration code to Gist or Pastebin and link it here.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I can not believe how silly I was, I've been trying to get it to work for the last 3 days... and in the end I forgot to change the item register to the new class. Thanks everyone for your help!
I have tried the following but it doesn't work :
Did you make sure that the event is properly called using a breakpoint or a sysout? Because that looks fine to me.
Check out my mod, Placeable Items!
If my comment helped you or you just like me, hit the green arrow down there!
I've checked using a breakpoint and for some reason OnFoodEaten isn't getting called.
Does your item class extend ItemFood? You need to if you haven't.
If you did extend ItemFood:
It extends ItemFood.
try posting your item's class
sorry for my bad english I'm Italian
Here is the class
I tried it and for me it works.
There is only a little problem with your code, you have to check that it will be executed only server side with a check over the flight code:
sorry for my bad english I'm Italian
Thanks, but onFoodEaten still isn't getting called.
Have you actually created and registered an instance of this class?
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I'm not sure what that means, sorry I'm fairly new to java.
I have registered the item using that class.
I would highly recommend learning Java properly before trying to make a mod. You need to at least understand the basics of OO programming like classes and instances.
Upload your item registration code to Gist or Pastebin and link it here.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I can not believe how silly I was, I've been trying to get it to work for the last 3 days... and in the end I forgot to change the item register to the new class. Thanks everyone for your help!