From the Super Mario Wiki
Retrieved from "https://www.mariowiki.com/index.php?title=Metal_Cap&oldid=2130720"
The Metal Cap is an accessory that makes its debut appearance in Super Mario 64. It is usually found in Metal Boxes. The Metal Cap can turn Mario into Metal Mario, which makes him invulnerable and extremely heavy. The side effects of this temporary invulnerability are that he can no longer make very high or long jumps, cannot swim, and will sink faster in quicksand. Fortunately, while in metal form, Mario is also unaffected by toxic fog, and cannot drown; he also has access to extremely powerful Ground Pounds.
If Mario gets another power when the Metal Cap is in effect, they will combine; this is possible in Dire Dire Docks, where a Metal Box is located directly beside a blue ! Block, and in Wet-Dry World, where the player can drain the water in the Downtown area and collect the Metal Cap, then jump down and collect the Vanish Cap. Collecting both will give Mario the powers of both his Vanish and Metal forms. An unused texture in the game shows a metallic version of the wings from the Wing Cap, suggesting that it would've been possible to combine the Wing Cap with the Metal Cap as well.
In Super Mario 64 DS, the Metal Cap does not appear. Instead, Wario becomes Metal Wario when he grabs a Power Flower, but still retains the same properties as Metal Mario and the music from the Metal Cap is retained.