Ender Dragon

The ender dragon is a versatile boss mob that appears in the End, and is the first boss mob to be added to Minecraft.

Initial spawning
A single ender dragon spawns naturally in the End, immediately as the first player enters the dimension. It will spawn on any difficulty, including Peaceful, but will be unable to directly harm a player with its body in Peaceful difficulty (although it does still fire Ender charges at the player in Peaceful difficulty).

Respawning
Players can re-spawn the ender dragon once the fight is completed, by placing four, or fewer, ender crystals atop the exit portal, one on each side.

Commands
The command, by default, summons a harmless ender dragon that hovers in place. Setting the  tag, for instance by issuing, will create a normal ender dragon, though with no health bar since the bar is managed by the End's dragon fight status rather than by the dragon entity itself.

Drops
Once defeated, the ender dragon will slowly ascend and begin to appear tattered, while having beams of light spontaneously erupting from its body. It will then explode, dropping enough experience to bring a player from no experience to level 78 (12000 - 10 drops of 960 experience, one drop of 2400 experience). Subsequent ender dragons (ones re-spawned via the ender crystals) only drop 500 experience.

It will also activate the exit portal, and drop a dragon egg onto the top. This portal is found at X=0 and Z=0, at the Y-coordinate of the surface of the island. The dragon egg is only dropped by the first dragon, and never by subsequent dragons.

Behavior


The dragon has four main states of behavior:


 * Circling - the dragon begins in this state. When circling, the dragon will circle outside the ring of pillars if ender crystals remain, or inside the ring of pillars if not. With increasing chances as crystals are destroyed it will land on the empty portal or strafe a player within 64 blocks of the portal.
 * Strafing - the dragon will fly towards the target player. When it is within 64 blocks, it will fire ender charges and resume circling. If a players destroys an ender crystal, the dragon will immediately switch to this state to fire an ender charge at them.
 * Charging - the dragon will fly rapidly towards the target player's position at the start of the charge, then resume circling whether or not the player was actually hit.
 * Perching - the dragon flies towards the empty portal (approaching from the side opposite the player, if possible) and lands on the highest block of (X:0,Z:0). The dragon is immune to arrows in this state; if the player attempts to hit the dragon with arrows, the dragon will immediately charge at the player. After 1.25 seconds, if a player is within 20 blocks of the portal, the dragon will roar and use its breath attack for 3 seconds, which damages players similarly to a lingering Potion of Harming. If no player is near enough to the portal within 5 seconds, the dragon will charge at a player within 150 blocks. After four consecutive breath attacks, or if it does not find a player within 150 blocks, the dragon will take off and begin circling again. When cumulative damage while landed exceeds, it will take off to start circling, and reset the damage accumulator. The accumulator is not reset if the dragon does not take enough damage.

The purple clouds emitted from the ender dragon's breath attack can be collected in an empty bottle to obtain Dragon's Breath.

Whenever the dragon finds itself less than 10 blocks or greater than 150 blocks to its current target, it will attempt to choose a new target. When damaged it will target a point just behind itself, causing it to turn away and choose a new target.

The dragon is not hostile towards any other entities except the player. However, other mobs may turn hostile to the ender dragon if struck. Any entities hit by the dragon's wings will be dealt damage ( damage when hit by its head) and thrown into the air, sometimes to fatal heights or even off the island. Neither of these effects are applied for $1/2$ second after the dragon takes damage.

If it takes fatal damage, the ender dragon will fly to within 10 blocks of the portal before actually dying, unless it is over 150 blocks away or inside blocks. When the dragon is respawned, a series of explosions resets the obsidian pillars, iron bars, and ender crystals.

The dragon can pass through all blocks, destroying most types. Blocks not destroyed are those that naturally generate on the central End island and those that are intended to be indestructible: The ender dragon has a light purple health bar that appears at the top of the player's screen. Its health is periodically healed by nearby ender crystals, indicated by a white beam connecting the dragon and the crystal. Destroying an ender crystal while the ender dragon is being healed by it will cause the ender dragon to take damage. The ender dragon can only take damage from explosions and player based damage. The ender dragon takes $1/4$ normal damage when hit in any part that is not its head. The dragon does not take damage from snowballs, eggs, or other attacks that normally deal no damage. Suffocation cannot be used, as the ender dragon will destroy almost any block it comes into contact with and doesn't take suffocation damage from blocks that it cannot destroy.
 * Command Block
 * End portal (block)
 * End gateway (block)
 * Command Block
 * End portal (block)
 * End gateway (block)
 * End portal (block)
 * End gateway (block)
 * End gateway (block)

By using the shortcut, the dragon's bounding box appears, though the dragon can not be damaged at just any spot in this large volume. Eight green hitboxes also appear, which indicate the locations on the dragon where it can be damaged: at the tail, body, head and wings.

Ender charge
The ender dragon will periodically fire ender charges while strafing. Ender charges are special fireballs that cannot be deflected, and do no damage on impact, except that they emit purple clouds similar to a lingering Potion of Harming II. Like the dragon's close-ranged breath attack, these clouds too can be collected in a bottle to obtain Dragon's Breath. In Console Edition, charges come from the sky rather than the dragon itself.

Fireballs fired by ender dragons also have entity data associated with them that define various properties of the entity. Their entity ID is.

Data values
Ender dragons have entity data associated with them that contain various properties of the mob. Their entity ID is.

Trivia

 * Name tags cannot be used on an ender dragon.
 * The ender dragon's hitbox is larger than the ender dragon itself, causing players to be pushed away from it.
 * If you kill a summoned dragon in the Overworld or Nether, it will not create a portal, nor an egg.
 * In spectator mode, you cannot view the perspective of the ender dragon, unlike any other mob.
 * Using F3+b to show hitboxes reveals that the ender dragon's head rotation faces in the opposite direction to that which its real head faces. This is also why the ender dragon faces the wrong way when set in a monster spawner.
 * Ender dragons, when spawned in the Overworld, will fly to coordinates x=0 and z=0 and dive at the ground.
 * From 1.9 onwards, Ender dragons, when spawned with, will look down, become invulnerable and stay stationary.

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.'- revealing that the ender dragon is female.
 * Before it was textured, Notch reported that he was afraid to texture it as it 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.
 * Notch joked about how Minecraft was "going next gen" when deadmau5 mentioned this.
 * Notch has uploaded a video showing why ender dragons will not spawn in the main world, as they would destroy any block they come into contact with.
 * On Reddit, Notch explained why ender dragons destroy matter.