The different dragon phases (DragonPhase:0 through DragonPhase:10) of the Ender Dragon were broken by the fixes of MC-87942 and MC-91858. Previously, the Ender Dragon would freely fly around the arena with changing vertical heights. Due to the fix of the aforementioned two bugs, the Ender Dragon dragon phases have been broken, resulting in it getting stuck flying back and forth between two points in an oval-shape.
Expected Behavior: The ender dragon freely and fluently flies around the arena with changes in vertical height
Observed Behavior: The ender dragon frequently gets stuck going back and forth between two points, rather than fluently flying around the arena.
Relates to MC-271336
Related issues
Attachments
Comments


Note that Bedrock Edition still has the correct AI, as those two bugs were never present on Bedrock and thus never caused the dragon phases to break.
after testing this out myself I can confirm that can happen
I can confirm this still happens
I'm not sure if this is related but changing the phases with commands in the overworld doesn't seem to work the dragon only cares about 0,0 even with a command of
execute as @e[type=ender_dragon] run data merge entity @s {DragonPhase:8}
running in a repeat command block. The dragon ignores the player.

I am dubious that the bug was caused by a fix in the rendering of the entity. Dragon phases and rendering are pretty much completely seperate in the codebase, and my testing has suggested that it was rather the typo in aiStep (cf. MC-272431) that causes the bug rather than anything to do with the phases. (I did some comparisons between the codebase of 1.12 and 1.21 and found no obvious discrepancies)