mojira.dev
MC-84789

Wolves still beg for bones after being tamed

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.

Linked issues

Attachments

Comments 55

I hope it is not intended

My edition of the description and title was more correct,wild wolves always tilt their head for meat,it is intended

Still in 1.9 release

Confirmed for 1.9.3-pre2

45 more comments

Can confirm for 1.17

Can confirm in 1.17.1 Release Candidate 1.

As of 1.21, wild wolves now beg for bones. At least that part of this problem is resolved.
Is it intentional that tamed wolves also beg? To what others have said, they don't consume them, so I wouldn't think that they should.

As of 1.21.4, wild wolves now tilt their heads, so this should be changed to "tamed wolves are still interested in bones" or "tamed wolves don't take bones" etc. This issue needs to be closed if the current behavior is intended.

@himazinn_Japan I'll check it when I get home

Serouj Ghazarian

(Unassigned)

Confirmed

Gameplay

Low

Mob behaviour

bone, wolf

Minecraft 15w31c, Minecraft 15w32a, Minecraft 15w36d, Minecraft 15w45a, Minecraft 15w51a, ..., 24w09a, 24w10a, 24w13a, 1.20.5 Pre-Release 1, 1.20.5 Pre-Release 2

Retrieved