mojira.dev
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.

    [media]

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.

Linked issues

MC-638 Chunks unload via teleporting with command block before a button or pressure plates unpowers Resolved MC-3284 Redstone repeaters "freezes" and stop repeating the signal Resolved MC-3812 Redstone circuitry freezing in on/off state when chunk is unloaded Resolved MC-4875 When I walk away from my constructions that use Redstone clocks infinite, this clock goes off or gets a continuous stream. Resolved MC-5019 Command Block /tp Command Resolved

Attachments

Comments 136

I was having a similar problem in an earlier snapshot with a teleporter I'd built. I had it set up so you had to stand on a pressure plate and hit a button simultaneously in order to trigger the command block, then when returning, sometimes either the button or the pressure plate were stuck in the 'on' position, making the teleporter behave incorrectly. This would only happen when teleporting to a location far enough away that the server would unload the chunk the teleporter was in, but it wouldn't happen every time, maybe about 30% of the time. I haven't had this problem since the 1.4 prerelease, but maybe I've just been lucky.

This is because the redstone unloads before it turns off again. A temporary work-around is to do multiple short jumps that still load the redstone, allowing it to turn off.
So instead of:
Teleporter A ===tp 42 chunks==> Place B
Do the following:
Teleporter A ===tp 10 chunks==> Teleporter C ===tp 10 chunks==> Teleporter D ===tp 10 chunks==> Teleporter E ===tp 10 chunks==> Teleporter F ===tp 2 chunks==> Place B
It's tedious, but you'll have to make do with it for now.

btw that work around is relative to the draw distance the server is set up for it can be low as 4 or high as 16chunks.

Which is why I used 10 as an example, as 10 is the default for vanilla servers. I don't think most servers would change it, let alone decrease it (increasing it makes more sense).

João Mambelli

This bug will be fixed?

126 more comments

Can confirm in 1.19.3

Can confirm in 23w03a

Can confirm in 23w04a

Can confirm in 23w06a

Can confirm in 1.20.1

nick pomroy

NeunEinser

(Unassigned)

Confirmed

Platform

Low

Chunk loading, Redstone

chunk, redstone, reload, scheduled-block-updates, teleport

Minecraft 1.4.2, Minecraft 1.4.5, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w03a, ..., 23w03a, 23w04a, 1.20.4, 24w12a, 24w33a

Snapshot 13w10b

Retrieved