I mess around with commandblocks and found that the command
/summon Fireball ~1 ~ ~ {ExplosionPower:5,direction: [-2.0,0.0,0.0]} creates a fireball. I changed it to /summon Fireball ~1 ~ ~ {ExplosionPower:100,direction: [-2.0,0.0,0.0]}
in the end and the dragon died, but kept flying. I did it again to kill it, but it was just a big light that got brighter every time. I thought it was cool, but at the same time, it was almost blinding. Even then, it kept flying.
Duplicate of MC-84035