The bug
Items with an Owner tag set to the name of a player cannot be picked up by other players, but can be picked up by mobs that can equip loot.
How to reproduce
/summon item ~ ~ ~ {Owner:[I;1,2,3,4],Item:{id:"cod",Count:1b}}Ensure mob griefing is enabled (/gamerule mobGriefing true), and summon a mob that can pick up loot:
/summon zombie ~ ~ ~ {CanPickUpLoot:1b}You'll notice the zombie pick up the fish that was not meant to be accessible by it.
Code analysis
Based on 26.2-snapshot-3
Players picking up items is handled in ItemEntity.playerTouch, whereas mobs picking up items is handled in Mob.aiStep. They both check for pickup delay, but only the former checks the item’s target (owner).
If it is on hard they aways can pick up anything. So if it is not on hard mode then it is a bug.😉