I want to spawn an egg when I breed my mob, could someone help me with that? I've been at it for hours now.

Started by Ghtrefg on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I want to spawn an egg when I breed my mob, could someone help me with that? I've been at it for hours now.
Thu, 12/26/2024 - 01:38 (edited)

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
Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
And no, I cannot simply…
Thu, 12/26/2024 - 01:05

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…
Thu, 12/26/2024 - 09:44

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…
Thu, 12/26/2024 - 09:44

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

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Actually, my problem is more…
Thu, 12/26/2024 - 15:02

Actually, my problem is more so spawning the egg when breeding the mob, sorry.

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, I'm looking for…
Fri, 12/27/2024 - 01:50

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…
Fri, 12/27/2024 - 11:51

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

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Okay, but I can't find…
Fri, 12/27/2024 - 16:46

Okay, but I can't find anything to check when my creature is breeding.

Use condition on breed task…
Fri, 12/27/2024 - 17:46

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

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
That's smart! Thank you!
Fri, 12/27/2024 - 21:08

That's smart! Thank you!