Introduction:
Items that have durability (e.g. leather boots) use an int tag to indicate its durability. However such items have no such tag when they first appear in the world (like being crafted out or taken from the creative inventory) where the damage (aka. data value) of it should be 0. And when you put such items into a container and save the world in a file, they’ll automatically add the int tag with the value of 0 to the item. And this may cause an issue when using /testforblocks command in the world that refers such containers. The issue will cause the command always failed until you save & exit the world then enter the world and try again.
Steps to Reproduce:
Place a dispenser and insert a pair of leather boots in the first slot.
Save & exit the world.
Enter the world and place a dispenser with the same direction to the first dispenser.
Take out a new pair of leather boots and insert it into the second dispenser.
Use /testforblocks command to compare the two dispensers.[case1]
Save & exit the world.
Enter the world and use /testforblocks command to compare the two dispensers.[case2]
Observed Results:
Case 1: failed. Case 2: successful.
Expected Results:
Case 1: successful. Case 2: successful.
affects 1.21.100