If the target creature is an illegal target as Mjölnir’s last ability triers to resolve, it won’t resolve and none of its effects will happen. No opponents will be dealt damage.

Artwork
Loading artwork…
Mjölnir, Storm Hammer
Assassin's Creed · #258 · EN
Nonfoil—Foil—Etched—
Card rules
When Mjölnir enters, attach it to target legendary creature you control.
Whenever equipped creature attacks, tap target creature defending player controls and put a stun counter on it. Then Mjölnir deals damage to each opponent equal to the number of tapped creatures that opponent controls.
Equip 4
Rare · Illustrated by L J Koh
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
PreDH Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions