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

Sitting child pets teleporting to owner when growing up

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 1.7.1, Minecraft 1.7.2, Minecraft 1.7.4, Minecraft 1.7.10, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.4, Minecraft 1.8.8, Minecraft 1.10, Minecraft 1.10.2, Minecraft 1.11.2, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w48a, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 18w09a, Minecraft 18w14b, Minecraft 18w22c, Minecraft 1.13-pre1, Minecraft 1.13-pre3, Minecraft 1.13-pre6, Minecraft 1.13-pre10, Minecraft 1.13, Minecraft 18w30b, Minecraft 18w31a, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 1.14 Pre-Release 5, Minecraft 1.14
    • Confirmed
    • Mob behaviour

      The bug

      Sitting child pets can teleport to their owner when they grow up but immediately appear sitting again afterwards.

      How to reproduce

      1. Spawn one wolf and tame it
      2. Hold right click on the wolf while holding a wolf spawn egg to spawn baby wolves
      3. Make all wolves sit
        /entitydata @e[type=wolf] {Sitting:1b}
        
      4. Move away from the wolves
      5. Change their age so they will grow up rather fast
        /entitydata @e[type=wolf] {Age:-100}
        

        → Some wolves teleported to you

      Code analysis

      Based on 1.12 decompiled using MCP 9.40 PRE 1

      It looks like the method net.minecraft.entity.Entity.setSize(float, float) is indirectly causing this since it is calling the method net.minecraft.entity.Entity.moveEntity(MoverType, double, double, double) without a downwards motion. This causes the onGround field to be set to false which then causes the EntityAISit task to be reset.

      Calling that method with the default gravity downwards motion (if the entity has gravity enabled) might result in unexpected behavior. Instead the onGround value could be restored or only motion values could be set, but this could result in different behavior as well.

            Unassigned Unassigned
            offyerrocker Keenan Lee
            Votes:
            45 Vote for this issue
            Watchers:
            23 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: