# How can I generate a redstone signal when players are near?

Is it possible to construct something that will run automatically whenever a player is nearby, say within a chunk's range, without that player having to trigger something like a pressure pad or detector rail ?

What I'm trying to do is get some pistons to move in this situation, so for example if someone was walking along something might light up on a distant hill

The only way I can think of doing this is to have a cavern underground with a load of pressure plates wired up to pistons on the surface, and an army of snow golems down there to wander around and hit the pressure plates. But they don't seem to spawn until you're pretty near.

-
It can be done with the craft bukkin plugin for SMP servers (signs can detect when player is nearby), no way other than pressure plates, or other redstone triggers – Domocus Dec 14 '11 at 16:11
Thanks - put it in as an answer and I'll accept it if you like. – Alan B Dec 14 '11 at 16:41
You should be able to do something with a minecart and powered rail, though I can't do a test of my idea right now. – thedaian Dec 14 '11 at 16:45
Tripwire can be 40 blocks long, so you can use it to check quite a bit of area for passers-by. – SF. Jul 10 '13 at 20:52

I stumbled on this trying to figure out how to do this, and I found out NONE OF THEM WORK! So I figured it out instead. Place a repeating redstone curcuit going into a command block, and type in the command block this:

``````/effect @p[r=(number)] 13 1 0
``````

with a comparotor coming out of it.

Then, hook up whatever you want to the comparotor! Now, here's how to know what number to put: the number you put = how many blocks away a player has to be before the redstone comparotor turns on. Also, if you put "m" after r, so "rm" it will work only if the player has LEFT the number of blocks put.

Don't you use ANY () in your command! JUST []

-
While this technically works, so would a simple `testfor` which is actually designed to do this. – MrLemon Nov 13 '15 at 18:18

You can use mob spanners to create sensors that only activate within 16 blocks of them. An example construction is shown here:

-

IF you're using Bukkit, there's a wonderful plugin called PailStone that has sign proximity sensors. You define a volume, and when a player enters that volume, the sign provides power. I used it along with a few other mods to make an enormous airbase with huge doors that automatically opened when a player approached them.

-

Sethbling rigged up a Giant Self-Detonating Creeper statue that would only detonate when people were within a chunk or two of it.

Sethbling's videos are very short and sweet, so I'll let him explain.

-
It would help to include the basic concept it uses (command blocks? captive endermen? chicken growth timers? pixie dust?) so that if the video ever disappears or someone can't watch it for some reason, this answer doesn't become useless. – SevenSidedDie Mar 18 '15 at 23:16

You can use command blocks proximity detector command.
Just stuff the command blocks away.
Here is a example:

```-=redstone
|-|=powered rail
c= command block

c----|-|```
-

If you are in creative, run a clock wired up to a command block that has the command `/testfor @p[r=some number]` with a comparator output to the pistons.

-

Run a clock with a command block attached to it with the command:

``````/testfor @a[x=X,y=Y,z=Z,r=Radius]
``````

and put a comparator coming out of the command block with output leading to pistons.

-
This will work now with these new-fangled command blocks all the youngsters are crazy about. – Alan B Mar 19 '15 at 8:41