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
    • 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 remove 'this.wolf.isTamed() &&' from line
                  if (this.wolf.isTamed() && itemstack.getItem() == Items.BONE)
                  {
                      return true;
                  }
      
                  if (..)
                  {
                      ..
                  }
              }
              return false;
          }
      

      To fix this, the isTamed boolean will need to be removed from the if-statement.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  CHK: