Can someone help me? I spawned something like 10 Ender Dragons using commands but they're lagging my game so hard I can't kill them. Is there a command in vanilla Minecraft to kill all nearby mobs? And before you say /killall or /kill all they don't work.
In general the easiest way to remove hostile mobs is to switch to Peaceful mode, but I'm not certain that will work with ender dragons.
If it doesn't work or isn't an option, you could place a command block and use the command:
This will kill everything other than players, but ideally it should be called from a command block for it to work correctly.
In this case if you only need to kill ender dragons, you can use the command: