Mojira Archive
MC-112991

Carrot/Warped fungus on a stick usage statistic value is increased even if item is not used

The bug

When you right click with a carrot on a stick it always increases the usage statistic value for it even if you did not really use it.

I know that this is a technique used by map makers, but it would be better to have a generic way to detect right clicks than to rely on situations like this.

How to reproduce

  1. Add an objective with the minecraft.used:minecraft.carrot_on_a_stick criteria, set it to display on your sidebar, and set your score to 0 so it displays
    /scoreboard objectives add carrotOnAStick minecraft.used:minecraft.carrot_on_a_stick
    /scoreboard objectives setdisplay sidebar carrotOnAStick
    /scoreboard players set @s carrotOnAStick 0
    
  2. Right click with a carrot on a stick while not riding a pig

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

The method net.minecraft.item.ItemCarrotOnAStick.onItemRightClick(World, EntityPlayer, EnumHand) always increases the usage statistic value.