Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-125495

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 1.15 Pre-release 1
    • 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)

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

            slicedlime [Mojang] slicedlime
            marcono1234 Marcono1234
            Votes:
            5 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: