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

Wolves still beg for bones after being tamed

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • Minecraft 15w31c, Minecraft 15w32a, Minecraft 15w36d, Minecraft 15w45a, Minecraft 15w51a, Minecraft 15w51b, Minecraft 1.9, Minecraft 1.9.2, Minecraft 1.9.3 Pre-Release 2, Minecraft 1.10.2, Minecraft 16w39a, Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 18w07c, Minecraft 18w08a, Minecraft 18w09a, 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 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w48a, Minecraft 18w48b, Minecraft 18w49a, Minecraft 18w50a, Minecraft 1.14 Pre-Release 5, Minecraft 1.14, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 1, Minecraft 1.14.3, 1.14.4, 19w35a, 19w37a, 19w39a, 19w40a, 19w42a, 1.15 Pre-release 1, 1.15 Pre-release 6, 1.15.2, 20w09a, 20w10a, 20w11a, 20w12a, 20w13a, 20w13b, 20w14a, 20w15a, 20w16a, 20w17a, 20w18a, 20w19a, 20w20a, 20w21a, 20w22a, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 5, 1.16 Pre-release 6, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w27a, 20w28a, 20w29a, 1.16.2 Pre-release 2, 1.16.2, 1.16.3, 1.16.4 Pre-release 1, 1.16.4, 20w46a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w10a, 21w11a, 21w15a, 21w17a, 21w18a, 1.17, 1.17.1 Release Candidate 1, 1.17.1, 1.18 Pre-release 1, 22w05a, 1.18.2, 22w13a, 22w15a, 22w18a, 22w19a, 1.19 Pre-release 1, 1.19 Pre-release 2, 1.19 Pre-release 3, 1.19 Pre-release 4, 1.19 Pre-release 5, 1.19, 22w44a, 22w46a, 1.19.3 Pre-release 1, 1.19.3 Pre-release 2, 1.19.3, 23w04a, 23w05a, 23w18a, 1.20.2, 1.20.4, 23w51b, 24w05b, 24w06a, 24w09a, 24w10a, 24w13a, 1.20.5 Pre-Release 1, 1.20.5 Pre-Release 2
    • Confirmed
    • Mob behaviour
    • Low
    • Gameplay

      The bug

      Wild wolves smell the bone but don't tilt their heads,while tamed wolves don't want bones and tilt their heads anyway.

      Code analysis

      The following is based on a decompiled version of MC 1.12.2 using MCP 9.40.
      This issue is caused in the method net.minecraft.entity.ai.EntityAIBeg.hasTemptationItemInHand() because in one of the if-statements it checks if the wolf is tamed, if the wolf is not tamed, the wolf won't beg.

      private boolean hasTemptationItemInHand(EntityPlayer player)
          {
              for (...)
              {
                  ItemStack itemstack = player.getHeldItem(enumhand);
                  //Here it checks if the wolf is tamed, to fix change to '!this.wolf.isTamed()'
                  if (this.wolf.isTamed() && itemstack.getItem() == Items.BONE)
                  {
                      return true;
                  }
      
                  if (..)
                  {
                      ..
                  }
              }
              return false;
          }
      

      To fix this, the isTamed boolean will need to be negated in the if-statement.

        1. 2015-08-02_14.13.57.png
          2015-08-02_14.13.57.png
          152 kB
        2. 2015-08-02_14.14.07.png
          2015-08-02_14.14.07.png
          169 kB
        3. 2016-07-11_14.02.15.png
          2016-07-11_14.02.15.png
          64 kB
        4. 2020-06-14_00.18.01.png
          2020-06-14_00.18.01.png
          412 kB
        5. MC-84789.mp4
          5.20 MB
        6. strange behavior of the wolf.gif
          strange behavior of the wolf.gif
          2.47 MB
        7. Wolf Begging Feature.mp4
          8.81 MB

            Unassigned Unassigned
            seroujk Serouj Ghazarian
            Votes:
            42 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              CHK: