Started by
Ghtrefg
on
Topic category: Help with Minecraft modding (Java Edition)
All I want is for my mob to lay an egg when bred with another of its kind. Clicking on my mob with a spawn egg should still spawn a baby, however, to mimic typical Vanilla mobs. I have everything pertaining to the egg itself finished, I just need my mob to lay it.
Edited by Ghtrefg on Thu, 12/26/2024 - 01:38
And no, I cannot simply despawn the babies and put an egg in their place, for that would mean having no babies at all, which I'm not particularily fond of.
You can use your entitys tick and synced data to count ticks since last lay. Then on given interval (with random changes if you will), spawn item entity that represents your egg
I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei
Actually, my problem is more so spawning the egg when breeding the mob, sorry.
Like placing egg item in the world?
Use place item entity procedure block
No, I'm looking for something like how Sniffers lay eggs. You breed them, and one lays an egg that hatches into a baby Sniffer.
One option would be to make egg entity or block (and spawn/place it when you want to lay an egg) that spawns another entity after a given amount of tick
Okay, but I can't find anything to check when my creature is breeding.
Use condition on breed task. Start condition is called when breeding starts.
Return "true" logic value so breeding always starts, and in blocks above the return block do the spawning part
That's smart! Thank you!