Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-123696

Chunks save some scheduled block updates of other chunks causing updates to be performed twice

XMLWordPrintable

    • Confirmed
    • Performance

      The bug

      Chunks can save some scheduled block update of other chunks in their TileTicks list which are then, once the chunk is loaded, performed too resulting in updates performed twice.

      Comments on MC-711 might partwise be describing this bug.

      How to reproduce

      1. Create a superflat world with the following preset
        minecraft:sandstone;minecraft:the_void;
        
      2. Set the render distance to 6
      3. Run the following commands
        /setworldspawn 100000 0 0
        /teleport 110.5 1.0 0.5
        /setblock 111 1 0 command_block{Command:"/teleport @p 0 ~ 0 -90 0"}
        /setblock 110 1 0 stone_button[facing=west]
        /setblock 110 1 1 dispenser[facing=south]{Items:[{Slot:0b,id:"stone",Count:2b}]}
        
      4. Press the button
      5. Move in positive x-direction until you reach the blocks you placed before
        The dispenser shot out two items

      You might have to repeat the reproduction steps multiple times in case the chunk did not unload fast enough.

      Code analysis

      Based on 1.12.2 decompiled using MCP 9.40

      The method net.minecraft.world.WorldServer.getPendingBlockUpdates(Chunk, boolean) creates a bounding box which is extended 2 blocks in the negative x- and z-directions.
      It is unclear so far why this was done.

      In 19w46b: (Mojang name) net.minecraft.world.level.ServerTickList.fetchTicksInChunk(ChunkPos, boolean, boolean)

            Unassigned Unassigned
            marcono1234 [Mod] Marcono1234
            Votes:
            12 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: