Topic category: Help with Minecraft modding (Java Edition)
Hi! I'm making a mod for minecraft 1.19.2 and everything was fine but now I'm stuck.
I want an item to be spawned / dropped after breeding 2 animals (any kind of animal actually), I didn't find a "clean way" to do it with procedures (maybe is there a way checking entity spawn or entity enters the world and checking if it's child?, but in this case I'm afraid that if baby chicken spawn from egg will also be executed for example).
I'm currently a Java programmer so I work like 8 hours day programming, If i have to code is no problem (Though I like MCreator because it's more visual and "relax me more" after I got home haha). I was looking for forge APIs (which I think is what I have to use to code my own procedure) and find that BabyEntitySpawnEvent it's the event I'm looking for, but I cant find the event I have to Subscribe to (somewhere I found onBabyBorn, but I think it's not right). I don't know If maybe the best solution is to learn more about forge and create this subscriptions manually or maybe it's not the best way to go. If integrating custom code / procedures is the right thing to do, some help / advice?
Thank you in advance!
I think integrating custom code would be good
Ok thank you!
Then I guess the question is, where do I find the Events that I have to subscribe? (Tryng to post more info but I got 1 error has been found on reply)
Thank you again!
The API I'm looking for is this one: https://nekoyue.github.io/ForgeJavaDocs-NG/javadoc/1.19.2/index.html )
I don't know if there's a layer in between for MCreator or that I'm just missing something (I'm newbie making mods after all >.<) and so I cant Find the event I have to subscribe for BabyEntitySpawnEvent (maybe it comes from Animal?). The docs for this event I'm looking for are here https://nekoyue.github.io/ForgeJavaDocs-NG/javadoc/1.19.2/net/minecraftforge/event/entity/living/BabyEntitySpawnEvent.html
My current code is something like this
Sorry, done.
Everything was working since the beggining, I was using getChild that I suppose was null at the time of the event and my item position relies on it.
Thank you very much. Stupid mistake!