The player may lose health because the player's hunger bar has depleted. When this happens, the player loses 1 HP over time. The only way to counteract this is by eating regularly and thus not letting the hunger bar deplete.
For a list of all food items available in the game, see Category:Food.
Since it may be of one's interest not to die, one may eat food that may be collected from the world, dropped by enemies or animals, farmed, or fished. Every food refills a certain amount of hunger, which is indicated in the tool-tip.
Additional game mechanics