The method net.minecraft.entity.EntityLiving.onInitialSpawn(DifficultyInstance, IEntityLivingData) (respectively methods overriding it) modify the world even if the mob the method was called for was not spawned.
This can currently be seen with
MC-103516. The additional mob is spawned but the mob the method was called for is not spawned.
Based on 1.11.2 decompiled using MCP 9.35 rc1
|EntitySpider||Spawns skeleton 1|
|EntityZombie||Spawns chicken or sets IsChickenJockey of existing chicken to true 1|
|EntityOcelot||Spawns other ocelots|
1 Currently blocked by MC-111747 which describes that position and bounding box are not instantly updated when an entity starts riding another entity