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

Entities stay on the global list even when the chunk unloaded

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 19w12b
    • Minecraft 18w50a, Minecraft 19w02a, Minecraft 19w03c, Minecraft 19w04a, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w06a, Minecraft 19w07a, Minecraft 19w08b, Minecraft 19w09a, Minecraft 19w11b
    • None
    • Confirmed

      The bug

      Entities keep being accessible via the global entity list, even after the chunk they belong to appears to be unloaded (blocks can't be accessed with commands).
      It appears that the entities only get removed from the global list once all chunks in a 23×23 area around them are unloaded. Though that might only be the case when the player leaves the chunks. By changing the render distance I was also able to get entities staying on the list which were over 30 chunks from the next loaded chunk.

      How to reproduce

      Setup: Superflat world, render distance 8.

      1. Teleport away from the spawn
        /tp 10000 100 0
        
      2. Summon a tagged armor stand
        /summon minecraft:armor_stand ~ ~ ~ {Tags:[MC141484]}
        
      3. Run the following commands
        /execute at @e[tag=MC141484] as @e[tag=MC141484,distance=..1] run say @s
        /say @e[tag=MC141484]
        

        → Both should output the entity

      4. Teleport about 10 chunks away.
        /tp ~160 ~ ~
        
      5. Run the commands again
        /execute at @e[tag=MC141484] as @e[tag=MC141484,distance=..1] run say @s
        /say @e[tag=MC141484]
        

        → Only the latter will output the entity now

      Interpretation

      /say @e[tag=MC141484]
      

      This command will find entities using the global entity list, so it will be able to find the entity when it is on there.


      /execute at @e[tag=MC141484] as @e[tag=MC141484,distance=..1] run say @s
      

      This command will first find the entity using the global list but then use the local chunk list to find the entity again. Only if the entity can be found on both lists it will produce an output.

      The bug is, that the entity is not removed from the global entity list.

      If you keep moving further way and keep checking with the global entity list command, you will find that the entity will get removed from the global list once all chunks in a 23×23 area around it are unloaded.

        1. sand.txt
          90 kB
        2. levels.txt
          1 kB
        3. grass.txt
          95 kB
        4. force.txt
          30 kB
        5. chunks-before.png
          chunks-before.png
          32 kB
        6. chunks-after.png
          chunks-after.png
          32 kB

            boq [Mojang] Bartosz Bok
            panda4994 [Mojang] Panda
            Votes:
            17 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: