From the Super Mario Wiki
Elasto-Piranhas are a sub-species of Piranha Plant that have elastic stems which can extend and contract; they appear in the game Mario & Luigi: Partners in Time. This variety of Piranha Plant lives in Toadwood Forest.
In battle, an Elasto-Piranha attacks by first extending its elastic stem to the sky. To determine who it attacks, the neck stretches to the top of the top screen if it will hit Mario and halfway at the top screen if it will hit Luigi. Next, the Elasto-Piranha shoots fireballs at its chosen enemy. These fireballs can be jumped over which if not, it may cause the Burn status effect. Every attack that the player uses on the side of the pipe deals one damage to the Elasto-Piranha, however attacks such as jumping on the top of the pipe deals more damage. The height and ground position of an Elasto-Piranha continually varies throughout a battle, meaning the time it takes for a fireball to reach its enemy also changes. Any attack will work on these enemies with the exception of Bro Flowers, which will only do one damage to these enemies and they take critical damage from Ice Flowers.
Names in other languages