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

Falling block entity drops block with metadata of item dropped when block would be mined causing malformed drops

XMLWordPrintable

    • Confirmed

      The bug

      Dropping a falling block entity causes the generated block item to get the metadata the item, which would be dropped if the block was mined, would have. This causes incorrect or malformed items for blocks which drop a different item with different metadata when mined.

      Affected blocks

      This lists blocks where this behavior creates incorrect or malformed items.
      Last updated for 1.11.2

      Lapis ore

      Drops the ore block with a metadata value of 4, the value the dye would have to be lapis lazuli.

      /summon falling_block ~ ~ ~ {Block:"lapis_ore",Time:1024}
      
      Double tallgrass

      Drops a sunflower instead. This happens because when broken by hand it drops wheat seeds with metadata of 0 instead of the double plant item.

      /summon falling_block ~ ~ ~ {Block:"double_plant",Time:1024,Data:2b}
      
      Acacia and dark oak leaves

      See MC-94830

      /summon falling_block ~ ~ ~ {Block:"leaves2",Time:1024,Data:0b}
      

      Code analysis

      Using MCP mappings for 1.11, though the names should be same for 1.11.2

      In EntityFallingBlock.func_70071_h_ (onUpdate), an ItemStack is constructed to drop. The Block of the falling tile is passed, with the meta being set via a call to Block.func_180651_a (damageDropped). In the case of Lapis Ore, the damageDropped call returns a meta value for use with the dye item, since lapis ore drops the dye item. However, here the meta value is paired with an unintended item, the actual block, instead of the dye item, thus resulting in this invalid drop.

            Unassigned Unassigned
            williewillus williewillus
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: