Moon Lord

The  is the final boss of the Celestial Event, and is also implemented as the Final Boss of Terraria. To summon the Moon Lord, the four Celestial Pillars must be defeated (Nebula, Solar, Stardust, Vortex). After the final pillar is destroyed, the words "Impending doom approaches..." appear at the bottom left of the screen. The screen will then begin to vibrate periodically with fading vision. All sound effects are also dimmed. After a while, a white flash will appear unveiling the Moon Lord. All backgrounds are instantly reduced to blackness and the sun will disappear, effectively making it permanent night until the fight ends. Note that it will not leave until the player wins or dies, even when teleporting long distances. Defeating the Moon Lord rewards the player with the Champion of Terraria achievement, and drops a random weapon from the relevant pool, plus some Luminite used for endgame items and armor.

Attack Pattern
The boss has 3 sections (2 hands and the head) that must be killed by attacking the eyes in the center before its core is exposed. Killing the core will defeat the boss. The eyes can only be damaged when they are opened, and they only open when attacking.

The central head eye (45,000hp) will open only occasionally to unleash a very powerful Phantasm beam that will sweep partly across the screen in the player's direction, doing massive damage. After the beam finishes, the eye will shoot several homing projectiles before closing again.

The eyes (25,000hp each) on both hands will be open most of the time as they are regularly churning out attacks. They will release homing missiles that chase after the player that do moderate damage. They will also summon large, invulnerable eyeballs and fling them at the player, doing moderate damage.

When an eye "dies" it will leave the hand/head as an invulnerable True Eye of Cthulhu. The True Eye will hover around the Moon Lord, releasing a variety of attacks that do moderate to high damage. All True Eyes of Cthulhu are identical, regardless of whether they spawned from the hand or head. Only when 3 True Eyes of Cthulhu are present (i.e all body parts destroyed) will the 50,000hp Core be exposed.

Throughout the fight, the Moon Lord will regularly extend a "tongue" that latches onto nearby players. It will then drain the player's life (the player does not lose health) in the form of white particles that travel along the tongue. The particles are destructible and if a particle successfully reaches the Moon Lord, one of its body parts will regain 1,000hp. The Moon Lord will drain 3 particles before stopping. As of 1.3.0.3, the Moon Lord will place the Moon Bite debuff on players when leeching them, causing them to be unable to regain health from weapons, such as from Vampire Knives.

General
It is usually a good idea to destroy the central head eye first. Firstly, the phantasm beam attack it uses can do over 100 damage even with high armor, although it can be dodged. Secondly, in general, the attacks from the True Eyes of Cthulhu are more dangerous than if they were left as the hands, as they do higher damage. It can be very difficult to survive both the attacks from the True Eyes while dodging the Phantasm Beam. Hence, destroying the hands before the head can leave players in a difficult situation.

Destroying the leeching particles should also be a top-priority as the boss can heal at a very fast pace with them. They are relatively easy to destroy.

If a player can obtain a UFO mount from a Cosmic Car Key or Shrimpy Truffle before the boss fight, it can make the fight much easier due to the unlimited flight it provides.

It is possible to obtain a higher speed than the Moon Lord itself, allowing players to kite it around the map while staying out of range of some of its attacks while pelting it with ranged weapons (tested with Beetle Armor, Spectre Wings, Frostspark Boots and a Cosmic Car Key)

Melee
Melee classes can be difficult to use against the Moon Lord, as the eyes generally stay out of the player's reach. However, melee weapons with a long range (such as spears) or shoot projectiles (like the Influx Waver) can serve as a good weapon. The Solar Eruption is the most effective melee weapon that is also easily obtainable before the Moon Lord fight, taking 18 Solar Fragments to craft with Solar Pillars dropping 25 at minimum. It has a very high damage-per-second and can be used from behind cover since it pierces through walls. This lets you avoid most of the Moon Lords attacks while still being able to damage him heavily in return.

(NOTE: Vampire Knives are not suitable as of 1.3.0.3, as the Moon Bite debuff makes the knives virtually useless as they cannot lifesteal.)

Drive-By like it's 1996 Approach (Ranged)
This strategy is possibly the easiest, but requires a great deal of preparation and patience, and several stacks of Chlorophyte Bullets. A Mechanical Cart is also strongly recommended, and essential when employing this strategy in Expert Mode. Armor should be Beetle Armor (with the Beetle Shell), or if Moon Lord has been beaten a few times already, the Solar Flare Armor, or Vortex Armor. Shroomite is acceptable if not in Expert mode. Chain Gun, Megashark, or Vortex Beater are the weapons of choice. If the player doesn't have enough Chlorophyte ammunition, make Crystal Bullets (area damage) or the most damaging bullets possible. Don't bother with a bow.

Accessories should all be forged to Warding. Bonuses to speed do not affect minecart travel.

To set up the Arena, make an above-ground cart track that runs at least two full screen lengths. The longer this track is, the better. At each end, create a "bumper" ending with a hammer. Then, go along the track and place platforms at eye level. This will serve as a platform for all of the Heart Statues, Star Statues, Campfires, and buff givers. The more statues the better. Wire the statues up to a 3 Second Timer or better.

Optionally, there can be row of blocks periodically above the track to serve as cover from the Moon Lord's beam attack, so long as there is a way to attack him back. Another variant is to use Pressure Plate Track with Teleporters to create a multi-level track arena to dodge in and out of cover, or at each end of the track to keep the movement direction constant.

The fight will consist of running away at top speed in the minecart and shooting backward and upward as the Moon Lord tries to catch up. When the cart hits the bumpers on the end of the track, the cart continues at the same speed in the other direction, freeing the player to concentrate on DPS and their own health. Using Chlorophyte ammunition gets the best results, as the Mechanical Cart travels 102mph at top speed, and the Moon Lord will teleport in largely off-screen behind the player. This method can take a long time, but as the player will stay out of range of most enemy attacks and only occasionally need to heal when hit by the eyebeam, it is one of the easiest.

Fight, Warp, Nurse, Repeat.
First you need to make sure your Nurse is near your spawnpoint. Then you do everything as normal, keeping the Moon Lord away from your spawnpoint, and only teleporting back if you can't use a potion and need to heal badly (for example, having 100 health and no potions). No matter how far you travel, the Moon Lord NEVER despawns. This will allow you to heal yourself in emergency cases and use your Nurse more often.

If you're on normal mode, you should teleport when you reach 200 or 250 health. In expert mode, that can up to 300 hp.

 Only Working pre 1.3.0.4!

Trivia

 * This boss bears resemblance to Cthulhu, the deity created by H. P. Lovecraft.
 * The Moon Lord's brain appears to be a Brain of Cthulhu similarly colored to Ocram from the console and mobile version.
 * It was confirmed by Cenx, that the Moon Lord is Cthulhu's brother. (He may be Hastur, Cthulhu's half brother in Eldritch mythology.)