Started by _CrimsonInferno_ on Fri, 07/17/2020 - 19:47
Topic category: User side tutorials
Hey there, for any of you who want to be able to make entities that age, this is how it works:
- Create an adult version of the entity.
- Create a baby version of the entity. Typically, baby mobs have smaller bodies and large heads.
- Create a procedure for the "on entity tick update" trigger for the baby mob.
- Add an NBT tag to the baby entity using the "set event/target entity data number NBT tag "[age]" to [ ]".
- Set the second value in the above block to "get event/target entity data number NBT tag "[age]" + . 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.
- 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)".
- Within the "if" statement, place a "despawn event/target entity" block.
- Below that, still within the "if" statement, place a "spawn at [x] [y] [z] living entity [adult version of the entity]."
- 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.