I'm not sure if I have the syntax incorrect or what but here's the cmd I did in order to attempt in testing for a specific ground item potion:
/testfor @e[type=Item] {Item:{id:"minecraft:splash_potion",tag:{Potion:"minecraft:fire_resistance"}}}
to make sure if I did the correct syntax I simply dropped the fire resistance potion on the ground next to a command block that had the following command:
/entitydata @e[c=1,type=Item] {}
which basically outputs the syntax of that potion.
The output is:
{Motion:[0:-0.0032639305892422227d,1:-0.0d,2:2.328694965208985E-4d],UUIDLeast:-5189384868783823950L,Health:5s,Invulnerable:0b,Air:300s,OnGround:1b,Dimension:0,PortalCooldown:0,Rotation:[0:349.79404f,1:0.0f],Thrower:"Logical_Cyclops",FallDistance:0.0f,Item:{id:"minecraft:splash_potion",Count:1b,tag:{Potion:"minecraft:fire_resistance"},Damage:0s},UUIDMost:-9045697795539712212L,Pos:[0:-296.76321673258883d,1:4.0d,2:30.829441827924242d],PickupDelay:26s,Fire:-1s,Age:14s}
I looked at the part where it says
Item:{id:"minecraft:splash_potion",Count:1b,tag:{Potion:"minecraft:fire_resistance"},Damage:0s}
so I excluded the count and the damage and I tried the testfor cmd with that datatag which didn't work. I then did the testfor without excluding damage and count and still frustratingly didn't work. Making me believe that it's a bug.
Comments 3
Oh never mind then. It did detect it; I guess the output didn't update or something. Thanks for helping me out with this. 🙂
UPDATE: the output turn out to be "[12:43:45] item.tile.dirt.default did not match the required data structure" which is ironic to me which normally in the output box it would output something like Potion found or something like that. I'll use the comparator method or do /blockdata ~ ~-1 ~ {} seeing if it has a SuccessCount:1, every time I'm seeing if a command executes successfully.
@@unknown, (most) commands are not processed until after a selector receives targets. @e[type=Item]
grabs all items to process, and then /testfor
cycles through each item. Along the way it found the potion item successfully, but the very last item it processed was dirt. The last output only shows the very last thing the command processed. If you run the command using the chat, you'll get the result of each item being processed one at a time.
Cannot reproduce, the detection works fine for me. How can you know the detection failed? The simple way to know if the command was successful or not is to put a comparator facing away from the command block.