Minecraft wiki entry for Creating_behavior_packs, associated text: This is an event that is triggered when an entity of this type is spawned. In pig.json this has a randomize function that determines whether the pig is going to spawn as a baby or an adult pig.