NBTItem#getItem causing trade fail in MerchantInventory
eslym opened this issue ยท 2 comments
I spent hours to find the cause why the trade doesn't work, end up its cause by the ItemStack which having type Meterial.AIR
internally, I am not sure is it a bukkit bug, NBTItem#applyNBT
did solve my problem, I post it here so at least if someone face the same problem will aware
In general new NBTItem(item) will fail on null or AIR itemstacks, since they obviously can't hold any nbt. Empty Itemstacks since I think 1.13 are AIR instead of null like for example in 1.8, so bestcase you check for null and air before you try to work with an itemstack.