mojira.dev
MC-93841

Right clicking on a tamed wolf, ocelot or parrot causes it to sit / stand up and uses item

The bug

Right clicking on a tamed wolf, ocelot or parrot while holding an item makes the wolf, ocelot or parrot sit / stand up and uses the item.

How to reproduce

  1. Tame a wolf, ocelot or parrot

  2. Right click it while holding an item with right click action, for example a fishing rod
    → The pet will sit but you also used the item you are holding

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The methods net.minecraft.entity.passive.EntityWolf.processInteract(EntityPlayer, EnumHand) and net.minecraft.entity.passive.EntityOcelot.processInteract(EntityPlayer, EnumHand) both don't return true when the wolf or ocelot sits or stands up.

Important:

  • To not break the spawn egg and breeding behavior the methods should probably first call net.minecraft.entity.passive.EntityAnimal.processInteract(EntityPlayer, EnumHand).

  • To not break name tag behavior the methods should probably call net.minecraft.item.Item.itemInteractionForEntity(ItemStack, EntityPlayer, EntityLivingBase, EnumHand).

Linked issues

Comments 5

Can confirm.
Still persists in 1.10

Affects 1.14 and 1.14.1 Pre-Release 1

Affects 1.14.1

Looks fixed to me in 19w42a, can someone double check?

I believe this was fixed in 19w37a with the hand animation changes

marcono1234

(Unassigned)

Confirmed

(Unassigned)

cat, dog, ocelot, parrot, right-click, sit, stand, use-item, wolf

Minecraft 15w49b, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w40a, Minecraft 16w41a, ..., Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 19w11a, Minecraft 1.14, Minecraft 1.14.1 Pre-Release 1

19w37a

Retrieved