Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Block update: Difference between revisions

From SAS Gaming Wiki
imported>SworderExert
 
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


==''Java Edition''==
==''Java Edition''==
{{IN|java}}, there are two main types of block updates: post placement (PP) and neighbor changed (NC).
{{MC/In|java}}, there are two main types of block updates: post placement (PP) and neighbor changed (NC).


===Priorities===
===Priorities===
Line 14: Line 14:
| -3 || Updates before the change. || N/A
| -3 || Updates before the change. || N/A
|-
|-
| -2 || Some updates after the change. || Blockstate.{{cd|onRemove()}}{{More info|Method not found}}
| -2 || Some updates after the change. || Blockstate.{{MC/Cd|onRemove()}}{{MC/More info|Method not found}}
|-
|-
| -1 || Some updates after the change. || {{jbcp|state|BlockBehaviour}}.{{cd|onPlace({{Tooltip|...|BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston}})}}
| -1 || Some updates after the change. || {{MC/Jbcp|state|BlockBehaviour}}.{{cd|onPlace({{MC/Tooltip|...|BlockState state, Level level, BlockPos pos, BlockState oldState, boolean movedByPiston}})}}
|-
|-
| 0 || General NC updates. || {{jcp|net.minecraft.world.level.Level}}.{{cd|sendBlockUpdated({{Tooltip|...|BlockPos pos, BlockState old, BlockState current, int updateFlags}})}}
| 0 || General NC updates. || {{MC/Jcp|net.minecraft.world.level.Level}}.{{cd|sendBlockUpdated({{MC/Tooltip|...|BlockPos pos, BlockState old, BlockState current, int updateFlags}})}}
|-
|-
| 1 || General comparator updates. || {{jbcp|state|BlockBehaviour}}.{{cd|updateNeighbourForOutputSignal({{Tooltip|...|LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit}})}}
| 1 || General comparator updates. || {{MC/Jbcp|state|BlockBehaviour}}.{{cd|updateNeighbourForOutputSignal({{MC/Tooltip|...|LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit}})}}
|-
|-
| 2 || General PP updates. || {{jbcp|state|BlockBehaviour}}.{{cd|updateNeighbourShapes({{Tooltip|...|LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit}})}}
| 2 || General PP updates. || {{MC/Jbcp|state|BlockBehaviour}}.{{cd|updateNeighbourShapes({{MC/Tooltip|...|LevelAccessor level, BlockPos pos, int updateFlags, int updateLimit}})}}
|-
|-
| 3 || Later updates. || N/A
| 3 || Later updates. || N/A
Line 63: Line 63:
| Connective blocks (e.g. fences, stairs, chests, redstone wires, nether portals, etc.) || Checks if it should change its shape.
| Connective blocks (e.g. fences, stairs, chests, redstone wires, nether portals, etc.) || Checks if it should change its shape.
|-
|-
| {{BlockLink|Redstone repeater}} || Checks for being locked or unlocked.
| {{MC/Blocklink|Redstone repeater}} || Checks for being locked or unlocked.
|-
|-
| {{BlockLink|Note block}} || Tries to update its instrument type.
| {{MC/Blocklink|Note block}} || Tries to update its instrument type.
|-
|-
| {{BlockLink|Leaves|id=oak leaves}} || Calculates the distance to logs.
| {{MC/Blocklink|Leaves|id=oak leaves}} || Calculates the distance to logs.
|-
|-
| {{BlockLink|Concrete powder}} || Solidifies if contacted with water.
| {{MC/Blocklink|Concrete powder}} || Solidifies if contacted with water.
|-
|-
| {{BlockLink|Water}} and waterlogged blocks || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for flowing.
| {{MC/Blocklink|Water}} and waterlogged blocks || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for flowing.
|-
|-
| {{BlockLink|Observer}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for pulsing.
| {{MC/Blocklink|Observer}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for pulsing.
|-
|-
| {{EntityLink|Gravity-affected blocks|link=Falling Block|id=falling-blocks}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking for falling.
| {{MC/Entitylink|Gravity-affected blocks|link=Falling Block|id=falling-blocks}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking for falling.
|-
|-
| {{BlockLink|Dirt Path|Dirt path}}
| {{MC/Blocklink|Dirt Path|Dirt path}}
| rowspan = "2" | Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking whether it is covered by a solid block.
| rowspan = "2" | Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking whether it is covered by a solid block.
|-
|-
|{{BlockLink|farmland}}
|{{MC/Blocklink|farmland}}
|-
|-
| {{BlockLink|Cactus}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking if it should drop.
| {{MC/Blocklink|Cactus}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking if it should drop.
|-
|-
| {{BlockLink|Coral}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking whether it is outside of water.
| {{MC/Blocklink|Coral}} || Requests a [[Minecraft:Tick#Scheduled tick|scheduled tick]] for checking whether it is outside of water.
|-
|-
| {{BlockLink|Magma block}}
| {{MC/Blocklink|Magma block}}
| rowspan = "2" | Tries to request a [[Minecraft:Tick#Scheduled tick|scheduled tick]] to generate bubble columns.
| rowspan = "2" | Tries to request a [[Minecraft:Tick#Scheduled tick|scheduled tick]] to generate bubble columns.
|-
|-
|{{BlockLink|soul sand}}
|{{MC/Blocklink|soul sand}}
|}
|}


Line 106: Line 106:
:;Exceptions
:;Exceptions
::Some changes do not produce General NC updates:
::Some changes do not produce General NC updates:
::*{{BlockLink|Bamboo}}
::*{{MC/Blocklink|Bamboo}}
::** Thickens when the upper bamboo thickens.  
::** Thickens when the upper bamboo thickens.  
::* {{BlockLink|Bamboo shoot}}
::* {{MC/Blocklink|Bamboo shoot}}
::** Grows into a bamboo.
::** Grows into a bamboo.
::* {{BlockLink|Water}} and {{BlockLink|Bubble column}}
::* {{MC/Blocklink|Water}} and {{MC/Blocklink|Bubble column}}
::** Convert to each other.
::** Convert to each other.
::* {{BlockLink|Carved pumpkin}}, {{BlockLink|Jack o'lantern}}, {{BlockLink|Snow block}} and {{BlockLink|Block of Iron}}
::* {{MC/Blocklink|Carved pumpkin}}, {{MC/Blocklink|Jack o'lantern}}, {{MC/Blocklink|Snow block}} and {{MC/Blocklink|Block of Iron}}
::** Turn into a golem.
::** Turn into a golem.
::* Plants
::* Plants
::** Turn into a double-block plant.
::** Turn into a double-block plant.
::* {{BlockLink|Cauldron}}
::* {{MC/Blocklink|Cauldron}}
::** Its water level changes.
::** Its water level changes.
::* {{BlockLink|Chorus flower}} and {{BlockLink|Chorus plant}}
::* {{MC/Blocklink|Chorus flower}} and {{MC/Blocklink|Chorus plant}}
::** Grow, ripen or change their shape.
::** Grow, ripen or change their shape.
::* {{BlockLink|Cocoa}}
::* {{MC/Blocklink|Cocoa}}
::** Grows.
::** Grows.
::*{{BlockLink|Redstone repeater}}
::*{{MC/Blocklink|Redstone repeater}}
::** Becomes lit or unlit.
::** Becomes lit or unlit.
::* {{BlockLink|Redstone comparator}}
::* {{MC/Blocklink|Redstone comparator}}
::** Its signal or its mode is changed.
::** Its signal or its mode is changed.
::* {{BlockLink|Coral}}, {{BlockLink|Coral fans}}, and {{BlockLink|Coral blocks}}
::* {{MC/Blocklink|Coral}}, {{MC/Blocklink|Coral fans}}, and {{MC/Blocklink|Coral blocks}}
::** Die.
::** Die.
::* {{BlockLink|Wheat}}, {{BlockLink|Potatoes}}, {{BlockLink|Carrots}}, and {{BlockLink|Beetroots}}
::* {{MC/Blocklink|Wheat}}, {{MC/Blocklink|Potatoes}}, {{MC/Blocklink|Carrots}}, and {{MC/Blocklink|Beetroots}}
::** Grow.
::** Grow.
::* {{BlockLink|Doors}}, {{BlockLink|Trapdoors}}, and {{BlockLink|Fence gates|id=oak-fence-gate}}
::* {{MC/Blocklink|Doors}}, {{MC/Blocklink|Trapdoors}}, and {{MC/Blocklink|Fence gates|id=oak-fence-gate}}
::** Opes, close, activate, or deactivate.
::** Opes, close, activate, or deactivate.
::* {{BlockLink|Dragon egg}}
::* {{MC/Blocklink|Dragon egg}}
::** Transports to destination.
::** Transports to destination.
::* {{BlockLink|Farmland}}
::* {{MC/Blocklink|Farmland}}
::** Gets hydrated or dry.
::** Gets hydrated or dry.
::* {{BlockLink|Frosted ice}}
::* {{MC/Blocklink|Frosted ice}}
::** Melts gradually (but has not turned into water).
::** Melts gradually (but has not turned into water).
::* {{BlockLink|Jukebox}}
::* {{MC/Blocklink|Jukebox}}
::** Inserts or ejects records.
::** Inserts or ejects records.
::* {{BlockLink|Nether wart}}
::* {{MC/Blocklink|Nether wart}}
::** Grows.
::** Grows.
::* {{BlockLink|Observer}}
::* {{MC/Blocklink|Observer}}
::** Becomes lit or unlit.
::** Becomes lit or unlit.
::* {{BlockLink|Redstone lamp}}
::* {{MC/Blocklink|Redstone lamp}}
::** Becomes lit or unlit.
::** Becomes lit or unlit.
::* {{BlockLink|Sea pickle}}
::* {{MC/Blocklink|Sea pickle}}
::** Increases its number using bone meal.
::** Increases its number using bone meal.
::* {{BlockLink|Sponge}}
::* {{MC/Blocklink|Sponge}}
::** Absorbs water.
::** Absorbs water.
::* {{BlockLink|Melon stem}} and {{BlockLink|Pumpkin stem}}
::* {{MC/Blocklink|Melon stem}} and {{MC/Blocklink|Pumpkin stem}}
::** Grow.
::** Grow.
::** Melon or pumpkin is removed from them.
::** Melon or pumpkin is removed from them.
::* {{BlockLink|Sweet berry bush}}
::* {{MC/Blocklink|Sweet berry bush}}
::** Grows.
::** Grows.
::** Its fruits are collected.
::** Its fruits are collected.
::* {{BlockLink|Turtle egg}}
::* {{MC/Blocklink|Turtle egg}}
::** Its number decreases.
::** Its number decreases.
::* {{BlockLink|Vines}}
::* {{MC/Blocklink|Vines}}
::** Grows, changes its shape, grows out a new vine block.
::** Grows, changes its shape, grows out a new vine block.
::* {{BlockLink|Wither skeleton skull}}, {{BlockLink|Soul soil}}, and {{BlockLink|Soul sand}}
::* {{MC/Blocklink|Wither skeleton skull}}, {{MC/Blocklink|Soul soil}}, and {{MC/Blocklink|Soul sand}}
::** Turn into a wither.
::** Turn into a wither.
::* {{BlockLink|Grass block}}
::* {{MC/Blocklink|Grass block}}
::** Gets eaten by a sheep.
::** Gets eaten by a sheep.
::* {{BlockLink|Carrots}}
::* {{MC/Blocklink|Carrots}}
::** Get eaten by a rabbit.
::** Get eaten by a rabbit.
::* {{BlockLink|Anvil}}
::* {{MC/Blocklink|Anvil}}
::** Gets damaged.
::** Gets damaged.
::* {{BlockLink|End portal frame}}
::* {{MC/Blocklink|End portal frame}}
::** The Eye of Ender is placed.
::** The Eye of Ender is placed.
::* {{BlockLink|End portal}}
::* {{MC/Blocklink|End portal}}
::** Generates.
::** Generates.
::* {{BlockLink|Brewing stand}}
::* {{MC/Blocklink|Brewing stand}}
::** Bottles or potions are added into it.
::** Bottles or potions are added into it.
::* {{BlockLink|Structure block}} and {{BlockLink|Command block}}
::* {{MC/Blocklink|Structure block}} and {{MC/Blocklink|Command block}}
::** Change their mode.
::** Change their mode.
::* {{BlockLink|Cactus}} and {{BlockLink|Sugar cane}}
::* {{MC/Blocklink|Cactus}} and {{MC/Blocklink|Sugar cane}}
::** Grow.
::** Grow.
::* {{BlockLink|Daylight detector}}
::* {{MC/Blocklink|Daylight detector}}
::** Changes its mode.
::** Changes its mode.
::* {{BlockLink|Dispenser}}, {{BlockLink|Dropper}}, and {{BlockLink|Hopper}}
::* {{MC/Blocklink|Dispenser}}, {{MC/Blocklink|Dropper}}, and {{MC/Blocklink|Hopper}}
::** Becomes activated or deactivated.
::** Becomes activated or deactivated.
::* {{BlockLink|Fire}}
::* {{MC/Blocklink|Fire}}
::** Its age or shape changes.
::** Its age or shape changes.
::* {{BlockLink|Saplings}}
::* {{MC/Blocklink|Saplings}}
::** Increase their stage.
::** Increase their stage.
::* {{BlockLink|Tripwire}}
::* {{MC/Blocklink|Tripwire}}
::** Its "disarmed" value changes.
::** Its "disarmed" value changes.
::* {{BlockLink|Beds}}
::* {{MC/Blocklink|Beds}}
::** Become occupied or unoccupied.
::** Become occupied or unoccupied.
::* {{BlockLink|Nether portal}} and {{BlockLink|Obsidian}}
::* {{MC/Blocklink|Nether portal}} and {{MC/Blocklink|Obsidian}}
::** Generates as a nether portal.
::** Generates as a nether portal.
::* {{BlockLink|Campfire}}
::* {{MC/Blocklink|Campfire}}
::** Add or remove hay bale below it.
::** Add or remove hay bale below it.
::* {{BlockLink|Fences}}, {{BlockLink|Stairs}}, {{BlockLink|Glass panes|id=stained-glass-panes}}, {{BlockLink|Iron bars}}, {{BlockLink|Mushroom blocks}}, and {{BlockLink|Walls}}
::* {{MC/Blocklink|Fences}}, {{MC/Blocklink|Stairs}}, {{MC/Blocklink|Glass panes|id=stained-glass-panes}}, {{MC/Blocklink|Iron bars}}, {{MC/Blocklink|Mushroom blocks}}, and {{MC/Blocklink|Walls}}
::** Its shape changes.
::** Its shape changes.
::* {{BlockLink|Grass block}}, {{BlockLink|Podzol}}, and {{BlockLink|Mycelium}}
::* {{MC/Blocklink|Grass block}}, {{MC/Blocklink|Podzol}}, and {{MC/Blocklink|Mycelium}}
::** Be covered or uncovered by snow.
::** Be covered or uncovered by snow.
::* {{BlockLink|Kelp}}, {{BlockLink|Weeping vines}}, and {{BlockLink|Twisting vines}}
::* {{MC/Blocklink|Kelp}}, {{MC/Blocklink|Weeping vines}}, and {{MC/Blocklink|Twisting vines}}
::** Grow.
::** Grow.
::** Add or remove kelp/vines above/below it.
::** Add or remove kelp/vines above/below it.
::* {{BlockLink|Pressure plates}}
::* {{MC/Blocklink|Pressure plates}}
::** Its signal changes.
::** Its signal changes.
::* All blocks
::* All blocks
::** Change their blockstate using debug stick.
::** Change their blockstate using debug stick.
::** Placed by a command.
::** Placed by a command.
::* {{BlockLink|Piston}}s and {{BlockLink|Beds}}
::* {{MC/Blocklink|Piston}}s and {{MC/Blocklink|Beds}}
::** Have more complex behavior.
::** Have more complex behavior.


Line 384: Line 384:
|-
|-
|Rails
|Rails
|{{info needed}}
|{{MC/Info needed}}
|-
|-
|Any block
|Any block
Line 400: Line 400:
====Receiving====
====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 [[Minecraft:Redstone_components#Power_components|power components]].
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:
Only the following blocks can react to NC updates:
Line 407: Line 407:
! Block !! What to do when receiving an NC update
! Block !! What to do when receiving an NC update
|-
|-
| {{BlockLink|Frosted ice}} || Tries to melt.
| {{MC/Blocklink|Frosted ice}} || Tries to melt.
|-
|-
| {{BlockLink|Redstone dust}}  
| {{MC/Blocklink|Redstone dust}}  
| rowspan="18" | Tries to change its state.
| rowspan="18" | Tries to change its state.
|-
|-
| {{BlockLink|Redstone repeater}}
| {{MC/Blocklink|Redstone repeater}}
|-
|-
| {{BlockLink|Redstone comparator}}
| {{MC/Blocklink|Redstone comparator}}
|-
|-
| {{BlockLink|Redstone torch}}
| {{MC/Blocklink|Redstone torch}}
|-
|-
| {{BlockLink|Rail}}
| {{MC/Blocklink|Rail}}
|-
|-
| {{BlockLink|Detector rail}}
| {{MC/Blocklink|Detector rail}}
|-
|-
| {{BlockLink|Activator rail}}
| {{MC/Blocklink|Activator rail}}
|-
|-
| {{BlockLink|Powered rail}}
| {{MC/Blocklink|Powered rail}}
|-
|-
| {{BlockLink|Command blocks}}
| {{MC/Blocklink|Command blocks}}
|-
|-
| {{BlockLink|Dropper}}
| {{MC/Blocklink|Dropper}}
|-
|-
| {{BlockLink|Dispenser}}
| {{MC/Blocklink|Dispenser}}
|-
|-
| {{BlockLink|Note block}}
| {{MC/Blocklink|Note block}}
|-
|-
| {{BlockLink|Redstone lamp}}
| {{MC/Blocklink|Redstone lamp}}
|-
|-
| {{BlockLink|TNT}}
| {{MC/Blocklink|TNT}}
|-
|-
| {{BlockLink|Piston}}
| {{MC/Blocklink|Piston}}
|-
|-
| {{BlockLink|Trapdoors}}
| {{MC/Blocklink|Trapdoors}}
|-
|-
| {{BlockLink|Fence gates|id=oak-fence-gate}}
| {{MC/Blocklink|Fence gates|id=oak-fence-gate}}
|-
|-
| {{BlockLink|Doors}}
| {{MC/Blocklink|Doors}}
|-
|-
| {{BlockLink|Water}}
| {{MC/Blocklink|Water}}
| rowspan="2" | Tries to change itself to be in the correct state.
| rowspan="2" | Tries to change itself to be in the correct state.
|-
|-
| {{BlockLink|Lava}}
| {{MC/Blocklink|Lava}}
|-
|-
| {{BlockLink|Sponge}} || Tries to absorb water.
| {{MC/Blocklink|Sponge}} || Tries to absorb water.
|}
|}


===Comparator update===
===Comparator update===
{{Expand section}}
{{MC/Expand section}}
{{Schematic|caption = Comparator updates
{{Schematic|caption = Comparator updates
  ||input+rc-e||-
  ||input+rc-e||-
Line 461: Line 461:
  |input+rc-w|ch|SB|-
  |input+rc-w|ch|SB|-
}}
}}
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. [[Minecraft:Redstone comparator]]s 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 ([[Minecraft:item frame]]s and [[Minecraft:glow item frame]]s), as such, these entities can send comparator updates too, even though they are not blocks.
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'''.
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'''.
Line 468: Line 468:


===Special blocks===
===Special blocks===
{{Expand section}}
{{MC/Expand section}}
*{{BlockLink|Pistons}}: during the start of the extension/retraction process, every time a [[Minecraft:Piston/Technical_components#Moving piston|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.  
*{{MC/Blocklink|Pistons}}: 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.  
:[[Minecraft: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 [[Minecraft:slime block]] or a [[Minecraft:honey block]] due to the [[Minecraft:Sticky piston#Limitations|pull limit]], no updates will be sent around the head whatsoever.
: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 and DFS===


Block updates follow the principle of {{w|depth-first search}} (DFS).
Block updates follow the principle of {{MC/W|depth-first search}} (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.
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.
Line 483: Line 483:


Here is a list of self updates that can cause this bug.
Here is a list of self updates that can cause this bug.
* {{BlockLink|Hopper}}
* {{MC/Blocklink|Hopper}}
** When being placed, if it should be powered, becomes powered.
** When being placed, if it should be powered, becomes powered.
* {{BlockLink|Wet sponge}}
* {{MC/Blocklink|Wet sponge}}
** If in the nether, it turns into an dry sponge.
** If in the nether, it turns into an dry sponge.
* {{BlockLink|Sponge}}
* {{MC/Blocklink|Sponge}}
** When being placed, it absorbs water and turns into an wet sponge.
** When being placed, it absorbs water and turns into an wet sponge.
* {{BlockLink|Target}} and {{BlockLink|Observer}}
* {{MC/Blocklink|Target}} and {{MC/Blocklink|Observer}}
** When a powered target or observer is placed, it turns into an unpowered state.
** When a powered target or observer is placed, it turns into an unpowered state.
* {{BlockLink|Tripwire}}
* {{MC/Blocklink|Tripwire}}
** When being placed, it updates the signal and connection.
** When being placed, it updates the signal and connection.
* {{BlockLink|Fire}}
* {{MC/Blocklink|Fire}}
** When being placed, if it should be extinguished, removes itself.
** When being placed, if it should be extinguished, removes itself.
* {{BlockLink|TNT}}
* {{MC/Blocklink|TNT}}
** When being placed, if it should explode, removes itself.
** When being placed, if it should explode, removes itself.
* {{BlockLink|Rail}}, {{BlockLink|Detector rail}}, {{BlockLink|Activator rail}}, {{BlockLink|Powered rail}}
* {{MC/Blocklink|Rail}}, {{MC/Blocklink|Detector rail}}, {{MC/Blocklink|Activator rail}}, {{MC/Blocklink|Powered rail}}
** When being placed, it updates its shape.
** When being placed, it updates its shape.
* {{BlockLink|Detector rail}}
* {{MC/Blocklink|Detector rail}}
** When being placed, it checks whether it is pressed and updates its state.
** When being placed, it checks whether it is pressed and updates its state.
* {{BlockLink|Carved pumpkin}}
* {{MC/Blocklink|Carved pumpkin}}
** When being placed, if it should turn into a golem, removes itself.
** When being placed, if it should turn into a golem, removes itself.


==''Bedrock Edition''==
==''Bedrock Edition''==
{{empty section}}
{{MC/Empty Section}}


== History ==
== History ==
=== ''Java Edition'' ===
=== ''Java Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|?}}
|{{MC/HistoryLine|?}}
|{{HistoryLine||?|Neighbor Changed updates have been added to the game.}}
|{{MC/HistoryLine||?|Neighbor Changed updates have been added to the game.}}
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.5|dev=13w05a|Comparator updates have been added to the game.}}
|{{MC/HistoryLine||1.5|dev=13w05a|Comparator updates have been added to the game.}}
|{{HistoryLine||1.11|dev=16w44a|Post Placement updates have been added to the game. At this point in time only [[Minecraft:observers]] react to them.}}
|{{MC/HistoryLine||1.11|dev=16w44a|Post Placement updates have been added to the game. At this point in time only observers react to them.}}
|{{HistoryLine||1.13|dev=18w47a|The update system has been overhauled: many blocks that used to react to NC updates now react to PP updates instead, also some blocks can now react to both and will behave differently depending on which type of update they receive.}}
|{{MC/HistoryLine||1.13|dev=18w47a|The update system has been overhauled: many blocks that used to react to NC updates now react to PP updates instead, also some blocks can now react to both and will behave differently depending on which type of update they receive.}}
}}
}}




== Navigation ==
== Navigation ==
{{Navbox Java Edition}}
{{MC/Navbox Java Edition}}
{{Navbox Bedrock Edition}}
{{MC/Navbox Bedrock Edition}}


[[Minecraft:de:Blockupdate]]
de:Blockupdate
[[Minecraft:ja:ブロック更新]]
ja:ブロック更新
[[Minecraft:lzh:塊竦]]
lzh:塊竦
[[Minecraft:pt:Atualização de bloco]]
pt:Atualização de bloco
[[Minecraft:zh:方块更新]]
zh:方块更新

Latest revision as of 19:56, 9 April 2026

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. REDIRECT Template:Code

Template:Redr

  1. REDIRECT Template:Info needed

Template:Redr

-1 Some updates after the change.
  1. REDIRECT Template:Java block classpath

Template:Redr.Template:Cd

0 General NC updates.
  1. REDIRECT Template:Java classpath.Template:Cd
1 General comparator updates.
  1. REDIRECT Template:Java block classpath

Template:Redr.Template:Cd

2 General PP updates.
  1. REDIRECT Template:Java block classpath

Template:Redr.Template:Cd

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

Template:Schematic

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.
  1. redirect Template:blockLink

Template:Redr || Checks for being locked or unlocked.

  1. redirect Template:blockLink

Template:Redr || Tries to update its instrument type.

  1. redirect Template:blockLink

Template:Redr || Calculates the distance to logs.

  1. redirect Template:blockLink

Template:Redr || Solidifies if contacted with water.

  1. redirect Template:blockLink

Template:Redr and waterlogged blocks || Requests a scheduled tick for flowing.

  1. redirect Template:blockLink

Template:Redr || Requests a scheduled tick for pulsing.

  1. REDIRECT Template:EntityLink || Requests a scheduled tick for checking for falling.
  1. redirect Template:blockLink

Template:Redr

Requests a scheduled tick for checking whether it is covered by a solid block.
  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr || Requests a scheduled tick for checking if it should drop.

  1. redirect Template:blockLink

Template:Redr || Requests a scheduled tick for checking whether it is outside of water.

  1. redirect Template:blockLink

Template:Redr

Tries to request a scheduled tick to generate bubble columns.
  1. redirect Template:blockLink

Template:Redr

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

Template:Schematic

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:
  1. redirect Template:blockLink

Template:Redr

    • Thickens when the upper bamboo thickens.
  1. redirect Template:blockLink

Template:Redr

    • Grows into a bamboo.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Convert to each other.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Turn into a golem.
  • Plants
    • Turn into a double-block plant.
  1. redirect Template:blockLink

Template:Redr

    • Its water level changes.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Grow, ripen or change their shape.
  1. redirect Template:blockLink

Template:Redr

    • Grows.
  1. redirect Template:blockLink

Template:Redr

    • Becomes lit or unlit.
  1. redirect Template:blockLink

Template:Redr

    • Its signal or its mode is changed.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Die.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Grow.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Opes, close, activate, or deactivate.
  1. redirect Template:blockLink

Template:Redr

    • Transports to destination.
  1. redirect Template:blockLink

Template:Redr

    • Gets hydrated or dry.
  1. redirect Template:blockLink

Template:Redr

    • Melts gradually (but has not turned into water).
  1. redirect Template:blockLink

Template:Redr

    • Inserts or ejects records.
  1. redirect Template:blockLink

Template:Redr

    • Grows.
  1. redirect Template:blockLink

Template:Redr

    • Becomes lit or unlit.
  1. redirect Template:blockLink

Template:Redr

    • Becomes lit or unlit.
  1. redirect Template:blockLink

Template:Redr

    • Increases its number using bone meal.
  1. redirect Template:blockLink

Template:Redr

    • Absorbs water.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Grow.
    • Melon or pumpkin is removed from them.
  1. redirect Template:blockLink

Template:Redr

    • Grows.
    • Its fruits are collected.
  1. redirect Template:blockLink

Template:Redr

    • Its number decreases.
  1. redirect Template:blockLink

Template:Redr

    • Grows, changes its shape, grows out a new vine block.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Turn into a wither.
  1. redirect Template:blockLink

Template:Redr

    • Gets eaten by a sheep.
  1. redirect Template:blockLink

Template:Redr

    • Get eaten by a rabbit.
  1. redirect Template:blockLink

Template:Redr

    • Gets damaged.
  1. redirect Template:blockLink

Template:Redr

    • The Eye of Ender is placed.
  1. redirect Template:blockLink

Template:Redr

    • Generates.
  1. redirect Template:blockLink

Template:Redr

    • Bottles or potions are added into it.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Change their mode.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Grow.
  1. redirect Template:blockLink

Template:Redr

    • Changes its mode.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Becomes activated or deactivated.
  1. redirect Template:blockLink

Template:Redr

    • Its age or shape changes.
  1. redirect Template:blockLink

Template:Redr

    • Increase their stage.
  1. redirect Template:blockLink

Template:Redr

    • Its "disarmed" value changes.
  1. redirect Template:blockLink

Template:Redr

    • Become occupied or unoccupied.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • Generates as a nether portal.
  1. redirect Template:blockLink

Template:Redr

    • Add or remove hay bale below it.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Its shape changes.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Be covered or uncovered by snow.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr, and

  1. redirect Template:blockLink

Template:Redr

    • Grow.
    • Add or remove kelp/vines above/below it.
  1. redirect Template:blockLink

Template:Redr

    • Its signal changes.
  • All blocks
    • Change their blockstate using debug stick.
    • Placed by a command.
  1. redirect Template:blockLink

Template:Redrs and

  1. redirect Template:blockLink

Template:Redr

    • 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.

Template:Schematic

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.

Template:Schematic

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).

Template:Schematic

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.

Template:Schematic

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.

Template:Schematic

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.

Template:Schematic

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.


Then updates the immediate neighbors (in order of west, east, down, up, north, south) and 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 adjacent redstone wires (in order of north, east, south, west).

Then updates the immediate neighbors (in order of west, east, down, up, north, south) and 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 redstone wires above the solid blocks adjacent to the redstone wire (in order of north, east, south, west).

Then updates the immediate neighbors (in order of west, east, down, up, north, south) and 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 redstone wires below the non-solid blocks adjacent to the redstone wire (in order of north, east, south, west).

Template:Schematic Template:Schematic

Place. -1 Updates the immediate neighbors (in order of west, east, down, up, north, south) of the block above the wire.


Then updates the immediate neighbors (in order of west, east, down, up, north, south) of the block below the wire.

Then updates the immediate neighbors (in order of west, east, down, up, north, south) and 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 adjacent redstone wires (in order of north, east, south, west).

Then updates the immediate neighbors (in order of west, east, down, up, north, south) and 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 redstone wires above the solid blocks adjacent to the redstone wire (in order of north, east, south, west).

Then updates the immediate neighbors (in order of west, east, down, up, north, south) and 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 redstone wires below the non-solid blocks adjacent to the redstone wire (in order of north, east, south, west).

Template:Schematic Template:Schematic

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.

Template:Schematic

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).

Template:Schematic

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).

Template:Schematic

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
  1. redirect Template:blockLink

Template:Redr || Tries to melt.

  1. redirect Template:blockLink

Template:Redr

Tries to change its state.
  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

Template:Redr

Tries to change itself to be in the correct state.
  1. redirect Template:blockLink

Template:Redr

  1. redirect Template:blockLink

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

  1. 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

  1. 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.

  1. redirect Template:blockLink

Template:Redr

    • When being placed, if it should be powered, becomes powered.
  1. redirect Template:blockLink

Template:Redr

    • If in the nether, it turns into an dry sponge.
  1. redirect Template:blockLink

Template:Redr

    • When being placed, it absorbs water and turns into an wet sponge.
  1. redirect Template:blockLink

Template:Redr and

  1. redirect Template:blockLink

Template:Redr

    • When a powered target or observer is placed, it turns into an unpowered state.
  1. redirect Template:blockLink

Template:Redr

    • When being placed, it updates the signal and connection.
  1. redirect Template:blockLink

Template:Redr

    • When being placed, if it should be extinguished, removes itself.
  1. redirect Template:blockLink

Template:Redr

    • When being placed, if it should explode, removes itself.
  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr,

  1. redirect Template:blockLink

Template:Redr

    • When being placed, it updates its shape.
  1. redirect Template:blockLink

Template:Redr

    • When being placed, it checks whether it is pressed and updates its state.
  1. redirect Template:blockLink

Template:Redr

    • When being placed, if it should turn into a golem, removes itself.

Bedrock Edition

  1. Redirect Template:Empty section

History

Java Edition

Template:HistoryTable


Navigation

Versions
Development
Version history
Technical

See here for more information

Game customization
Editions
Merged
Ports to consoles
Discontinued
Development
Version history
Technical
Creator
Add-ons
Multiplayer
Exclusive features
Blocks
Mobs
Effects
Unused
Removed

de:Blockupdate ja:ブロック更新 lzh:塊竦 pt:Atualização de bloco zh:方块更新