Affects Version/s: Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.13, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 3
Fix Version/s: None
In creative mode with cheats enabled:
- Use a piston to push a block into the block occupied by your feet
- Place a minecart rail on the block occupied by your head
- Place blocks on either side of the rail so that the minecart will not roll away
- Place a hopper minecart on the rail
- Execute /give @s minecraft:apple (or any other valid /give command)
The player picks up the item, and the hopper minecart does not.
Both the player and the hopper minecart pick up the item, duplicating it.
- Have the item entity determine when it can be picked up, and which entity/block entity to transfer its contents to
- When an entity/block entity attempts to pick up an item, make a temporary copy of the item stack, attempt to delete the item entity, and give up if the item entity is already deleted
- When any entity/block entity attempts to take an item from an item entity, make the operation atomic - do not allow any other attempts to interact with the item entity until the first attempt is complete
The following is based on a decompiled version of Minecraft 1.12 using MCP 9.40pre-1. – [Mod] Bemoty
The /give command puts the item specified in the second argument of the command into the inventory of the player specified in the first argument of the command. With that, it also summons a so called "fake item" with an infinite pickup delay (32767) and an age of 5999 at the position of the player. The issue here is that net.minecraft.tileentity.TileEntityHopper and net.minecraft.entity.item.EntityMinecartHopper don't check an item for its pickup delay, the Minecart with a hopper at the position of the player's head therefore captures the fake item, which it obviously shouldn't.
I managed to fix this bug by creating a public getter for the delayBeforeCanPickup field in the net.minecraft.entity.item.EntityItem class, adding a for-loop to check if the picked up item has a pickup delay other than 32767 to the captureDroppedItems() method of net.minecraft.entity.item.EntityMinecartHopper, and adding a simple if-statement to the already existing for-loop in the captureDroppedItems() method of net.minecraft.tileentity.TileEntityHopper.