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

30 second despawn immunity does not exist

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.19.0
    • 1.18.11 Hotfix, 1.18.10, 1.18.12 Hotfix, 1.18.30, 1.18.31
    • None
    • Confirmed
    • Windows
    • 720310

      The despawn changes made in 1.16.0 were supposed to include a 30 second despawn immunity timer according to bolded part of the following changelog statement:

      • If mobs are between 32 and 44 blocks from the nearest player, they must not take damage for 30 seconds as well as succeeding a 1 in 800 chance

      The 30s despawn immunity does not exist in the current version and it appears it was never fully implemented. Mobs have a HurtTime signed integer NBT entry but it is always set to 0. (Checked with MCCToolchest in world with chunks generated prior to the 1.16.100 chunk storage format changes.) It should probably be set to 600 at spawn and whenever the mob takes damage, and then reduced by 1 each game tick.

      This has two major impacts:

      • Mobs can spawn in sight of the player but then despawn before the player has enough time to reach them for an interaction (whether to kill, to tame, to nametag, etc.). This makes it harder to get rarer mobs like zombie villagers, donkeys, and axolotl (MCPE-140859) when you go looking for them.
      • Mob farm rates are significantly lower than they would otherwise be. For example, a farm module that averages only 9 seconds to kill a mob after it spawns will lose 20% of its mobs to random depsawns before they are killed, if the module and kill area is >32 blocks from the player. (This can be calculated using https://www.dskjal.com/statistics/chance-calculator.html)

      Steps to reproduce

      1. Open Despawn immunity test.mcworld. It is a flat world set to simulation distance 4 with two platforms 32 blocks apart.
      2. Stand on the blocks at X = -1, Y = 100 and watch the platform at X = 32, Y = 100.
      3. When a monster spawns, start a stopwatch and watch the monster until it despawns.
      4. Repeat steps (1) - (2), then when a mob spawns fly over and hit it and start a stopwatch, then fly back to the X = -1 platform and watch the mob.

      Expected results

      Mobs would never despawn sooner than 30s after spawning or 30s after taking damage.

      Observed results

      Mobs often despawn sooner than 30s after spawning or after taking damage.

        1. buh bye.mp4
          578 kB
          [Mod] GoldenHelmet
        2. Despawn immunity test.mcworld
          15 kB
          [Mod] GoldenHelmet

            GoldenHelmet [Mod] GoldenHelmet
            Votes:
            77 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: