The Lunar Events start after the Lunatic Cultist and end with the Moon Lord. Here is how to break all four Celestial Pillars, what each pillar's enemies do and what the fragments make.
The Lunar Events in Terraria start as soon as you beat the Lunatic Cultist at the Dungeon entrance. Four Celestial Pillars appear across your world, and once all four are destroyed, the Moon Lord arrives about a minute later.
The game shows "Celestial creatures are invading" when the event starts. The Cultist also drops the Ancient Manipulator, the crafting station for every Lunar Fragment item.

The four pillars (Solar, Vortex, Nebula and Stardust) spawn at 20%, 40%, 60% and 80% of the world's width, in a random order. Each one has its own zone with a radius of about 250 tiles, where only that pillar's enemies spawn.
Each pillar starts with a shield. Kill 100 of its enemies (50 after you have beaten the Moon Lord once) to break the shield, then attack the pillar itself. Every pillar has 20,000 health and 20 defense.
| Pillar | Class | Enemies | Drops |
|---|---|---|---|
| Solar Pillar | Melee | Corite, Crawltipede, Drakanian, Drakomire, Selenian, Sroller | Solar Fragment |
| Vortex Pillar | Ranged | Alien Hornet, Alien Queen, Storm Diver, Vortexian | Vortex Fragment |
| Nebula Pillar | Magic | Brain Suckler, Evolution Beast, Nebula Floater, Predictor | Nebula Fragment |
| Stardust Pillar | Summoner | Flow Invader, Milkyway Weaver, Star Cell, Stargazer, Twinkle Popper | Stardust Fragment |
Note: Set up Teleporters or Pylons near each pillar before you kill the Cultist. The pillars are far apart, and flying across the world between them takes a lot of the event's time.
The Solar Pillar is the melee pillar and the most dangerous one on foot. Its enemies are Corites, Crawltipedes, Drakanians, Drakomires, Selenians and Srollers.
Crawltipedes are the biggest threat. They are long flying worms that chase you while you are in the air, and only their tail takes damage (10 times as much). Stay on the ground or a platform and they ignore you. Selenians reflect bullets, arrows and darts while they spin, so wait until they land.

The Vortex Pillar is the ranged pillar. Its enemies are Alien Hornets, Alien Queens, Storm Divers and Vortexians, and most of them fly or teleport.
Alien Queens are the first target. Their goop gives you the Distorted debuff, which flips your gravity, and when they die they release Alien Larvae that grow into Hornets and then more Queens. Kill the larvae right away.

The Nebula Pillar is the magic pillar. Its enemies are Brain Sucklers, Evolution Beasts, Nebula Floaters and Predictors.
Brain Sucklers latch onto your head, darken your screen with the Obstructed debuff and stop your health regeneration until you kill them. They even follow you through a Magic Mirror. Nebula Floaters teleport and fire strong lasers, so keep moving. A homing weapon makes this pillar much faster.

The Stardust Pillar is the summoner pillar. Its enemies are Flow Invaders, Milkyway Weavers, Star Cells, Stargazers and Twinkle Poppers.
Star Cells split into Mini Star Cells when they die. The small ones don't count toward the shield until they grow back into full Star Cells, so clear them with a piercing weapon before the screen fills up. This pillar is usually the easiest of the four.

Each pillar drops 12 to 60 of its own fragment in Classic, and 24 to 100 in Expert. Pillar enemies drop fragments too. You need them for the end-game gear:

The Lunar Hook needs 6 of each fragment, and it is the best hook for the Moon Lord fight. The armor and weapons also need Luminite from the Moon Lord, so most of them come after him.
You can fight the pillars in any order. These tips make the event faster:
After each destroyed pillar the game shows a message: "Your mind goes numb...", "You are overwhelmed with pain...", "Otherworldly voices linger around you..." and finally "Impending doom approaches...". After the last one, the Moon Lord arrives in 60 seconds.
You only need the pillars once. Afterwards, craft a Celestial Sigil from 12 of each fragment at the Ancient Manipulator and use it to call the Moon Lord, who appears 12 seconds later.

For the fight itself, see How To Summon Moon Lord. For the boss that starts the event, see How To Summon The Lunatic Cultist.