If you'd like to detect for somebody at a specific location, use the location selectors (x=[x co-ordinate]
, y=[y co-ordinate]
and z=[z co-ordinate]
.)
Your selector should look sometihng like this:
@a[r=1,x=0,y=0,z=0]
This command detects for players at 0, 0, 0.
The r
specifiesreason it is selecting the radius to detect. Set thisclosest player to 1
asthe command block is because you do not wanthave set the selector to detect others in adjascent jobs.
The x@p
, y
and z
as above stated: Specifieswhich selects the locationclosest player to detect it fromthe command block to fit the rule.
Note: You cannot use relative locations when providing co-ordinates in selectors..
Seeing what you're trying to do:
I'm looking for a player within 10000 blocks of the command block, with a wool in his inventory that's standing right underneath (or at least, with his head in) the command block.
You're better off using a scoreboard clock to test for whetherselecting everybody who the player hasrule fits to run the wool in his inventory, then add that scoreboard selector into your command on.
/execute @p[r=1,x=0,y=65,z=0,scoreboard_hasWool_min=1,scoreboard_hasWool=1]@a[r=10000] /~ ~ ~ detect ~ ~-1 ~ wool 15 effect @p invisibility 12 3 true
The aboveThis command assumes that you're testing for a player standing onexecutes the block 0, 64, 0/effect
and the name of the scoreboard detectorcommand on everybodybody who is within 10,000 blocks of your command block hasWool
and has a Black Wool block under their feet.
Also, set the co-ordinate to be one block above of the block you wantwhen specifying the playercommand to be standing onrun, as entering the block's co-ordinate will only detect if they're in (andyou do not on) the blockneed a second slash.
Secondly, don't forget to run this command in a redstone clock!