Testfor multiple dropped items

I want to detect multiple of the same dropped items but all the command blocks get triggered instead of just one. How can i do this. :[


Solution 1:

Update for 1.13+

  • The c argument has been renamed to limit.
  • You can now change the sorting of the list of targets using the sort parameter. Valid values are: nearest, furthest, random, and arbitrary.
  • /testfor is now /execute using the if argument.
  • NBT is now inside the target selector, using the nbt argument.

1.13 command:

/execute if entity @e[limit=1,type=item,sort=nearest,nbt={NBT}]