Minecraft – How to remove a summoned Ender Dragon with no AI

minecraft-commandsminecraft-java-edition

So I used the command /summon EnderDragon ~ ~ ~ {NoAI:1} so that I would have an Ender Dragon that would just sit there.

I then wanted to get rid of it, but doing /killall EnderDragon didn't work, neither did /killallnpc, and I can't seem to do any damage, even with a diamond sword and maximum strength using commands.

I'm not sure why I can't get rid of it; I think it's because the dragon has no AI, but I need to get rid of it somehow, any ideas?

Best Answer

Use /kill @e[type=EnderDragon,r=100] while you are in the same dimension as the Ender Dragon you want to kill. This command doesn't require any command blocks, so you can just type it in the chat.