This affects Zombie reinforcements spawns and Raid wave spawns. The initial yaw is not uniformly picked from [0.0F; 360.0F], and you can see this in game. This is a bug, because yaw is sampled over [0.0F; Mth.TWO_PI]degrees, clearly the intention is a full circle.
I have verified the root cause by spawning a raid:
Generate a flat Creative world.
/locatea village and teleport to it.Drink an Ominous Bottle.
/tick freezeright before the raid bar finishes.Repeat
/tick step+/execute as @e[type=#illager] run data get entity @s Rotationuntil/executegives any output.
I expected the output yaw to be randomly distributed between 0 and 360. This is what I actually got:
[22:01:52] [Render thread/INFO]: [System] [CHAT] Vindicator has the following entity data: [5.101625f, 0.0f]
[22:01:52] [Render thread/INFO]: [System] [CHAT] Pillager has the following entity data: [89.999985f, 0.0f]
[22:01:52] [Render thread/INFO]: [System] [CHAT] Pillager has the following entity data: [0.38224024f, 0.0f]
[22:01:52] [Render thread/INFO]: [System] [CHAT] Pillager has the following entity data: [360.0f, 0.0f]
[22:01:52] [Render thread/INFO]: [System] [CHAT] Pillager has the following entity data: [89.999985f, 0.0f]0.3 and 5.1 are the bug in action, right below 6.28 (2 pi). If the yaw were really uniform in [0.0F; 360.0F], the chance of two raiders having rotation below 6.28 in that range is (2*pi/360)^2, which is about 0.03%.
360 and 90 rotations are explained by mob AI, the first AI tick happens with the mob spawning, and they started pathfinding. They chose neighbouring nodes not aligned enough with initial yaw, and MoveControl overwrote it. But in the attached screenshot the client does not yet see that for some reason - all illagers face south with small jitter, right after spawning.
Thank you for helping us improve Minecraft! We saved your files: