From the Super Mario Wiki
Ads keep the MarioWiki independent and free :)
Super Mario Galaxy / Super Mario Galaxy 2
Thorny flowers make their debut in Super Mario Galaxy and Super Mario Galaxy 2. They hurt Mario or Luigi when touched, and the only way to destroy them is by attacking them with a Stretch Plant, spinning a coconut into them, or having Yoshi eat them.
There are three types: the standard variant, a larger variant, and a floating variant. The larger variants, after being destroyed by a coconut, will reveal a Sling Star or Launch Star leading to another planet. The floating variants serve as obstacles in various areas, and are more common in certain galaxies, like the Gusty Garden Galaxy, the Yoshi Star Galaxy, and the Tall Trunk Galaxy.
When touched by the Co-Star Luma, thorny flowers will retract their spikes, allowing Mario or Luigi to pass over them safely without needing to destroy them.
Super Mario 3D Land
Mario Party: Island Tour
Mario Party: Star Rush