How do I /testfor more than 1 item in an inventory without a need to use the /scoreboard command? [duplicate]

I would like to test for more than 1 item in one's inventory. However, I'm having some difficulties.

I have tried the /testfor @p[r=2] {Inventory [{id:"minecraft:gold_nugget"}]} command, but it doesn't work. It says "UUID incorrect". I would rather not use scoreboards, because I don't really get along too well with it.

Can someone please put the command to set the amount? (I.E. Of the gold nuggets). If it matters, I would like it in command block form.

Thanks in advance.


Solution 1:

You've got a couple syntax errors in the NBT portion of your /testfor command. The command, as you have it, should be /testfor @p[r=2] {Inventory:[{id:minecraft:gold_nugget}]}

However, unless you literally only want to do something to the world whenever there is a player within 2 blocks with a gold nugget in their inventory, you are not going to be able to do anything with this testfor command. testfor does not allow you to pass player information to any other commands. You can see if that player exists, great, but you can't do anything to that player. If you want to do anything to that particular player, you will absolutely need to use a scoreboard. I don't care if you don't want to learn it, that's your only choice (if you just want to do something simple like summon a TNT at a particular location, then you can continue on your merry way with your testfor I guess).