-
Bug
-
Resolution: Fixed
-
Minecraft 1.12.2, Minecraft 18w07b, Minecraft 1.13-pre5, Minecraft 1.13.1, 1.14.4, 19w46b
-
Confirmed
-
(Unassigned)
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)) // ... }