Fluid

Liquids are blocks that can, as the name suggests, flow and spread.

Liquid Properties
There are currently only two liquids in Minecraft: lava and water.

Liquids Have Sources and Flows


Liquids have sources and the liquid flows from those sources according to the following rules that govern how they spread, limited and/or affected by the objects and blocks they flow over and around. Flowing liquid is a transparent block of a particular depth (0-7) with a direction of flow.

A group of liquid source blocks inside containing walls and on the same level normally form a stable non-flowing pool. Source blocks placed into an empty volume with surrounding walls can form a stable pool if done correctly. Source blocks that are at least partly un-confined give rise to flowing blocks that spread out according to the nature of liquids, as described in the following sections of this page.

For the truly nerdy a group of liquid source blocks, and any flowing blocks they give rise to, form a cellular automata.

Depth of a Liquid Block
Every liquid block has a depth value that gives the amount of its block that is empty, ranging from 7 (shallowest) to 0 (completely full) for a source block, except for lava in the over world where its shallowest value is 3. In the nether lava blocks behave like water in the over world and so have depth values from 0 to 7.

This is a bit counter-intuitive, but increasing the "empty" value as flow is evaluated each block away from the source is the way the game engine does it.

Falling liquid
An air block below a liquid block is converted into a liquid block of that type. This happens faster for water than for lava (except in the Nether).

Liquids that are suspended above an open area by one block thick of material will seep through the material and drip to the floor. Lava particles that are seeping do not cause damage or start fires. This makes digging upwards safer, since you can tell if you are near a lava/water lake.

Flowing liquids
To keep track of which blocks are actively flowing, water and lava each have a pair of block IDs. For water, there is flowing_water (8) and water (9). Water will stay in place until it receives a block update. Flowing water updates periodically and will change itself to water when it cannot spread any further.

Updating a block next to water will turn it back to flowing water so it can spread some more.

Liquid block update cases
The state of a liquid block only updates in certain cases:


 * On creation
 * If one of the 6 neighboring blocks' state changes.
 * If its own level changes

State changes that cause an update include:


 * Adding or removing a block
 * A neighboring block's level changes
 * A redstone wire switches on or off

However, generated structures never cause block updates to adjacent liquids when they spawn, so for example a cave entrance may meet a lake or ocean but remain dry until a block update is triggered. However, liquids can flow from a structure immediately when it is generated.

Liquid block update process
When a liquid block updates, it performs the following checks.


 * Check inward flow
 * If there is a liquid block of the same type above, set level to 1
 * Otherwise, reduce or increase level in steps of 1 so that it is 1 higher than the one of its 4 neighbouring block with the lowest level*
 * If level is increased past the max level, replace liquid block with air block.
 * Level cannot be decreased below 1

* This does not affect source blocks (level = 0)


 * Check outward flow
 * This only happens for liquid blocks of less than the max level value
 * Determine the shortest distance to a fall, but only scan 5 blocks distance*
 * If any of the directions tied for shortest have an air block, convert that air block to a liquid block with a level of 1 more than the current block*

* This means that lava will flow towards a drop that it cannot reach.

Source creation
A water block is converted into a source block if both of the following conditions hold:
 * it is bordered by at least 2 water source blocks on the same horizontal level.
 * the block underneath is a solid block or a water source block.

Lava source blocks cannot be created.

Mixing of liquids
If a liquid flows into a block occupied by another liquid, then the block turns into a solid block according to the following rules:
 * If Water flows into a lava source block, then obsidian is produced.
 * If Lava flows downward into Water, then stone is produced.
 * if Water flows horizontally into downwards flowing lava, nothing happens.
 * Otherwise, cobblestone is produced.

When determining the shortest distance to a drop, other liquid blocks are assumed to be equal to air.

Gallery
Flüssigkeit Líquidos Fluides 液体 Vloeistoffen Ciecze Жидкости 液体