NBT-API

NBT-API

98.9k Downloads

NBTItem#getItem causing trade fail in MerchantInventory

eslym opened this issue ยท 2 comments

commented

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

commented

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.

commented

I guess this should have clarified this issue, since it's neither an issue with Spigot or the NBT-API.