mojira.dev
MC-42339

/testfor "player not found"

I'm testing the use of /testfor, and under no circumstances can I get it to produce an output as intended. I've copied tutorials from YouTube as well as the example on gamepedia (http://minecraft.gamepedia.com/Tutorials/Command_Block), and it still produces a last known output of "that player cannot be found".

My desire is to have it check the nearest 2 blocks (other than itself, so r=2) for a player.

/testfor @p[r=2]

Doesn't matter if I'm standing on top of it, or standing 3+ blocks away, there is no difference in the output of the block (that player cannot be found). Also, it produces a redstone output whether or not it should have failed. I have a clock circuit with a command block in series with the command above. The circuit clocks, even if I'm standing 3+ meters away.

Attachments

Comments 6

Try a comparator.

I made a clock circuit with a comparator in series. The clock feeds from the back to the front of the comparator, followed by an inverter, and then back again. On the side of the comparator I have a switch that I can use to turn the clock on and off. It functions.

Now, I replace a piece of redstone wire with a command block (I've tried both directly on the back end of the comparator and one piece of wire behind it). The circuit failed to function.

Next I remove the command block from the series clock circuit, and replace the switch on the side of the comparator with a command block. Same code (/testfor @p[r=2]) and still nothing.

*EDIT*
I tried putting a repeater after the command block, to feed directly into the comparator. The circuit now runs, though it shouldn't run when I'm not within 2 blocks. But it does run, no matter how far away I am.

That's not how redstone works and this is not a place to teach redstone.

I'm checking tutorials on Comparators. I fail to see what I'm doing wrong. I'm simply trying different methods of activating a comparator, to see what happens. The fact is, the command block produces the same ouput no matter what I feed into or out of it, and what is fed into or out of a comparator. The command block feeds out "player not found". That's neither invalid nor ignorant.

As a mod, I'd expect better answers than snide, negative criticism of my predicament. Even a link to where you'd suggest I start would be more helpful. I've posted a picture to show the video I'm watching. I set up my circuit, the first time, to function exactly as this one does.

Final attempt. I've tried every which way I can think of. I'm not sure if I'm supposed to activate the block or not. I've tried each configuration I've mentioned with a redstone input as well as no redstone input as shown here (edit - fed from the clock, inside the clock, from a switch into B, etc etc). The block does not change outputs until I feed a redstone intput to it. This is why my earlier pictures show me using a redstone input. edit * I've seen similar bugs posted around here, none of them providing answers. So I made my own.

Command blocks output a signal only through a comparator. Place the back of the comparator against the command block to create a signal when a command is successful (I.E. when the testfor finds a player).
That's what Tails is trying to say. Not a bug, you just haven't learned how to use command blocks/comparators well yet.

Edit: Try the setup shown in setup.png

Daniel William Scutt

(Unassigned)

Unconfirmed

Minecraft 1.7.4

Retrieved