How do I make a turtle egg-like block be spawned from breeding, and then hatch?

Started by SpaceWalrus on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make a turtle egg-like block be spawned from breeding, and then hatch?
Tue, 02/13/2024 - 20:32 (edited)

I am working on a frog mod, and I want to make the desert rain frog make a "burrow" Block when it is bred, and then that burrow turns into some more frogs after about 20 minutes, how do I do that?

Edited by SpaceWalrus on Tue, 02/13/2024 - 20:32
Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've recently been…
Mon, 04/08/2024 - 18:18

I've recently been experimenting with breeding, and while it is pretty limited, I believe this should be possible depending on your exact preferences. 
Some things to note:

  • Based on my tests, the "breed" AI block is the ONLY way to get entities to enter 'love mode' and path find to eachother reliably
  • Upon successful breeding, entities will ALWAYS spawn another entity of the same type with its 'Age' NBT tag set to child (negative value)

So what I recomend is to make an update tick procedure for your "desert rain frog" and have it detect if it is a child (this block already exists, just search "child"). If the entity is a child, immediately despawn the entity, and place your burrow block underneath it.
(This is very similar to what I've been doing, except I spawn in the baby entity instead of a custom block)

You could also run checks so it only places the burrow if on sand/dirt/etc, and maybe even have a special 'digging' animation play when your frogs stand on the burrow  using geckolib plugin.
 

Hope this helps!