mojira.dev
MC-125495

Owner tag of item entities is ignored if entity is destroyed in 200 ticks (Age >= 5800)

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)

  1. 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

  2. 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))
    // ...
}

Comments 1

This appears to be related to MC-125511

marcono1234

slicedlime

Confirmed

(Unassigned)

Age, Owner, item, item-entity

Minecraft 1.12.2, Minecraft 18w07b, Minecraft 1.13-pre5, Minecraft 1.13.1, 1.14.4, 19w46b

1.15 Pre-release 1

Retrieved