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

Tamed wolves beg for bones while wild wolves don't

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 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
    • Fix Version/s: None
    • Labels:
    • Confirmation Status:
      Confirmed
    • Category:
      Entities

      Description

      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.

        Attachments

        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. strange behavior of the wolf.gif
          strange behavior of the wolf.gif
          2.47 MB

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              seroujk Serouj Ghazarian
              Votes:
              16 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                CHK: