From the Super Mario Wiki
Egg Blocks are special blocks in the Yoshi series. The most common type is green; however, in Yoshi's Story, they are the color of the Yoshi the player is currently using. When one of the Yoshis hits this block, a Yoshi Egg will come out. Only a maximum of six Yoshi Eggs can come out from the green egg block until Yoshi uses one or more of them, as 6 is the maximum it can hold at once. Yellow and Red Egg Blocks turn into a Yellow Egg and a Red Egg, respectively.
 Square Egg