Updated:

Summon the dragon

/summon minecraft:ender_dragon ~ ~10 ~

This puts a dragon 10 blocks above you. It has 200 health (100 hearts).

If the dragon just hovers (Java)

On Java, a dragon summoned by command is harmless and hovers in place. Set its phase to make it fly:

/summon minecraft:ender_dragon ~ ~10 ~ {DragonPhase:0}

Phase 0 is circling. In the Overworld the dragon flies toward coordinates 0, 0, so one summoned far away heads there. A summoned dragon has no boss health bar.

Protect your blocks

The dragon destroys blocks it flies through. Turn off mob griefing first:

/gamerule minecraft:mob_griefing false

That is Java 1.21.11+. Use mobGriefing on 1.21.10 and earlier and mobgriefing on Bedrock. See mobGriefing for side effects.

Respawn the dragon in the End (survival)

  1. Go to the exit portal (the bedrock frame) in the middle of the End.
  2. Place one end crystal on each of its four sides.
  3. The tower crystals rebuild and the dragon returns.

Get crystals with /give @p minecraft:end_crystal 4. To reach the End, see the Nether and End teleport guide.

Give a dragon egg

/give @p minecraft:dragon_egg

On Java, only the first dragon drops an egg. Use the command for more. More command-only items are in the hidden items guide.

Remove the dragon

/kill @e[type=minecraft:ender_dragon]

Always name the type. A bare @e removes every mob and item.

When it does not work

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.