Hunger



Hunger is an aspect of Minecraft added in the Adventure Update that governs several aspects of gameplay. Instead of directly restoring the player's health as it did prior to the Adventure Update, eating food now fills up the food bar, which is constantly drained by the player's actions. The food bar is located opposite to the player's health bar on the bottom of the screen and is represented by ten shanks, which look like chicken legs and are equal to 2 half-units of food.

While the player is sprinting, the food bar depletes much faster. The player is not able to sprint if their food level is or less.

The food bar does not drain when playing on Peaceful mode. However, its effects on the player's health level remain, and switching difficulties has no effect on the Food Bar's current level. Thus, if the player changes the difficulty level to Peaceful while his or her Food Bar is empty, it will not restore his or her hunger level and the player will continue to starve while healing.

Certain foods have a chance of inflicting Hunger on the player upon consumption, which causes the player's hunger to deplete faster.

Effects

 * When the Food Bar is at points or above, the player's health will slowly regenerate at a rate of 1 health point every 4 seconds.  Note that as of version 1.6, each point healed will cost 3/4 food points (3 units of exhaustion)
 * If the Food Bar is at points or below, then the player will not be able to sprint.
 * When the Food Bar is at, the player's health will deplete at a rate of every 4 seconds (this makes sleeping impossible). On easy difficulty, the player's health stops dropping at , on normal it stops at , and on hard it keeps draining until either the player eats something or starves to death.

Food poisoning
Hunger, or food poisoning, is an effect induced by eating certain foods, which turns the food bar a sickly yellow-green and drains food more rapidly. The only foods, however, to inflict Hunger are rotten flesh, which can cause Hunger 80% of the time, raw Chicken, which causes Hunger only 30% of the time and Pufferfish, which will always cause Hunger (and normal poisoning too). Eating a spider eye or poisonous potato actually deals the player Poison. The rest of the foods will not cause food poisoning.

Behavior
Hunger from eating food lasts 30 seconds and adds 15.0 to the player's exhaustion level over the duration. This is slightly less than. In Peaceful mode, the food bar will change color, but will not drain out. Green-like swirls will also emit from the player, indicating that the player is food poisoned. When a pufferfish is eaten, it induces level III Hunger, but only for 15 seconds. In this time, 22.5 exhaustion points are added, and little less than is lost.

The duration of Hunger does not stack. So, if the player eats many poisonous foods at once, he or she will only feel the negative effects of the most recent poisonous food, plus the consumption time of each other food. Also, drinking milk will negate the effect, allowing the player to potentially eat more poisonous food and constantly drink milk to fill the bar without being inflicted by Hunger.

Mechanics
The ten drumsticks shown at the bottom of the screen next to the health bar show the status of the player's food level. Each drumstick represents two food level points. Therefore, the maximum food level is 20.

There is another aspect of hunger that is not visible to the player. This is called the food saturation level. The player's hunger will not decrease until their food saturation level reaches zero. When the saturation level is at zero, the food bar will shake or jitter periodically. The maximum value of the food saturation level is equal to the current value of your food level. This means that if, for example, your food level is 20/20 (All your drumsticks are full) then your maximum food saturation level is also 20.

When you eat food, your food level and your food saturation level increase as long as they aren't already at their maximums. The amount that is replenished depends on the food item being consumed.

A third component of hunger is the food exhaustion level. This value can range between 0.0 and 4.0. Certain actions the player takes increase this variable. The table below shows how different actions affect the player's exhaustion level. When exhaustion reaches 4.0 or above, it is reduced by 4.0 and the food saturation level is reduced by 1.0; if this brings the food saturation level below zero, it is set to zero instead. If the food saturation level is already at zero, then a point is removed from the player's food level and the player loses half a drumstick.

The last variable involved in the hunger mechanics is the foodTickTimer; this variable essentially times how long the player has had no hunger left or more than 17 points on the foodLevel. When the foodTickTimer reaches 80 (its maximum) then it will either deal the player half a heart of damage (when there is no hunger left) or heal the player half a heart (When the player doesn't have full health and his foodLevel is more than 17 points).

Exhaustion level increase
''Any action not listed here will not increase exhaustion level. For example, the player can travel several days by boat and the food bar will not decrease.''