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

Mobs glitch out of position during chunk loading

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.20.32 Hotfix
    • 1.17.11 Hotfix, 1.19.31 Hotfix, 1.19.40
    • None
    • Confirmed
    • Multiple
    • 631470

      When a chunk resumes ticking after not being ticked for a while, the game checks for mobs colliding with blocks and resolves them by displacing the mob if possible. However, the rules used at these times to resolve collisions with (at least certain) nonsolid blocks are different from those used during continuous gameplay. This causes mobs to be unexpectedly displaced at times long after the collision occurred, such as the first time a player comes near after reloading the world or returning from another dimension.

      Impact: I first noticed this in a villager breeder that holds two villagers in a 1 x 2 x 2 space where they're standing on a pair of adjacent glass panes and trapdoors are folded down over their heads. (This is a well-known and common design.) During building and subsequent gameplay, the collisions of the trapdoors with the villagers does not displace them, but if you save and reload the world, or leave and return via a Nether portal, or probably if you move out of simulation range for a long enough time, when ticking in the chunks resumes one of the villagers will almost always glitch down through the glass panes and the breeder will no longer work.

      Similar collision mechanics are used in other farms which would presumably be affected, too. For example, a common way to pacify a ghast is to push a glass block into its head, another collision that doesn't displace the ghast if it's confined. While I haven't tested this specifically, I have tested other mobs into whose heads I pushed a glass block, and they were displaced when I reloaded the world.

      I have attached a world save that demonstrates this bug, but there are many additional configurations that exhibit it. The repro steps below therefore refer to the following menus of the known mobs and nonsolid blocks that can be used.

      Mobs Any mob that requires a 1 x 2 x 1 space to spawn. (I tested all but piglin, piglin brute, and wither skeleton.)
      Standing on Glass pane with no side attachments
      Iron bars with no side attachments
      End rod (vertical)
      Lightning rod (vertical)
      Brewing stand
      Fence with no side attachments
      Wall with no side attachments
      Colliding with Trapdoor, glass block, glass pane, bottom slab

      Steps to reproduce:

      1. Build a 1 x 2 x 1 enclosure several blocks above the ground, leaving it open at the top and bottom. You can use glass blocks or panes in places for convenience, as long as the enclosure can keep a mob confined to the 1 x 1 space.
      2. Place one of the Standing on blocks under the enclosure for a mob to stand on.
      3. Spawn or summon one of the Mobs inside the enclosure.
      4. Use a piston to push one of the Colliding with blocks into the mob's upper half. Or, if using a trapdoor, attach it to one of the blocks beside the mob's upper half, then fold it down over the mob's head.
      5. Observe that the mob is not displaced by the collision. If you like, you can withdraw and replace the collision block several times to confirm that this behavior is predictable.
      6. Save the world, then reload it. (Alternative: Use a Nether portal, then return.)

      Expected result:
      The mob is in the same position you left it in when you saved.

      Actual result:
      The mob has been displaced, usually downward through the block it was standing on.
      (Results vary: Depending on the mob's collision box dimensions, a mob standing on a fence or wall might be displaced upward on top of a trapdoor or slab, or a mob standing on a brewing stand might be displaced downward into but not through the stand because the stand's base is too wide for it to slide past.)

      Additional notes:
      In the villager breeder, where two mobs are confined side by side, the usual displacement mode is a little different. Each of the mobs has a trapdoor closed over its head. Normally, a mob would collide with a closed trapdoor and wouldn't be able to be displaced into one from outside, but this bug causes one of the mobs to be displaced into the other mob's trapdoor. The second mob is then displaced downward by the combined collisions with the trapdoor and the first mob, and falls through the glass pane.

        1. Collisions.mcworld
          566 kB
        2. Minecraft 2021-08-16 08-37-39_Trim.mp4
          3.16 MB
        3. Zombie glitch 1.png
          Zombie glitch 1.png
          188 kB
        4. Zombie glitch 2.png
          Zombie glitch 2.png
          157 kB
        5. Zombie glitch 3.png
          Zombie glitch 3.png
          177 kB

            Auldrick [MCPE Mod] Auldrick
            Votes:
            8 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: