[TUTORIAL] How to make entities age

Started by SirPogsalot on

Topic category: User side tutorials

[TUTORIAL] How to make entities age

Hey there, for any of you who want to be able to make entities that age, this is how it works:

  1. Create an adult version of the entity.
  2. Create a baby version of the entity. Typically, baby mobs have smaller bodies and large heads.
  3. Create a procedure for the "on entity tick update" trigger for the baby mob.
  4. Add an NBT tag to the baby entity using the "set event/target entity data number NBT tag "[age]" to [ ]".
  5. Set the second value in the above block to "get event/target entity data number NBT tag "[age]" + [1]. That way, the entity's age will increase by 1 every tick. Keep in mind that 1 tick is 1/20 of a second, so the time it should take for your entity to grow up should be (number of seconds) * 20. For example, 5 seconds would be 100 ticks, 10 would be 200 ticks, 5 minutes would be 6000 ticks.
  6. Create an "if" block, and set the condition to "get event/target entity data NBT tag "age" = (whatever age you want it to grow up at)".
  7. Within the "if" statement, place a "despawn event/target entity" block.
  8. Below that, still within the "if" statement, place a "spawn at [x] [y] [z] living entity [adult version of the entity]."
  9. And there you go! What will happen is after the designated number of ticks have passed and the age NBT tag has reached the correct number, the baby will despawn and be replaced with an adult.

Good luck!

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i want to make minecraft…
Mon, 08/17/2020 - 15:21

i want to make minecraft foxes (but they attack you) but it's hard to me making a baby model in blockbench because it's toooo tiny and i can't find minecraft baby entities models and the baby uses the adult texture but how?

Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello, I have a problem that…
Tue, 12/01/2020 - 21:13

Hello, I have a problem that is that I cannot finish the procedure since I do not understand that much English right now I am using a translator, well you can send me an image as a reference of how the procedure is.

Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Jotaro... you're approaching…
Wed, 12/02/2020 - 01:33

Jotaro... you're approaching me? Instead of running away, you're coming right to me?

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hi you can send a print…
Tue, 03/09/2021 - 19:22

hi you can send a print/image for examples ?I am new here

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what this "get event/target…
Tue, 03/09/2021 - 19:25

what this "get event/target entity data NBT tag "age"?

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
please show a reference for…
Mon, 01/09/2023 - 23:04

please show a reference for this!

GeckoLib entities made with…
Tue, 01/10/2023 - 01:04

GeckoLib entities made with my plugin automatically scale based on their age

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
But, what if I am not…
Thu, 01/12/2023 - 00:39

But, what if I am not interested in installing your plogin?

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
For anyone who's struggling…
Tue, 04/04/2023 - 20:21

For anyone who's struggling with this, here's the procedure as an image, it does work I've tested it

Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What if it was a tamed…
Tue, 04/18/2023 - 06:52

What if it was a tamed animal? wouldnt despawning the animal and spawning another remove that attribute?

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know this is an old forum,…
Sun, 08/18/2024 - 06:46

I know this is an old forum, but what if my mod is like a cow/sheep? As in, what would I do if I wanted to feed the baby it's preferred item to reduce the growing time, and have it slowly be less effective depending on how soon the baby is grown up?