Minecraft – How to i summon an ender dragon so it won’t break blocks

minecraft-java-edition

I've been wanting to make a cool map for minecraft, and i have been having a bit of trouble. I've been wanting to summon an EnderDragon in the overworld. But, i don't want it do destroy my map. And i'm not going to turn it all into endstone and obsidian. Can somebody please help me? Am i doing something wrong?
I have been using the /summon EnderDragon command. It will summon the dragon, but it just destroys everything.

Best Answer

Summon a EnderDragon with no AI:

/summon EnderDragon ~ ~ ~ {NoAI:1}

Mobs with no AI will not move and will not be animated.