The Devourer of Gods is a giant post-Moon Lord Calamity Mod worm. How to craft the Cosmic Worm, read its three modes, survive the final phase and its drops.
The Devourer of Gods is a post-Moon Lord boss from the Calamity Mod for Terraria. You summon him by using a Cosmic Worm, which works anywhere and at any time.
He is a gigantic cosmic worm and one of the biggest walls in the mod. You can craft the Cosmic Worm right after Moon Lord, but you should beat the three Sentinels and Polterghast first. His Cosmilite Bars unlock the Cosmic Anvil and the last tier of gear.

Notable drops:
There are two recipes, both at a Mythril Anvil or Orichalcum Anvil. The usual one uses one drop from each Sentinel:

The other recipe skips the Sentinels: 40 Luminite Bars, 10 each of Solar, Vortex, Nebula and Stardust Fragments, 10 Meld Blobs and 40 Necroplasm. It lets you fight him early, but without the Sentinel and Polterghast gear the fight is much harder.
Build the longest arena you can, with several rows of platforms 40 to 60 blocks apart. You need room to run sideways and to fly up and down. If you plan to fly away from him in long loops, clear the Floating Islands and Planetoids above the arena. Add Campfires, Heart Lanterns and a Bast Statue.
The Devourer of Gods has 750,000 health in Classic, 1,200,000 in Expert, 1,440,000 in Revengeance, 1,530,000 in Master and 1,836,000 in Death Mode. His body segments take very little damage, so aim for the head and tail. His bite inflicts God Slayer Inferno.
He cycles through three modes, and the background color tells you which one is active:
He speeds up at 92%, 84%, 76% and 68% health, and below 75% he spits aimed fireballs in the passive mode. If you get more than 150 tiles away, he switches to the aggressive mode to catch you.
At 65% health he flies into a portal and comes back stronger. Each cycle now ends with him lunging at you out of an Ultracosmic Maelstrom portal and leaving rings of fireballs. An arrow on screen points to the portal, so move away from it and dodge the lunge sideways. Only his head can be hit for a few seconds after each lunge.
At 25% health every laser wall also comes with a huge beam aimed straight at you, and he lunges out of a portal three times in a row. Keep moving and save your potions and Rage for this part.
At least one of these six weapons always drops, each with a 25% chance in Classic and 33.33% in Expert:
He also drops 65 to 80 Cosmilite Bars (75 to 90 in Expert), 155 to 265 Cosmilite Bricks and 5 to 15 Omega Healing Potions. Cosmic Discharge drops at 10% and the mask at 14.29%. The Expert Treasure Bag holds the Nebulous Core.

The Pumpkin Moon, Frost Moon and Solar Eclipse get harder, and their enemies start dropping Nightmare Fuel, Endothermic Energy and Darksun Fragments. You can now craft at the Cosmic Anvil, the Bandit sells the Venerated Locket and the Murasama can finally be swung.
For the next Calamity boss, see How To Summon Yharon. For the boss before this one, see How To Summon Polterghast, and for the optional fight in between, see How To Summon The Old Duke.