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

Lag spike when crossing certain chunk borders

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 23w16a
    • 1.14.4, 19w39a, 19w40a, 19w41a, 1.15 Pre-release 1, 1.15.1, 1.15.2, 20w06a, 20w12a, 20w17a, 20w18a, 1.16 Pre-release 2, 1.16 Pre-release 4, 1.16 Pre-release 5, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2, 1.16.3, 1.16.4 Pre-release 2, 1.16.4, 20w45a, 20w46a, 20w49a, 1.16.5, 21w06a, 21w08b, 21w11a, 21w15a, 21w16a, 21w18a, 21w20a, 1.17 Pre-release 4, 1.17 Pre-release 5, 1.17 Release Candidate 1, 1.17 Release Candidate 2, 1.17, 1.17.1 Pre-release 1, 1.17.1 Release Candidate 1, 1.17.1, 21w40a, 21w44a, 1.18 Pre-release 1, 1.18 Pre-release 5, 1.18 Release Candidate 3, 1.18, 1.18.1 Pre-release 1, 1.18.1, 22w07a, 1.18.2 Pre-release 1, 1.18.2, 22w12a, 22w17a, 22w18a, 1.19, 1.19.2, 1.19.3, 23w07a, 1.19.4
    • None
    • Confirmed
    • Performance
    • Important

      The bug

      I've encountered some sort of lag spike which I narrowed down to be a floating structure. This structure can be a single block.

      The lag spike seems to occur when I'm moving into the spawn chunks while an elevated block is placed on the opposite side of the spawn chunks. It occurs when the block is at Y96 or higher.

      To replicate what I did on a 1.14.4 vanilla server:

      • Create a default world with seed: -4952361208952771886
      • Place a block at x 143 y 63 z -371 and another block at x 144 y 63 z -371. This is the location to test for the lag.
      • Place a block at x 307 y 96 z -302. This will be the block to create the lag.
      • Set the spawn point to x 227 y 66 z -376
      • Walk back and forth over the two blocks you placed earlier.
      • If you see a stutter, feel free to remove the block at x 307 y 96 z -302 and check again. Lag will be gone.

      I cannot attach the video as the file size is slightly too large but you may watch it here: https://youtu.be/jmtq3jcXujo

      I should note that it is not specific to my PC. It occurs on other clients on other devices.

      Render distance will affect where the lagspike occurs in vanilla singleplayer, but is relative to the view-distance on servers. I believe it's distance + 1 in chunks, or there abouts.

      Code analysis

      Code analysis and further explanation by PhiPro can be found in this comment. There also exists a Fabric mod that fixes this issue: comment.

        1. projet-sans-nom_pWthAUOB.compressed-1.mp4
          8.73 MB
        2. Minecraft 2023.01.21 - 01.23.46.04_Trim.mp4
          9.70 MB
        3. MC-162253.png
          MC-162253.png
          3.33 MB
        4. MC-162253.mp4
          5.08 MB
        5. Danielps1818.zip
          156 kB
        6. 2023-01-21_01_24_55-What A Crowded World!-1_19_3.zip
          70 kB
        7. 2020-03-31_12.25.37.png
          2020-03-31_12.25.37.png
          3.30 MB

            gegy1000 [Mojang] Gegy
            Tencryn Tencryn
            Votes:
            445 Vote for this issue
            Watchers:
            174 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: