Detecting any component of an item in any way is inaccurate.
For example:
/execute if items entity @s weapon.mainhand *[minecraft:weapon={item_damage_per_attack:2}]
This command will fail to detect the axe because the axe's item component is: [minecraft:weapon={item_damage_per_attack:2,disable_blocking_for_seconds:5}]. This command only allows items with the component [minecraft:weapon={item_damage_per_attack:2,disable_blocking_for_seconds:0}] to pass the detection. Ideally, it should only require items matching [minecraft:weapon={item_damage_per_attack:2}], while disable_blocking_for_seconds can be any number.
Thank you for your report!
However, this issue is Invalid.
This report does not describe a bug.
Using an equals sign (
=) for one of the components in an item predicate checks for the exact contents of the component, which include the default values of fields not specified in the command.Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki