[1.16.3] NBT tag being appended to items when used to break tall grass
elowanut opened this issue ยท 6 comments
Versions:
- Curios: curios-forge-1.16.3-4.0.2.0
- Forge/Fabric: Forge 34.1.25
Observed Behavior:
Curios is causing some items to have an empty NBT tag (containing the word "tag") appended to them. This prevents them from stacking with 'regular' versions of the item. This seems to only occur when that item is used to break Tall Grass.
Steps to Reproduce:
- Create a fresh instance of Minecraft with only Forge and Curios installed.
- Acquire a stackable item (wheat seed, sapling, dirt block, berries, etc.). Break a Tall Grass with that item in your hand. Get a fresh one of the same item, and note that the old one won't stack with the new one. If you look at the item you used to break with an NBT editor, you will see the additional tag appended to it. Note that this NBT tag is also added to non-stackable items that don't have any damage tags (like a saddle), but since those items never stacked in the first place, the issue isn't significant.
- Note that this does not occur without Curios installed.
Was this fix in the 1.16.5 version, because I'm experiencing the same thing with Curios 4.0.8.1, but with Slime Blocks.
Yes, this is fixed. If you're experiencing something similar, you need to open up a new bug report with reproduction steps and making sure that you test with only Curios installed to isolate any mod interactions.
Nah, I misguessed this. The readNBT
/writeNBT
methods don't seem to be ever called at all, apart from having little relation to items that do not provide ICurio capability.
The issue itself I was able to reproduce though, and it indeed for whatever reason only happens when breaking Tall Grass. I haven't tried that many blocks yet, but common stuff like dirt, or normal grass doesn't cause this. Admittedly I am now clueless to what can be the cause of this.
Alright, so, what little evidence on this I was able to gather in my fresh instance:
-
Happens with Tall Grass and few other identical example of double-block plants, like Rose Bushes and Sunflowers.
-
Happens regardless of whether lower or upper block of plant is broken.
-
Doesn't happen with anything else, including different double-block plantlife and double-blocks in general. I tried this with Bamboo, Sugar Canes, Cactuses, Twisting Vines, banners, doors, beds, Scaffolding, extended Pistons, Chorus Plants - and all those test did not have any effect, not to mention blocks that fit supposed criteria even less, like normal plantlife.
-
The empty tag is appended specifically to
ItemStack
held in mainhand, if there is any. Doesn't have any effect on items that already have any sort of NBT tag on them, including empty tag produced by this bug.
I feel like this might happen because of this:
The javadoc of IStorage#writeNBT
explicitly specifies:
@return a NBT holding the data. Null if no data needs to be stored.
The implementation of this method in CurioItemCapability
however always returns empty new CompoundNBT()
, which would explain the empty NBT tag being appended. I will try to test this further myself in order to confirm whether my suspicion is the case.