a night that happens during the day
A solar eclipse takes an entire day, 4:30 AM to 7:30 PM, and drops the light level below what you get at midnight. The sun is up, it is simply covered. Sleeping will not skip it, the same way it will not skip a blood moon, and no amount of killing ends it early. You either fight for fifteen in-game hours or you leave.
Leaving means going down. The event only touches the surface, so the underground is a normal day. Note that its spawn boost cancels out the calming effect town NPCs usually provide, even below ground, so a locked room in the middle of your town is not a hiding place.
when it can happen
The first requirement is one dead mechanical boss. After that it is a one in twenty roll at each dawn, with nothing preventing two or three in a row, and nothing preventing a blood moon that same night. Other events run alongside it happily: a goblin army or pirate invasion can share the day.
If waiting is not appealing, a Solar Tablet summons one directly. The tablet is normally a Jungle Temple prize, but there is an earlier route: Lihzahrds that spawn outside the temple walls drop Solar Tablet Fragments, and those plus a hardmode anvil produce a tablet without ever opening the temple door. You still cannot use one before hardmode. Going the other direction, an Enchanted Sundial skips an eclipse you did not want.
the roster changes as you progress
Early on it is Frankenstein, Swamp Thing, Vampire, Fritz, The Possessed, Creature from the Deep and Eyezor. Dangerous as a crowd, manageable one at a time. Reapers join after Plantera and are fast enough to be a real problem on their own.
The arrivals that change what an eclipse is worth are all post-Plantera. Mothron is the reason most people summon one at all. Butcher, Psycho, Nailhead, Dr. Man Fly and the Deadly Sphere round out the late list with weapon drops of their own.
the drop that matters
Broken Hero Swords come from Mothron and from nothing else in the game. You need one for True Excalibur, one for True Night's Edge and a third to fuse those into the Terra Blade. That is three successful eclipse farms at minimum, which is precisely why the summoning tablet exists.
The rest of the table is worth knowing: the Death Sickle from Reapers, Mothron Wings, the Butcher's Chainsaw, Deadly Sphere Staff, Psycho Knife, Nail Gun and Toxic Flask. Vampires carry the Moon Stone and the Broken Bat Wing, which pair into the Amulet of the Night.
farming one properly
Unlike the moon events, spawn-boosting consumables work here. A Water Candle and a Battle Potion stack on top of the event's own elevated rate, which matters a great deal when the item you want sits in the low single digits of a percent.
Banners are the other half of the setup. Almost everything in this event does its damage on contact, and an enemy banner cuts the damage that specific enemy deals to you while raising what you deal to it. A wall of eclipse banners in your arena shifts the fight more than an armor tier would.
Truffle Worm spawns also rise during an eclipse, since the game files them as enemies. If you are short on Duke Fishron summons, an eclipse spent in a glowing mushroom biome is not a wasted day.
trivia
Every enemy in the event except the Reaper and Eyezor references twentieth century horror cinema, which is why the roster reads like a video rental shelf. The eclipse the game draws is an annular one, where the moon covers the middle of the sun and leaves a bright ring around it. Real annular eclipses are rare enough that the in-game version happens on the order of a thousand times as often. One more enemy was designed and cut, a severed crawling hand, on the grounds that nobody would be able to see it in a fight this busy. Its banner is still in the files and cannot be obtained.

