Minecraft: I need make count two or higher, but it don't working @p[distance=..1,nbt={Inventory:[{id:"minecraft:iron_ingot",Count:2b..}]}] [closed]
Solution 1:
I assume you're asking how to check for having 2 or more items in a player's inventory.
If you just want to do that, then your solution is in the last part of the answer here: https://gaming.stackexchange.com/a/354386/171580
If you actually want to check a range in NBT, then you need to first copy it into a scoreboard:
/execute as @p[distance=..1] store result score @s ingots run data get entity @s Inventory[{Slot:0b}].Count
Then you can check it the usual way for scores:
/execute if score @p ingots matches 2.. run …
If you don't know which slot it is, then you will need to do this for every slot.