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

Checking entities in unloaded chunks with commands lags server dramatically

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • 1.15.2, 20w20b, 20w22a, 1.16 Pre-release 2, 1.16 Pre-release 3
    • None
    • Confirmed
    • Performance

      The bug

      A simple command can cause the server performance to drop to 4000 mspt.

      How to reproduce

      1. Put this command in a repeating command block
        /execute at @a if entity @e[distance=..200]
      2. Start moving into unloaded chunks while having the F3 graphs open
      3. Huge server lag spikes start appearing as you can see in the attached screenshots

      This is probably related or has the same root cause as MC-54932.

      Attached is also the debug profile results. It seems as if the command is trying to generate all the chunks, rather than just ignoring them. But the chunks aren't actually being generated because consecutive runs of these selectors still freeze the server.

      [05] |   |   |   |   |   ticking(42/2) - 99.94%/99.94%
      [06] |   |   |   |   |   |   #getChunkCacheMiss 586/27
      [06] |   |   |   |   |   |   #getChunk 104890/4994
      [06] |   |   |   |   |   |   execute at @a if entity @e[distance=..200](21/1) - 98.92%/98.92%

            Unassigned Unassigned
            Misoloo [Helper] Misode
            Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: