Ender Dragon

The ender dragon is a gigantic flying hostile boss mob found when first entering the End. She is the largest naturally spawning mob in the game and is widely acknowledged as the final boss of Minecraft.

Initial spawning
The Ender dragon spawns 20 ticks after an entity first arrives in the End, along with the bedrock frame for the exit portal.

Re-summoning
Players can re-summon the Ender dragon by placing four end crystals on the edges of the exit portal, one on each side. When the dragon is re-summoned, the four end crystals point to the tops of each pillar setting off a series of explosions that resets the obsidian pillars, iron bars, and end crystals. The top of each pillar explodes, destroying any player-placed blocks. Eventually, all of the end crystals point at the corner of (0, 128, 0) and the Ender dragon spawns there. The four crystals placed around the exit portal then explode. If the player does not pick up the dragon egg and starts to re-summon the dragon, the dragon egg disappears.

If a dragon goes through an End gateway, another immediately spawns at (0, 128, 0 ) while the other dragon fly to ( 0, 128, 0 ).

Drops
After the Ender dragon is slain for the first time, the following events take place:
 * She slowly ascends, her wings and body becoming more tattered until she disappears in beams of light erupting from her center.
 * There's an explosion of 12,000 experience points (ten drops of 960 and one drop of 2400) &mdash; enough to bring a player from level 0 to level 68.
 * The bedrock structure fills in with an End portal interface to become the exit portal, enabling the player to transport back to the Overworld and respawn at their spawn point.
 * A dragon egg appears above the island's central bedrock structure. If a block exists right above the center of the central bedrock structure, then the dragon egg spawns 1 block above the highest block at (0,0). If the highest block is at the height limit, then the dragon egg does not spawn.
 * An End gateway portal is generated floating within 75–100 blocks of the exit portal.

When a re-summoned Ender dragon is slain, the same events occur except that only 500 experience points are dropped and no more than 20 gateway portals are generated. The dragon egg appears the first time the Ender dragon is slain in Java Edition, and the first and second time in Bedrock edition; it does not appear after any following dragon slaying.

Behavior
During the battle with the Ender dragon, unique music called "Boss" plays. This happens for as long as the player fights the dragon, except when there is no player within 190 blocks from (0, 128, 0).

The Ender dragon has a light purple health bar that appears at the top of the player's screen. Her health is frequently restored by nearby End crystals, indicated by a magical white beam connecting the dragon and the crystal. Destroying an End crystal that is actively healing the dragon causes damage to her.

The dragon can take damage only from explosions and player based damage, and takes damage of ($1/4$ × normal damage + 1) when hit on any part that is not her head, making her the most resilient mob in the game. Suffocation is completely non-applicable, as she either phases through or immediately destroys any block she touches.

The dragon is immune to all status effects.

By using the shortcut, the dragon's bounding box appears. She cannot be damaged at just any spot in this large volume: eight green sub-hitboxes are also shown, which indicate the locations where the dragon can take damage: The tail, body, head, and wings.

Movement
The Ender dragon is a flying mob, which cannot actually stand on the ground. She flies around the end main island while fighting the player.

The dragon can pass through all blocks, destroying almost all types, but can still be affected by flowing water, lava and bubble column. Blocks not destroyed are those that naturally generate on the central End island and those that are intended to be indestructible, except for crying obsidian and respawn anchors:

$$, these blocks are marked under the tag.
 * Command Block
 * End portal (block)
 * End gateway (block)
 * End portal (block)
 * End gateway (block)
 * End portal (block)
 * End gateway (block)
 * End gateway (block)

Destroyed blocks are not dropped, although containers (such as chests and dispensers, but not shulker boxes) drop their contents.

Attacking


The dragon never targets any entity but the player. Other mobs may turn hostile to the dragon when struck. Any entities hit by her wings are dealt damage (or  damage if hit by her head), and in Java Edition, are thrown into the air, sometimes to fatal heights or even off the island. Neither of these effects is applied for $1/2$ second after the dragon takes damage.

The Ender dragon has four main states of behavior:


 * Guarding
 * The dragon begins in this state, circling the ring of obsidian pillars on either the outside if there are still End crystals or the inside if the crystals are destroyed.
 * With each crystal's destruction, she takes damage and there is an increased chance of the dragon switching states.


 * Targeting
 * Whenever the dragon finds herself less than 10 blocks or more than 150 blocks from her current target, she attempts to choose a new target. When damaged she targets a point just behind herself, causing her to turn away and choose a new target.


 * Strafing
 * Upon the destruction of an End crystal, the dragon switches to strafing. As soon as she is within 64 blocks, she shoots a fireball at the player.
 * The dragon resumes circling after this state.


 * Diving
 * The dragon dives onto the target player's position, taken at the start of the dive.
 * The dragon resumes circling after this state, whether or not she actually hit the player.


 * Perching
 * While Guarding and the dragon has reached the end of the path, she has 1 in (3 + crystals alive) chance (~7.7% up to 33%) to go to the exit portal structure (approaching from the side opposite the player if possible) and lands on the highest block of the coordinates (x=0, z=0), up to (y=101). If there is no block in (x=0, z=0) the dragon freezes right when she switches to perching. The dragon is immune to arrows in this state; they all catch fire and bounce off. $$ she is also immune to thrown tridents in this state.
 * Dragon's Breath
 * Unless the player is in Peaceful difficulty, after 1.25 seconds, if a player is within 20 blocks of the exit portal structure, the dragon roars and use her 3-second breath attack, damaging players similarly to a lingering potion of Harming. An area of visible particles in the shape of a horizontal disc one block tall and 5 to 6 blocks in diameter appears where the breath attack strikes, either on the ground or floating in the air, at whatever point the breath attack struck a block. The harming effect zone where the player will take damage is confined to a smaller area in the center this visible cloud, covering about 3 to 4 blocks.
 * The harming effect portion of the purple clouds emitted from the dragon's breath attack can be collected in a glass bottle to obtain dragon's breath. Each bottle of dragon's breath collected removes one block from the lingering damage zone of the breath attack. The visible clouds remain for 3 seconds whether the dragons breath is bottled or not. By rapidly collecting all of the harmful blocks, usually around three, even a direct hit from the breath attack can be mostly and even entirely negated before the player suffers any damage.
 * Charge
 * If the player is not near the portal within 5 seconds of the dragon's landing, she charges at players within 150 blocks.
 * Take-off
 * After four consecutive breath attacks, or if the dragon fails to locate a player within 150 blocks, she takes off from her perch. She always takes off in Peaceful difficulty, making it difficult to land melee hits.
 * The dragon resumes circling after this state.
 * Escape
 * If cumulative damage taken while perched exceeds, the dragon takes off and resets the damage accumulator. The accumulator is not reset if she does not take enough damage.
 * The dragon resumes circling after this state.

When the dragon finally takes a fatal blow, she flies toward the exit portal structure before dying, unless she cannot find it within 150 blocks, or it is inside blocks.

Dragon Fireball
Dragon fireballs are special fireballs that the Ender dragon fires while strafing. They cannot be deflected unlike ghast fireballs, and they do no impact damage. Instead, they deposit purple effect clouds across the ground that damages players the same way a lingering Potion of Harming does. This means that the ender dragon's fireballs deal magic damage, which ignores any damage reduction that comes from the player's armor. However its damage does get reduced by armor enchanted with the Protection enchantment.

As with her close-ranged breath attack, the purple clouds can be bottled to obtain the dragon's breath.

ID




Entity data
Ender dragons have entity data associated with them that contain various properties.


 * See Bedrock Edition level format/Entity format.
 * See Bedrock Edition level format/Entity format.



Dragon fireballs have entity data associated with them that contain various properties.



Command details
The command, by default, summons a harmless Ender dragon that hovers in place. Setting the  tag (by issuing either the  or the  commands) starts the Ender dragon's ordinary behavior, although the health bar does not appear because it is managed by the End's dragon fight status rather than by the dragon entity herself. If spawned away from the center of the map (x=0, z=0), she flies to the center then resumes normal behavior (see ).

Target selectors for the Ender dragon target a total of 9 entities per dragon, as the Ender dragon actually consists of 9 entities internally. So executing at a dragon to summon an arrow summons 9 arrows.

Trivia

 * Health depletion effect of The Void does not affect ender dragons.
 * If low enough on health, the ender dragon emits beams of light without dying, as if she cracked.
 * Name tags cannot be used on an ender dragon.
 * The ender dragon's hitbox is larger than the ender dragon herself, causing players to be pushed away from her.
 * If the player kills a summoned dragon in the Overworld or Nether, she does not create a portal or an egg.
 * In Spectator mode, the player cannot view the perspective of the ender dragon, unlike any other mob. However, it is possible through the use of commands (like ). When this happens, the player's camera appears about 1 block over the dragon's body.
 * Using F3+B to show hitboxes reveals that the ender dragon's head rotation faces in the opposite direction to where her real head faces. This is also why the ender dragon faces the wrong way when set in a monster spawner.
 * When an ender dragon is spawned in the Overworld, she flies to coordinates x=0 and z=0 and dives at the ground or does the same behavior as if in the End. If end crystals are placed in the Overworld, they heal the dragon as normal, but she does not perch anywhere, and continues to fly around forever.
 * $$, there is an unused texture file for a dragon fireball item.
 * In Super Smash Bros. Ultimate, one of the spirits that comes with the Steve/Alex DLC is the ender dragon. She appears as a Legend-class "spirit" that makes the user breathe fire for a long time at the start of each battle.
 * A wither that is summoned to battle the ender dragon cannot deal damage because the ender dragon flies too fast, and she is immune to projectiles when perching.
 * If commands or creative mode are used to get end portal frames and eyes of ender, a player can basically skip to the end poem.
 * If a player destroys ender crystals or even hurts the dragon and then uses a player-made portal, upon returning, the player retains their progress.

Notch-related

 * On Reddit, Notch referred to the ender dragon as a she and suggested her name to be "Jean?" in the same manner he called the player "Steve?".
 * Dinnerbone later stated that he thinks the name is officially "Jean?".
 * The Xbox avatar item Ender Dragon Pet has the description "A cuter, friendlier version of his bigger, less playful Minecraft sister" - confirming that the ender dragon is female.
 * Before she was textured, Notch reported that he was afraid to texture the ender dragon as she was a complicated model. In the end, the dragon model was so complex Notch stated that he gave up making the texture manually and wrote a texture packer tool to aid him in adding the texture to the model. Notch also uploaded the code for the tool so others could use the pack. (Link to the texture packer)
 * Notch joked about how Minecraft was "going next-gen" when deadmau5 mentioned this.
 * Notch has uploaded a video showing why ender dragons do not spawn in the main world, as they would destroy any block they touch.
 * On Reddit, Notch explained that ender dragons destroy Overworld matter because "trying to make an AI to properly navigate arbitrary terrain before the code freeze next tuesday [sic] isn't feasible".