Block update

Block update is an in-game mechanism that is used to make blocks in the correct state.

Introduce
Limited to the computing power of a computer, the game can not process all the squares at all times. That's why the game needs a mechanism named block update - when a block changes (due to a player, an entity, or a chunk tick, etc.), it notifys nearby blocks that they should check if they need to response.

Java Edition
$$, there are three types of block updates: NC update, PP update, and BE update.

Priorities
When a block changes, it can sends different block updates that have different priorities:

PP update
PP update (i.e. update post placement, update neighbour shapes, update shape) is the most common type of block updates, mainly used for connected blocks changing their shapes (e.g. stairs, fences) and attached blocks dropping into items (e.g. torches, cactus, wheat). It almost always has a priority of 2.

Sending

 * General PP updates
 * When a block is placed, destroyed, replaced, or its blockstate is changed, the game sends PP update to its immediate neighbors, in order of west, east, north, south, down, up.


 * Exception
 * However, there are some exceptions:
 * Lighting a nether portal does not send PP update.
 * A nether portal generating does not send PP update.
 * Changing block state with debug stick does not send PP update.
 * Shulker boxes sends general PP updates when beginning to open/close or complete opennign/closing.
 * When a redstone wire is placed, destroyed, replaced, or its blockstate is changed, for any block that the redstone wire points horizontally to, if it is not a redstone wire, then the game also sends PP updates to the block above it and the block below it. However, it does not send PP update to an observer.
 * Pistons and beds have more complex updates.

Receiving
When a block receives a PP update, the direction of the PP update may be considered. For example, a wheat accepts only PP updates from above.

Only following blocks can receive PP updates:

NC update
NC update (i.e. neighbor changed, update neighbors, redstone update) is the most widely known type of block updates, mainly used for redstone components.

Sending

 * General NC updates
 * Most blocks send NC updates to their immediate neighbors when they are placed, destroyed, or replaced, or their blockstates are changed, in order of west, east, down, up, north, south.


 * Exception
 * Some changes do not produce General NC updates:
 * Thickens when the upper bamboo thickens.
 * Growes into a bamboo.
 * and
 * Converts to each other.
 * ,, and
 * Turns into a golem.
 * Plants
 * Turns into a double-block plant.
 * Its water level changes.
 * and
 * Grows, ripens or changes its shape.
 * Grows.
 * Be lit or unlit.
 * Its signal or its mode is changed.
 * ,, and
 * Dies.
 * ,, , and
 * Grows.
 * ,, and
 * Opens, closes, actives, or deactives.
 * Transports to destination.
 * Gets hydrated or dry.
 * Melts gradually (but has not truned into water).
 * Inserts or ejects records.
 * Grows.
 * Be lit or unlit.
 * Be lit or unlit.
 * Increase its number using bone meals.
 * Absorbs water.
 * and
 * Grows
 * Remove the melon from it.
 * Grows
 * Its fruits are collected.
 * Its number decreases.
 * Grows, changes its shape, grow out a new vine block.
 * ,, and
 * Turns into a wither.
 * Be eaten by a sheep.
 * Be eaten by a rabbit.
 * Damaged.
 * The Eye of Ender is placed.
 * Generates.
 * Bottles or potions are added into it.
 * and
 * Changes its mode.
 * and
 * Grows.
 * Change its mode.
 * ,, and
 * Be activated or inactivated
 * Its age or shape changes.
 * Increases its stage.
 * Its "disarmed" value changes.
 * Be occupied or unoccupied.
 * and
 * Generates as a nether portal.
 * A nether portal be activated.
 * Add or remove hay bale below it.
 * ,, , , , and
 * Its shape changes.
 * ,, and
 * Be covered or uncovered by snow.
 * ,, and
 * Grows.
 * Add or remove kelp/vines above/below it.
 * Its signal changes.
 * All blocks with blockstates
 * Change its blockstate using debug stick.
 * s, and
 * Have more complex behavior.
 * Grows.
 * Change its mode.
 * ,, and
 * Be activated or inactivated
 * Its age or shape changes.
 * Increases its stage.
 * Its "disarmed" value changes.
 * Be occupied or unoccupied.
 * and
 * Generates as a nether portal.
 * A nether portal be activated.
 * Add or remove hay bale below it.
 * ,, , , , and
 * Its shape changes.
 * ,, and
 * Be covered or uncovered by snow.
 * ,, and
 * Grows.
 * Add or remove kelp/vines above/below it.
 * Its signal changes.
 * All blocks with blockstates
 * Change its blockstate using debug stick.
 * s, and
 * Have more complex behavior.
 * Grows.
 * Add or remove kelp/vines above/below it.
 * Its signal changes.
 * All blocks with blockstates
 * Change its blockstate using debug stick.
 * s, and
 * Have more complex behavior.
 * Have more complex behavior.


 * Other NC updates
 * Some blocks (mainly redstone components) sends Sends more NC updates other than general NC updates when changing.

Receiving
When a block receives a NC update, the source of the NC update may be considered. For example, a rail accepts only NC updates from power components.

Only following blocks can receive NC updates:

BE update
Redstone comparators can use certain blocks and entities as power sources, and in turn, the blocks or entities send BE updates (i.e. Block entity updates, Update neighbour for output signal) when changing.

Special blocks
Pistons and beds have complex behavior.