mojira.dev
MC-125496

Hoppers ignore PickupDelay and Owner of item entities making the tags useless

The bug

Hoppers and hopper minecarts ignore the PickupDelay and Owner tags of item entities completely defeating their purpose.

Expected would be that EntityItem provides for example two methods (ignores MC-125495):

// Pseudo code

/**
 * Returns if the pickup delay is over.
 * 
 * @return If the pickup delay is over.
 */
private boolean isPickupDelayOver() {
    return this.pickupDelay == 0;
}

/**
 * Returns if the item entity can be picked up by the given entity. For non-entities call {@code #canBePickedUp()}.
 * 
 * @param entity The entity which should be tested
 * @return If the given entity can pick up this item entity 
 */
public boolean canBePickedUp(Entity entity) {
    if (this.isPickupDelayOver()) {
        if (this.owner == null || this.owner.equals(entity)) {
            return true;
        }
    }
    
    return false;
}

/**
 * Returns if the item entity can be picked up by a non-entity. For entities call {@code #canBePickedUp(Entity)}.
 * 
 * @return If the item entity can be picked up by a non-entity
 */
public boolean canBePickedUp() {
    return this.isPickupDelayOver() && this.owner == null;
}

How to reproduce

  1. Place a hopper

  2. Stand on the hopper and use the following command

    /summon item ~ ~ ~ {PickupDelay:10000s,Item:{id:"stone",Count:1b}}

    → ❌ The item is picked up by the hopper

Linked issues

Comments 2

This is not a bug! Specially hoppers ignoring PickupDelay.
Fixing this would screw over the entire community in an unimaginable way. The vast majority of farm collections would break.
 
 

marcono1234

(Unassigned)

Confirmed

Commands, Items

Owner, PickupDelay, hopper, hopper_minecart, item-entity

Minecraft 1.12.2, Minecraft 18w07b, Minecraft 18w20c, Minecraft 18w22c, Minecraft 1.13-pre1, ..., 1.16.4, 1.17, 1.19.3, 1.20.2, 23w43a

Retrieved