2

So I'm trying to make a pokeball system and I'm testing it on a chicken named TestCatch. I want the command to test if there is an item named pokeball near the chicken. I have this command:

 execute @e[name=TestCatch] ~ ~ ~ testfor @e[type=Item] {Item:{tag:{display:{Name:"Pokeball"}}}}   

Whenever I use it it just says

[16:18:51] Failed to execute 'testfor @e[type=Item] {Item:{tag:{display:{Name:"Pokeball"}}}}' as TestCatch

How can I fix this?

  • 2
    The command is structurally correct. Ensure the command block is running correctly and that there is an item that can be found with /testfor. – Skylinerw Dec 25 '16 at 22:05
  • The command appears to be correct, so the command output means that the target of the testfor was not found. The only thing I can think of is that you're throwing the item like a snowball (default is right-click) rather than dropping the item (default key Q). Thrown snowballs are not the same as dropped snowball items. – user176681 Apr 26 '17 at 10:10
-1

You need to specify the radius:

execute @e[name=TestCatch] ~ ~ ~ testfor @e[type=Item,r=5] {Item:{tag:{display:{Name:"Pokeball"}}}}

this will test if there is a Pokeball item within 5 blocks of TestCatch

  • This would cause a false positive, not a false negative. – pppery Aug 19 at 16:56
-1

The correct answer would be:

execute @e[name=TestCatch] ~ ~ ~ /testfor @e[type=Item] {Item:{tag:{display:{Name:"Pokeball"}}}}

You just missed one / before testfor.

  • 1
    /execute commands do not need a slash in front of them – Klyzx Oct 24 '17 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.