Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-21713

Looting enchantment doesn't affect raw/cooked chicken drops from chickens

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Minecraft 1.5.1, Minecraft 1.6, Minecraft 1.6.1
    • Windows 7 (x64), Java 7 (x64)
    • Unconfirmed
    • Creative

      A chicken will always drop exactly one raw chicken (item ID #365), or cooked chicken (#366) if on fire, regardless of what level of Looting was used to kill it, unlike pretty much any other item dropped by a mob (including feathers from chickens.)

      I have identified the cause of this behavior. Observe the following method, taken from the MCP-decompiled source of Minecraft 1.4.7 (evidence suggests that this particular method has not substantially changed as of 1.6.1). The identifiers used are MCP's:

      EntityChicken.java
          /**
           * Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param
           * par2 - Level of Looting used to kill this mob.
           */
          protected void dropFewItems(boolean par1, int par2)
          {
              int var3 = this.rand.nextInt(3) + this.rand.nextInt(1 + par2);
      
              for (int var4 = 0; var4 < var3; ++var4)
              {
                  this.dropItem(Item.feather.itemID, 1);
              }
      
              if (this.isBurning())
              {
                  this.dropItem(Item.chickenCooked.itemID, 1);
              }
              else
              {
                  this.dropItem(Item.chickenRaw.itemID, 1);
              }
          }
      

      Enclosing the if(this.isBurning()) statement inside a loop similar to the for loop above would fix the issue.

            Unassigned Unassigned
            bedelato Ben W
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: