3. Metabolization - lilypuree/Metabolism GitHub Wiki

Overview

Activities such as mining, sprinting, attacking or taking damage increases foodExhaustionLevel in vanilla Minecraft. In metabolism gain in exhaustion is replaced by gain in progress, shown in the HUD by the metabolization progress bar. When progress reaches 1, the value will decrease by 1, and cause metabolization to occur.


Gaining progress

Other gains in exhaustion will be replaced by an equivalent gain in progress, except the hunger effect which will drain food and hydration directly.

Action Progress Increase Units
Swimming 0.025 per meter
Sprinting 0.025 per meter
Walking 0.001 per meter
Crouching 0.002 per meter
Climbing 0.002 per meter
Jumping 0.01 per jump
Attacking an entity 0.05 per attack landed
Taking damage that is normally protected by armor 0.05 per distinct instance of damage being received
Breaking a block 0.005 per block broken

The Metabolism Effect

Metabolism adds a new effect called 'metabolism', obtained by eating certain foods. Having this effect will cause progress to increase continuously.

Unlike other effects, the metabolism effect will not be overridden when gaining another metabolism effect. All effects are saved and will be executed consecutively, stronger effects first. For an example, if the following effects are gained,

  • Effect A: level 0, duration 10s
  • Effect B: level 0, duration 20s
  • Effect C: level 1, duration 5s

The resulting metabolism effect will last 35 seconds in total, level 1 for the first 5 seconds then dropping to a level 0 effect.

Higher level effects give more progress per tick, causing more frequent metabolizations.

Effect Sources Effect Level Metabolizations/s
normal food 0 0.5
warm food* 1 0.75
golden food 2 1.0
no in-game sources 3 1.25

and so on.

*warm foods: cooked meats(except cooked fish), stews, baked potatoes, honey.


Results

There are various outcomes of metabolization possible. Heat, warmth, food, hydration levels all matter. The following conditions are checked in order.

1. Warmth bar filling

warmth bar filling

When the warmth bar has empty slots, 1 food and hydration is consumed to generate 1 warmth.

The metabolization result indicator shows a warmth icon. See video below.

2. Unbalanced food & hydration

2-1. Food generation

food generation

When food is being drained, and more hydration exists than food, 1 hydration is converted to 0.5 food.

The metabolization result indicator shows a food icon.

2-2 Hydration generation

hydration generation

When hydration is being drained, and more food exists than hydration, 1 food is converted to 0.5 hydration.

The metabolization result indicator shows a hydration icon.

3. Heat to warmth

heat to warmth

This requires a metabolism effect of level 1 or above. When heat orbs exist, and #2 didn't happen, 1 food and hydration is consumed to generate 1 warmth.

The metabolization result indicator shows a warmth icon.

4. No metabolization

If none of the above apply (like when the warmth bar is full of warmth) nothing will be consumed, and the metabolization result indicator shows nothing.


Video

https://github.com/lilypuree/Metabolism/assets/38712797/9bd2ee20-816e-4ec2-886f-4c70fef0c172

The video shows warmth being generated through metabolization, while the metabolism effect is applied.