Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-134908

Non-persistent mobs despawn when player goes through portal near spawn point

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.17.10, 1.17.2 Hotfix
    • None
    • Confirmed
    • Windows
    • 577945

      Non-persistent mobs anywhere in an area of up to 7 chunks radius around the player spawn point are instantly despawned when the player goes through a portal. This appears to be because chunks in this area around the player spawn point remain in memory indefinitely and they are ticked at least once after the player changes dimensions. Since the player is no longer there, every chunk becomes an instant despawn chunk. By contrast, non-persistent mobs not within 7 chunks of a player spawn point do not despawn when the player changes dimensions, but are instead saved with the chunks, and those chunks are removed from memory.

      Steps to reproduce

      1. Load Portal spawn point despawn.mcworld. It has nether portals in the overworld at 5, 5; 201, 5; and 401, 5; and portals in the nether at corresponding coordinates. Each portal has a named baby husk and a repeat command block that together identify the portal in chat. On the nether side, a single repeat command block identifies all entities that are accessible to commands in chat (ie, that remain in memory). Each overworld portal also has a dispenser with husk eggs and a bed nearby. When you load the world, the local player is at the 5, 5 portal and the local player spawn point is set to the bed by the 401, 5 portal.
      2. Press the button on top of the dispenser by the 5, 5 portal to spawn a non-persistent husk.
      3. Go through the 5, 5 portal.
      4. Return through the portal you come out of in the nether.
      5. Set the player spawn point at the bed near the 5, 5 portal.
      6. Go through the 5, 5 portal.
      7. Return through the portal you come out of in the nether.

      Expected result

      In steps (6) - (7) the same thing happens as in steps (3) - (4): the non-persistent husk is still there.

      Actual result

      In step (7) the non-persistent husk is no longer there, because it despawns in step (6). You can see that the despawn happens when the player goes to the nether because after step (3) the husk reports itself in chat, and after step (6) it does not.

      Equivalent repro can be seen in Despawn by spawn point.mp4

            GoldenHelmet [Mod] GoldenHelmet
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: