Mojira Archive
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).