Cake is not counted as something to eat in 'A balance diet' advancement.
Linked issues
is duplicated by 4
Comments 9
This works as intended. Cake is a type of food that can be placed as a block and eaten from. It is not technically a food item because you can't eat it straight out of your hand. As such, it does not count towards a balanced diet. Now, should it? Yes, it should. It would be logical for it to count because, by the advancement's description "eat everything that is edible, even if it's not good for you", this would be the same for cake, because it is edible.
Can confirm for MC 1.12.1.