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

Item frames cannot be emptied if gamerule doEntityDrops is set to false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.16.2 Pre-release 2
    • Minecraft 18w22c, Minecraft 1.13-pre2, Minecraft 1.13-pre5, Minecraft 1.13-pre6, Minecraft 1.13, Minecraft 18w31a, Minecraft 18w33a, Minecraft 1.13.1-pre1, Minecraft 1.13.1, Minecraft 1.14.1, 1.14.4, 19w34a, 1.15, 1.15.1, 1.15.2 Pre-Release 1, 1.15.2, 20w06a, 20w14a, 20w17a, 20w19a, 20w21a, 1.16.1, 1.16.2 Pre-release 1
    • Confirmed
    • Entities

      The bug

      If the gamerule doEntityDrops is set to false, it is impossible to empty item frames.

      To reproduce

      1. Run /gamerule doEntityDrops false
      2. Place an item frame
      3. Place an item inside of the frame
      4. Try to punch the item frame in order to take the item out
        Notice that it plays the "pop" noise, but does not drop the item.

      Code analysis

      In 1.12.2, items were removed from item frames by the method EntityItemFrame.attackFromEntity(damageSource, amount). In 1.13, this is now done in the method EntityItemFrame.dropItemOrSelf(entity, self). Since the latter method only runs if doEntityDrops is true, the code that removes the item cannot be reached.

      Do note this change was likely made while fixing MC-124833.

            Ulraf [Mojang] Ulraf
            Jayceebee Synthestra
            Votes:
            31 Vote for this issue
            Watchers:
            16 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: