#NBT strip
10 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
so removing a specific nbt tag from an item in a crafting table recipe?
that would be a fine solution, I was actually going to use the create mill and grinder, but crafting table would be almost the same code.
whould it also work, for your specific usecase, if your nbt to remove wouldn't necessary need to be on the item?
not sure what you mean? The item being used could have the nbt, if it does I need to remove the nbt and then give back an item that is the same minus the nbt. In particular I am imitating the effect of nbt removal from apotheosis mod when it strips off stones and additional function nbt.
Try this
event.shapeless("minecraft:diamond_sword", [Item.of("minecraft:diamond_sword").ignoreNBT())])
.modifyResult((inventory, itemstack) => {
item = inventory.find(Item.of("minecraft:diamond_sword").ignoreNBT())
if (item.nbt == null) return itemstack
nbt = item.nbt
nbt.remove('your_nbt_tag_here')
if (nbt.size() == 0) nbt = null
return itemstack.withNBT(nbt)
})
would need to adjust your input and output item + the one in inventory.find