CraftTweaker

CraftTweaker

151M Downloads

IItemStack.clearTag();

slava110 opened this issue ยท 4 comments

commented

Feature request name

Method to remove NBT tags from itemstack

Feature request description

Add IItemStack.withoutTag() or IItemStack.clearTag() or allow null values in IItemStack.withTag(@Nullable tag) to remove NBT tag from itemstack

Feature request reason

Might be useful for recipe transformers & event handlers. For me it's useful because we want to remove empty NBT tags from items but I think there are more cases when it will be useful

Game Version

1.12+

commented

1.12 IItemStack.removeTag(null)

commented

Nice, it works! Not stated in documentation tho? Or maybe I missed it somehow?

commented

also IItemStack.withEmptyTag() nvm thats what you were trying to remove lol

commented

Nice, thanks again c: I'm closing this issue then (not closed automatically, probably because it's different GitHub repository)