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

Mob spawning algorithm is super slow

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: Minecraft 18w20a, Minecraft 18w20b, Minecraft 18w20c, Minecraft 18w21a, Minecraft 18w21b, Minecraft 18w22a, Minecraft 18w22b, Minecraft 18w22c, Minecraft 1.13-pre1
    • Fix Version/s: Minecraft 1.13-pre2
    • Labels:
      None
    • Confirmation Status:
      Community Consensus

      Description

      The bug

      The mob spawning algorithm is slow and impacts the game's TPS. This is mostly noticeably in a flat world with the gamerule doMobSpawning enabled; the tps heavily decreases. When checking the source with /debug, it showed mobSpawner as source:

      [00] levels - 99.62%/99.62%
      [01] |   New World - 99.82%/99.45%
      [02] |   |   tick - 98.85%/98.30%
      [03] |   |   |   mobSpawner - 91.42%/89.87%
      [03] |   |   |   entities - 6.79%/6.67%
      

      The lag impacts all worlds, but the amount of impact depends on how many mobs are able to spawn. (normal world with high render distance will lag more than a normal world with low render distance, for example)

      How to reproduce (using a flat world, since it's most noticeably there)

      1. Create a flat world (default settings)
      2. Observe that everything is really slow (slimes, animals, sun)
      3. Disable doMobSpawning:
        /gamerule doMobSpawning false
      1. Now the tps is back to normal

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rherlitz Rikard Herlitz
                Reporter:
                AlexMCool Alex³
              • Votes:
                18 Vote for this issue
                Watchers:
                10 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: