Boss battles are one of the most exciting things about Terraria. However, some bosses are rare and can only be summoned via a special item under special conditions. The hardmode bosses in particular are hard to summon and harder to defeat.
The Mechanical Worm is used to summon The Destroyer, a hardmode boss. The Destroyer looks like the hardmode cousin of the Eater of Worlds.
Terraria: How to Get and Use Mechanical Worm
To craft a Mechanical Worm, you will need 5 Iron Bars of any kind, 6 Souls of Nights, and 6 Rotten Chunks. The 6 Rotten Chunks can be replaced by 6 Vertebras. Now, you can use the Mythril Anvil or Orchicalcum Anvil to put together all the items and get the Mechanical Worm.
Interestingly, if you are in the Hardmode world and The Destroyer hasn’t been beaten, there’s a slight chance that a boss might drop a Mechanical Worm.
Once you get the Worm, you can use it only at night. Consuming it during the day is completely futile.
If you have a Mechanical Worm, you can summon The Destroyer in the Pre-Hardmode world. You can also use the summoning item outside The Corruption.