Item frames cannot be emptied if gamerule doEntityDrops is set to false
The bug
If the gamerule doEntityDrops is set to false, it is impossible to empty item frames.
To reproduce
- Run /gamerule doEntityDrops false
- Place an item frame
- Place an item inside of the frame
- 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.
2018-05-31, 06:48 PM
2023-10-21, 08:06 AM
2020-08-05, 04:08 PM
31
17
Minecraft 18w22c - 1.16.2 Pre-release 1
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