Super Mario 64 / Super Mario 64 DS
The three power-up caps in Super Mario 64 give Mario certain special abilities:
Mario's Cap can be stolen by Klepto and Ukkiki, or blown away by a Fwoosh or the giant Snowman in Snowman's Land. When Mario does not have his cap and takes a hit by an enemy or a hazard, he will lose an additional power wedge to how much power wedge(s) he will lose (for example, if Mario, without wearing his cap, takes damage from an enemy that causes him to lose two power wedges, he will lose three power wedges). When lost, Mario's Cap can be found by grabbing Ukkiki, attack Klepto, or simply just pick it up if no enemies stole it. If the cap is blown off by Fwoosh in Tall, Tall, Mountain, the player has to exit the course and return to it and grab Ukkiki wearing Mario's cap. This only applies to the Nintendo 64 version of this game.
In Super Mario 64 DS, the various characters' caps appear instead and serve a new function. Grabbing a cap allows whomever possesses it to change his appearance and abilities (however, his voice will remain unchanged). If a character (besides Yoshi) loses his cap, short-fused Bob-ombs will pop out of ? Blocks instead of power-ups, in addition to the original game's defense penalty. If the character without his cap takes damage from an enemy or hazard that takes one power wedge, he will lose one power wedge on the first hit, then lose two power wedges on the second hit and the process repeats. In the early portion of the game, those kinds of caps also act as 1-Up Mushrooms. For example, if Yoshi wears Mario's Cap and takes another one, he will be awarded with a 1-Up. However, as Yoshi frees Mario, Luigi, and Wario, redundant caps will be replaced with ones of a different color and it will be impossible to find two caps of the same color, except during Bob-omb Battlefield's second mission: Footrace With Koopa The Quick, where one extra Mario cap is still present. Yoshi can choose to wear the caps of whatever characters were rescued before entering a course. If the character, along with his own cap, is blown off, this time he will need to retrieve it from the enemy who is wearing it.
Super Mario Sunshine
In Super Mario Sunshine, the Swipin' Stu enemy can steal the Mario Cap. If Mario does not get back his cap, his energy will slowly drain until he dies, due to it being so hot (standing in the shade has no effect). Along with wearing his cap, it gains a Mario-esque mustache. This design is later used for the captured enemies in Super Mario Odyssey.
Super Mario Odyssey
In Super Mario Odyssey, Cappy can take the forms of many different caps that Mario can wear. These caps can be thrown to hit blocks and enemies, capture certain characters or objects, and be used as a temporary jumping platform for Mario (among other uses). All caps are aesthetic and have identical abilities (excluding access to certain areas).
Name in other languages