Minecraft:Block update
More actions
A block update is an in-game mechanism that occurs when a block is modified in some way. Limited to the computing power of a computer, the game can not process all blocks at all times, which is why the game needs such mechanism. When a block changes (due to a player, an entity, or a chunk tick, etc.), it notifies nearby blocks that they should check if they need to respond to the change.
Java Edition
in Template:Editions, there are two main types of block updates: post placement (PP) and neighbor changed (NC).
Priorities
This article uses the priorities listed in the table below to categorize the various block updates. However, keep in mind that these values are not actually present in the game's code.
| Priority | Description | Method in code |
|---|---|---|
| -3 | Updates before the change. | N/A |
| -2 | Some updates after the change. | Blockstate.
|
| -1 | Some updates after the change. |
|
| 0 | General NC updates. |
|
| 1 | General comparator updates. |
|
| 2 | General PP updates. |
|
| 3 | Later updates. | N/A |
Most players only use -3 to 3 priority values to describe scheduled ticks, so it is recommended not to use these values for the update sequence in order to avoid ambiguity with scheduled tick priorities.
Post placement update
A post placement (PP) update (aka update post placement, update neighbor 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).
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 this order: west, east, north, south, down, up.
- Exceptions
- Some blocks have unique behaviors:
- 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 finished opening/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 Minecraft:wheat block accepts only PP updates from beneath.
Only the following blocks can receive PP updates:
| Block | What to do when receiving a PP update |
|---|---|
| Support-requiring blocks (e.g. torches, snow, carpets, doors, fire, etc.) | Checks if it should break and drop as an item. |
| Connective blocks (e.g. fences, stairs, chests, redstone wires, nether portals, etc.) | Checks if it should change its shape. |
Template:Redr || Checks for being locked or unlocked. | |
Template:Redr || Tries to update its instrument type. | |
Template:Redr || Calculates the distance to logs. | |
Template:Redr || Solidifies if contacted with water. | |
Template:Redr and waterlogged blocks || Requests a scheduled tick for flowing. | |
Template:Redr || Requests a scheduled tick for pulsing. | |
| |
|
Requests a scheduled tick for checking whether it is covered by a solid block. |
| |
Template:Redr || Requests a scheduled tick for checking if it should drop. | |
Template:Redr || Requests a scheduled tick for checking whether it is outside of water. | |
|
Tries to request a scheduled tick to generate bubble columns. |
|
Neighbor changed update
Neighbor changed (NC) updates (aka neighbor changed, update neighbors, redstone update) are the most widely known type of block updates (for historical reasons), and are 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, in this order: west, east, down, up, north, south.
- Exceptions
- Some changes do not produce General NC updates:
- redirect Template:blockLink
- Thickens when the upper bamboo thickens.
- redirect Template:blockLink
- Grows into a bamboo.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Convert to each other.
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Turn into a golem.
- Plants
- Turn into a double-block plant.
- redirect Template:blockLink
- Its water level changes.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Grow, ripen or change their shape.
- redirect Template:blockLink
- Grows.
- redirect Template:blockLink
- Becomes lit or unlit.
- redirect Template:blockLink
- Its signal or its mode is changed.
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Die.
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Grow.
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Opes, close, activate, or deactivate.
- redirect Template:blockLink
- Transports to destination.
- redirect Template:blockLink
- Gets hydrated or dry.
- redirect Template:blockLink
- Melts gradually (but has not turned into water).
- redirect Template:blockLink
- Inserts or ejects records.
- redirect Template:blockLink
- Grows.
- redirect Template:blockLink
- Becomes lit or unlit.
- redirect Template:blockLink
- Becomes lit or unlit.
- redirect Template:blockLink
- Increases its number using bone meal.
- redirect Template:blockLink
- Absorbs water.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Grow.
- Melon or pumpkin is removed from them.
- redirect Template:blockLink
- Grows.
- Its fruits are collected.
- redirect Template:blockLink
- Its number decreases.
- redirect Template:blockLink
- Grows, changes its shape, grows out a new vine block.
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Turn into a wither.
- redirect Template:blockLink
- Gets eaten by a sheep.
- redirect Template:blockLink
- Get eaten by a rabbit.
- redirect Template:blockLink
- Gets damaged.
- redirect Template:blockLink
- The Eye of Ender is placed.
- redirect Template:blockLink
- Generates.
- redirect Template:blockLink
- Bottles or potions are added into it.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Change their mode.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Grow.
- redirect Template:blockLink
- Changes its mode.
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Becomes activated or deactivated.
- redirect Template:blockLink
- Its age or shape changes.
- redirect Template:blockLink
- Increase their stage.
- redirect Template:blockLink
- Its "disarmed" value changes.
- redirect Template:blockLink
- Become occupied or unoccupied.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- Generates as a nether portal.
- redirect Template:blockLink
- Add or remove hay bale below it.
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Its shape changes.
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Be covered or uncovered by snow.
- redirect Template:blockLink
- redirect Template:blockLink
Template:Redr, and
- redirect Template:blockLink
- Grow.
- Add or remove kelp/vines above/below it.
- redirect Template:blockLink
- Its signal changes.
- All blocks
- Change their blockstate using debug stick.
- Placed by a command.
- redirect Template:blockLink
Template:Redrs and
- redirect Template:blockLink
- Have more complex behavior.
- Other NC updates
- Some blocks (mainly redstone components) send more NC updates other than general NC updates when changing.
| Block | Change | Priority | Range and order | Schematic diagram |
|---|---|---|---|---|
| Lever / Button / Pressure plate / Tripwire hook | Destroy an activated lever/button/pressure plate/tripwire hook. | -2 | Their immediate neighbors (in order of west, east, down, up, north, south). Then the immediate neighbors (in order of west, east, down, up, north, south) of the block they're attached to. | |
| Active or deactive them. Change pressure plate's signal. Tripwire hook connects to a tripwire. |
3 | |||
| Repeater and Comparator | Place or its blockstate changes. | -1 | The block they're facing. Then the immediate neighbors (without the repeater/comparator itself. In order of west, east, down, up, north, south) of the block they're facing. | |
| Remove. | -2 | |||
| Comparator's signal changes. | 3 | |||
| Chest | Begin to be open/closed | N/A (the block is not changed) | Its immediate neighbors (in order of west, east, down, up, north, south). | |
| Trapped chest | Begin to be open/closed | N/A (the block is not changed) | Its immediate neighbors (in order of west, east, down, up, north, south). Then the immediate neighbors (in order of west, east, down, up, north, south) of the block below it. | |
| Observer | Lit or unlit. | 3 | The block it's facing. Then the immediate neighbors (without the observer itself. In order of west, east, down, up, north, south) of the block it's facing. | |
| Destroy or replace an activated observer. | -2 | |||
| Place an activated observer. | -1 | Set itself to unactivated without any update. Then update the block it's facing. Then the immediate neighbors (excluding the observer itself. In order of west, east, down, up, north, south) of the block it's facing. | ||
| Redstone torch | Place or its blockstate changes. | -1 | The immediate neighbors (in order of west, east, down, up, north, south) of the immediate neighbors (in order of down, up, north, south, west, east) of the torch. | |
| Destroy, replace, or its blockstate changes. | -2 | |||
| Redstone wire | Destroy or replace. | -2 | The immediate neighbors (in order of west, east, down, up, north, south) of the immediate neighbors (in order of down, up, north, south, west, east) of the wire.
|
|
| Place. | -1 | Updates the immediate neighbors (in order of west, east, down, up, north, south) of the block above the wire.
|
||
| Its signal changes | 3 | Update the immediate neighbors (in order of west, east, down, up, north, south) of the datum points. Datum points include the wire and the immediate neighbors of the wire, in random order. | ||
| Changes between dot and cross | 3 | Update the immediate neighbors (without the wire itself, and in order of west, east, down, up, north, south) of the solid block next to the wire (in order of north, east, south, west). | ||
| Rails | <more information needed></more information needed>
| |||
| Any block | Placed with a command. | 3 | Update the immediate neighbors (in order of west, east, down, up, north, south). |
Receiving
When an NC update is received, the block that caused that update may taken into consideration. For example, a rail accepts only NC updates from power components.
Only the following blocks can react to NC updates:
| Block | What to do when receiving an NC update |
|---|---|
Template:Redr || Tries to melt. | |
|
Tries to change its state. |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Tries to change itself to be in the correct state. |
| |
Template:Redr || Tries to absorb water. |
Comparator update
Template:Message boxTemplate:Article other Template:Schematic The comparator update (i.e. Block entity updates, Update neighbor for output signal) is a subtype of the neighbor update that is only sent to comparators. Redstone comparators can read certain blocks and produce an output signal, and in turn, these blocks can send comparator updates when changing, to notify the comparators. Comparators can also read some entities (item frames and glow item frames), as such, these entities can send comparator updates too, even though they are not blocks.
When a block that can be detected by comparators changes, it sends updates to surrounding comparators (including comparators separated by a solid block), in this order: north, east, south, west.
After receiving a comparator update, comparators attempt to calculate and change their output signal.
Special blocks
Template:Message boxTemplate:Article other
- redirect Template:blockLink
Template:Redr: during the start of the extension/retraction process, every time a moving piston block gets placed and every time one of the normal blocks<ref>"Normal block" is intended as not a "moving piston" block.</ref> is replaced/removed, PP updates are sent to these blocks' neighbors. Once all moving piston blocks have been placed, the game will send NC updates to the replaced/removed normal blocks' neighbors.
- Sticky pistons, however, do not send NC updates around their head when they start to pull blocks: only the NC updates caused by the moving piston block turning back into a normal block are sent, once the retraction process is over. If a sticky piston fails to retract a slime block or a honey block due to the pull limit, no updates will be sent around the head whatsoever.
Block updates and DFS
Block updates follow the principle of
- REDIRECT Template:Wikipedia
Template:Redr (DFS).
For example, when Block A changes, it maybe sends block updates to B and C one by one. Receiving the update, B maybe changes and sends updates to D and E. Receiving update from B, D changes and sends updates to some block. Then E receives the update from B. Then C receives the update from A.
Self update
When a block is placed, it checks and adapts itself to its surroundings by Blockstate.onPlace() or similar methods. Strictly speaking, this isn't a block update; however when a block is placed or changed, if it changes again when self-updated, then the former change does not produce any general update (this is a bug).
Here is a list of self updates that can cause this bug.
- redirect Template:blockLink
- When being placed, if it should be powered, becomes powered.
- redirect Template:blockLink
- If in the nether, it turns into an dry sponge.
- redirect Template:blockLink
- When being placed, it absorbs water and turns into an wet sponge.
- redirect Template:blockLink
Template:Redr and
- redirect Template:blockLink
- When a powered target or observer is placed, it turns into an unpowered state.
- redirect Template:blockLink
- When being placed, it updates the signal and connection.
- redirect Template:blockLink
- When being placed, if it should be extinguished, removes itself.
- redirect Template:blockLink
- When being placed, if it should explode, removes itself.
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
- redirect Template:blockLink
- When being placed, it updates its shape.
- redirect Template:blockLink
- When being placed, it checks whether it is pressed and updates its state.
- redirect Template:blockLink
- When being placed, if it should turn into a golem, removes itself.
Bedrock Edition
- Redirect Template:Empty section
History
Java Edition
| Versions | |||
|---|---|---|---|
| Development |
| ||
| Technical | |||
| Game customization |
de:Blockupdate ja:ブロック更新 lzh:塊竦 pt:Atualização de bloco zh:方块更新