I want to test if there is a sheep at location -155 7 14. Im a begginer and have little to no clue to what I'm doing. I dont know how to format anything in minecraft command blocks like when to use !,=,@,[,] etc. If there is no sheep there I want the code to detect it and thus carry on a different command, vise versa. How should I format this?


1 Answer 1

/testfor @e[type=sheep,x=-155,y=7,z=14,r=1]
  • type=sheep - Look for a sheep.
  • x=-155..y=..z=... - Start search at these coordinates
  • r=1 - Look in a radius of 1 block
  • I tried that but it keeps on saying "No targets matched selector." Does this mean it's false? (as in there is no sheep there)
    – aqualeon_
    Nov 27, 2020 at 4:43
  • It's resolved! I didn't need the command block and replaced it with a redstone circut that works.
    – aqualeon_
    Nov 27, 2020 at 4:58
  • Very good explanation! I replaced metre with block because not everyone is clear about 1m being one block.
    – One 2 Many
    Nov 27, 2020 at 6:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .