Hunger in Minecraft is a dangerous, long-term obstacle — try to overcome it as efficiently as possible, which ultimately means gathering as many animals together in an area you control through farming. But you have to eat while you create farms and overcome obstacles, not to mention nightly mob attacks.
As depicted by the Hunger bar at the bottom of the screen, you get hungry over time, and you require food in order to resolve it.
In Peaceful mode, the Health bar doesn’t deplete from your hunger, so you can continue to the next challenge without acquiring or eating food. However, you cannot move quickly (by sprinting).
Eating food restores your character’s health (as depicted by the hearts on the Health bar) indirectly over time, so keep at least nine out of ten units on the Hunger bar. Though your character never dies from hunger except in Hard mode, it makes you vulnerable to damage that can kill you, including relatively small damage such as touching a cactus, falling from a four-block height, or even facing attacks from neutral mobs.
If hunger is significantly limiting gameplay, you can switch to Peaceful mode or Easy mode while you start a farm.
Your symptoms of hunger depend on the difficulty level. Except in Peaceful mode, your character grows hungrier by taking action: Sprinting (by double-tapping W) is the easiest way to deplete hunger units, but jumping or absorbing damage also taxes your character.
You cannot sprint if the Hunger bar has three units or fewer. The consequence of famine (as depicted by an empty Hunger bar) depends on the current difficulty level.
To refill the Hunger bar, you need to acquire and eat food.
If you’re playing in Minecraft PE, you do not have the Hunger bar. Instead, to restore health, you can eat food or sleep in a bed. Also, the game has no poisonous foods.