nbt and custom_data compares differently

I noticed that 1.21 "custom_data" checks differently than nbt in 1.20 and older: custom_data strictly checks if custom_data exactly equals and dont contains anything else, while nbt checks if specified value is equal, ignoring anything else. Example:

1.21, checking custom_data for "{level:1}" "{level:1}" returns true "{level:1,uses:0}" returns false (should be true)

1.20, checking nbt for "{level:1}" "{level:1}" returns true "{level:1,uses:0}" returns true

is there any way around it?

Continue to help post