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

Pets disobeying sit commands by helping player when attacked and within a certain radius

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 1.14.1
    • Minecraft 1.4.2, Minecraft 1.4.5, Minecraft 1.6.2, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 1.7.5, Minecraft 14w21b, Minecraft 1.7.10, Minecraft 14w33c, Minecraft 14w34a, Minecraft 14w34b, Minecraft 14w34c, Minecraft 14w34d, Minecraft 1.8.1, Minecraft 1.8.7, Minecraft 1.8.9, Minecraft 15w51b, Minecraft 1.10, Minecraft 1.10.1, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w44a, Minecraft 17w06a, Minecraft 1.12, Minecraft 1.12.1, Minecraft 18w05a, Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w11a, Minecraft 1.13-pre1, Minecraft 1.13, Minecraft 1.13.1, Minecraft 18w50a, Minecraft 19w07a, Minecraft 19w12b, Minecraft 1.14 Pre-Release 1, Minecraft 1.14 Pre-Release 5
    • Confirmed
    • Survival
    • (Unassigned)

      The bug

      When the owner of a sitting pet is attacked within a 12 meters radius around the pet it stands up. For wolves this could be intended since they can help their owner, however often if not always the owner made them sit on purpose to not accidentally hit them or be pushed of blocks by them while fighting. But for pets which cannot attack, like ocelots or parrots, this behavior makes no sense.

      How to reproduce

      1. Tame a parrot and make it sit
      2. Spawn a monster within a 12 meters radius from the parrot and let it damage you
        → The parrot starts flying

      Code analysis

      Based on 1.12 decompiled using MCP 9.40 PRE 1

      The method net.minecraft.entity.ai.EntityAISit.shouldExecute() cancels sitting if the owner is within 12 meters and net.minecraft.entity.EntityLivingBase.getAITarget() does not return null.

            Unassigned Unassigned
            jackoo81533 jake mcnaughton
            Votes:
            59 Vote for this issue
            Watchers:
            28 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: