Cardinal Components API

Cardinal Components API

21M Downloads

ItemStack have no components when picked up

biom4st3r opened this issue ยท 2 comments

commented

When you try to recollected a dropped ItemStack any components are not copied over.

This is caused by Minecraft copying ItemStacks in a non-standard way, inside PlayerInventory, when ItemEntities are picked up. Instead of using ItemStack.copy() they make a new ItemStack and copy the tag from from the old.

My stack trace ending with the method in question
stack

Presumably, this is also why /give also gives ItemStacks without components

commented

When PlayerInventory#addStack creates the new ItemStack it is created with a size of 0. This causes ItemStack#getItem() to return air during MixinItemStack#initComponents()

commented

this was resolved with 2.3.4