Ways to respawn Ender Dragon after it has been killed [duplicate]

While Ben's answer is correct, it doesn't address the command blocks as you mentioned in the question. For checking if it's there, I believe you can run a /testfor command to test for the ender dragon within a certain radius (if you place the command block in the End and away from where the dragon would destroy the redstone), use a comparator to take the output from the command block, run it through an inverter (so you get output on a result of there not being a dragon in the radius), then run that into a command block with the /summon command to either summon the dragon directly (but there won't be a health bar) or to summon ender crystals around the exit portal.

If you opt to summon the dragon without the health bar (as it's tied to the boss fight status as opposed to the dragon entity) you can use the following command to summon it. /summon ender_dragon ~ ~ ~ {DragonPhase:0} You can of course replace ~ ~ ~ with XYZ coordinates so you don't spawn the dragon on top of the block and risk it breaking the redstone.


From the Minecraft Wiki:

Players can re-summon the ender dragon once the fight is over by placing four end crystals on the edges of the exit portal — one on each side. (Fewer crystals can be used by exploiting this trick.) When the dragon is re-summoned, a series of explosions resets the obsidian pillars, iron bars, and end crystals. The top of each pillar appears to explode, destroying any player-placed blocks. example pic