Mojira Archive
MC-87949

The shield use statistic is not working

The bug

The scoreboard objective type minecraft.used:minecraft.shield does not work. I expected it to increase when a player blocks with a shield, however this is not the case.

How to reproduce

  1. Type /scoreboard objectives add UseShield minecraft.used:minecraft.shield
  2. Type /scoreboard objectives setdisplay sidebar UseShield (to display value)
  3. Type /scoreboard players set @s UseShield 0 (so the value is visible on sidebar)
  4. Block with shield while taking damage from a mob
    Notice the value hasn't increased

Code analysis

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why the statistic value is not increasing is because the method net.minecraft.item.ItemShield.onItemRightClick(ItemStack, World, EntityPlayer, EnumHand) is not calling playerIn.triggerAchievement(StatList.func_188057_b(this));.