For now, you may use this NBT template if you want to:
{Inventory:[{id:"minecraft:<item>",Count:1b}]}
Simply replace
<item> with the ID of the item you want to detect. Here are some other tips you may want to use to your advantage:
- You may modify the amount in the Count tag in order to specify a different amount for that item.
- You may also add a tag tag after that in order to detect specified data for that item as well.
Here are some examples on how the NBT is used:
- {Inventory:[{id:"minecraft:crafting_table"}]} detects players who have a Crafting Table in their inventory
- {Inventory:[{id:"minecraft:diamond_sword",tag:{Enchantments:[{id:"minecraft:sharpness"}]}}]} detects players who have a Wooden Sword with at least the Sharpness enchantment
Hope it helps! You may also want to check out my data packs; so if you want to, click
here.