YOU SAID:
When I like to eat food I like to have ice cream
INTO JAPANESE
食べ物を食べるのが好きなときはアイスクリームを食べるのが好きです
BACK INTO ENGLISH
When I like to eat food, I like to eat ice cream
INTO JAPANESE
食べ物を食べるのが好きなときは、アイスクリームを食べるのが好きです
BACK INTO ENGLISH
When I like to eat food, I like to eat ice cream
That didn't even make that much sense in English.