The bug
Item entities can be picked up even if the entity trying to pick them up is not the owner if the Age
value is >= 5800. Expected would be that there is no such special condition and items with an owner can never be picked up by a different entity.
How to reproduce
The following steps require that your UUID is not 00000000-0000-007b-0000-00000000007b
(Most: 123L, Least: 123L)
Summon an item with an
Age
of 0/summon item ~ ~ ~ {Owner:{M:123L,L:123L},Age:0,Item:{id:"stone",Count:1b}}
→ ✔ You cannot pick up the item
Summon an item with an
Age
>= 5800/summon item ~ ~ ~ {Owner:{M:123L,L:123L},Age:5800,Item:{id:"sandstone",Count:1b}}
→ ❌ You can pick up the item
Code analysis
Based on 1.12.2 decompiled using MCP 9.40
net.minecraft.entity.item.EntityItem.onCollideWithPlayer(EntityPlayer)
if (this.pickupDelay == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityIn.getName())) && entityIn.inventory.addItemStackToInventory(itemstack))
// ...
}
This appears to be related to MC-125511