FabricMC version of onFoodEaten?
cemerson opened this issue · 3 comments
I'm new to Fabric (have only done Forge mods to-date) but I'm trying my hand at porting my mod(s) to Fabric. I'm naturally getting stuck on a number of things but some things are harder to resolve on my own than others. For example - is there or how can I find out if there is a FabricMC equivalent to this Forge event/method?
@Override
protected void onFoodEaten(ItemStack stack, World worldIn, PlayerEntity player) {
super.onFoodEaten(stack, worldIn, player);
// my mod do stuff here
}
BTW if there is a forum or somewhere else where this kind of question should be posed please let me know.
Thank you in advance!
To answer your last question first, the best place to go for help is the Fabric discord: https://discord.gg/v6v4pMv
Fabric does have an event system, but it currently only covers the very common events. The expectation is that for less common events, mods use mixins to add their own hooks. It's a bit of a different approach to the problem, and may take some getting used to if you're used to Forge's events.
This is also partially a difference in design philosophy.
Forge's design philosophy involves covering every possible case, this includes events for literally everything under the sun.
Fabric API is designed to be a lot less overencompassing. Personally I feel we lack many events and parts of api people would use and I want to change that.
We could always use additional contributions to add more, but do note you need to maintain your PRs for them to be merged.