The Team tag directly adds the entity to the provided team even if the entity is not spawned in the world. This should not happen because the entities are sometimes created to test if they can be spawned in the world before actually spawning them, for example to test if they collide with blocks or other entities.
- Create a scoreboard team
- Set the time to night
- Place a spawner which would spawn a mob and add it to a team
- Look at the team size
→ You should see that the number of entities in the team is greater than 0 even though no entity was spawned
Note: The reproduction steps changed slightly. Previously all spawning conditions were checked after loading the entity, now all spawning checks are performed before loading the entity, except the MaxNearbyEntities check.
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.entity.EntityLivingBase.readEntityFromNBT(NBTTagCompound) directly adds the entity to the team. This could be solved for example with a new method onEntityAddedToWorld which could be called when an entity was actually spawned in the world. Then the method readEntityFromNBT could store the team temporarily in a field until the method onEntityAddedToWorld is called.