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

Block with complex collisions around an exit nether portal cause more lag than blocks with simple collisions when entities go through them

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.4, 23w16a, 23w17a, 1.20 Pre-release 1
    • None
    • Confirmed
    • Collision, Performance
    • Normal
    • Platform

      When an entity goes through a nether portal, it checks blocks in a large radius around the exit position for collisions and offsets trying to avoid suffocation. This process of collision checking cause variable amount of lag depending on how complex the collision model of the blocks around the portal are. Blocks with complex collisions (like cauldron, hopper, closed fence gates, composters, etc), cause way more lag than simple blocks (like stone, glass, etc). 

      This complex collision checking was introduced in 22w45a seemingly a fix for MC-80032.

      Steps to reproduce:

      • Make a 3x3 portal in overworld
      • Go through this portal and extend the nether portal on the nether side to a 3x3 instead of a 2x3
      • Place a repeating command block to kill the non player entities
        • kill @e[type=!player,distance=..16]
      • Make a 6x6x6 cube using cauldrons sandwiching the portal (See nether screenshot)
      • Go back to overworld and place a repeating command block under the portal with
        • summon ravager ~ ~2 ~
      • Activate the this command block.
      • Profile the lag.
      • Repeat the same with simple collision block (stone or glass) or blocks with no collision (open fence gates)

      Observeration:

      • Complex collision blocks cause far more lag than simple blocks
      • All this lag is caused by the collision resolution part of code which was introduced in 22w45a

        1. 2023-04-26_12.53.23.png
          2023-04-26_12.53.23.png
          616 kB
        2. 2023-04-26_12.55.06.png
          2023-04-26_12.55.06.png
          521 kB
        3. nether-1.png
          nether-1.png
          301 kB
        4. overworld-1.png
          overworld-1.png
          65 kB

            Unassigned Unassigned
            ooio ooio
            Votes:
            6 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: