Mojira Archive
MC-711

Tile ticks of connected redstone components might be executed in the wrong order when unloading/reloading chunks

The bug

Sometimes repeater clocks may freeze due to the way tile ticks are saved and updated. Most cases of that already got fixed and it already got a lot better compared to when the issue was created. This happens when the repeaters are in different chunks.

How to reproduce

  1. Move to a location outside of the spawn chunks. The spawn chunks are close to the location you are when you type /kill without having a bed spawn. Move far away from there.
  2. Hit F3 + G to show chunk borders.
  3. Build a repeater clock in such a way that the repeaters are located in two different chunks.
  4. Now move away from the clock in such a way that the chunk of one repeater is closer than the other. Move away until you can't see either of the repeaters anymore and maybe a little further to be extra sure. You can lower your render distance if you want to make this happening faster.
  5. Now move closer to your clock again. The clock is likely to be stuck now.

Why this happens

That happens because when you move away the chunks unload and so do the tile ticks of the repeaters. When you move closer again and the repeater that is in the chunk that was closer to you has a tile tick scheduled for turning on while the other has scheduled a tile tick for turning off, the chunk with the repeater that wants to turn on gets loaded first, the tile tick counts down and gets executed while the other repeater was not loaded the entire time and thus didn't yet turn off. Now both repeaters are turned on and the clock is broken.

This is certainly not easy to fix. I think in order to fix this, tile ticks need to be overhauled in general. A system where tile ticks can be "connected" so that if one of them is loaded, the other gets loaded as well might be an option.