From the Super Mario Wiki
Jelly Ghosts are entities made entirely of jelly. They appear in Yoshi's Story, in the stage Jelly Pipe. They usually hide in the Jelly, and will come out when one of the Baby Yoshis come near, and will hurt the Yoshi if they touch them. They thrive in the jelly on ceilings or floors and can be defeated if Yoshi Ground Pounds them; they also come in three different colors: Blue, Magenta, and Cyan.