How do I successfully summon the Ender Dragon using commands?

Solution 1:

according to the Wiki, you need to add a "Dragon Phase" NBT tag to him for him to work. to quote;

The /summon ender_dragon command, by default, summons a harmless ender dragon that hovers in place. Setting the DragonPhase tag (for instance by issuing /summon ender_dragon ~ ~ ~ {DragonPhase:0}) will create a normal ender dragon, but it will have no health bar since the bar is managed by the End's dragon fight status rather than by the dragon entity itself. If spawned away from the center of the map (X:0, Z:0), the dragon will first fly to the center before resuming normal behavior (see #Behavior).