Skip to main content
deleted 4 characters in body
Source Link
pinckerman
  • 43.9k
  • 23
  • 132
  • 196

The reason it is selecting the closest player to the command block is because you have set the selector to @p, which selects the closest player to the command block to fit the rule...

You're better off selecting everybody who the rule fits to run the command on.

/execute @a[r=10000] ~ ~ ~ detect ~ ~-1 ~ wool 15 effect @p invisibility 12 3 true

This command executes the /effect command on everybodybodyeverybody who is within 10,000 blocks of your command block and has a Black Wool block under their feet.

Also, when specifying the command to run, you do not need a second slash.
Secondly, don't forget to run this command in a redstone clock!

The reason it is selecting the closest player to the command block is because you have set the selector to @p, which selects the closest player to the command block to fit the rule...

You're better off selecting everybody who the rule fits to run the command on.

/execute @a[r=10000] ~ ~ ~ detect ~ ~-1 ~ wool 15 effect @p invisibility 12 3 true

This command executes the /effect command on everybodybody who is within 10,000 blocks of your command block and has a Black Wool block under their feet.

Also, when specifying the command to run, you do not need a second slash.
Secondly, don't forget to run this command in a redstone clock!

The reason it is selecting the closest player to the command block is because you have set the selector to @p, which selects the closest player to the command block to fit the rule...

You're better off selecting everybody who the rule fits to run the command on.

/execute @a[r=10000] ~ ~ ~ detect ~ ~-1 ~ wool 15 effect @p invisibility 12 3 true

This command executes the /effect command on everybody who is within 10,000 blocks of your command block and has a Black Wool block under their feet.

Also, when specifying the command to run, you do not need a second slash.
Secondly, don't forget to run this command in a redstone clock!

Post Undeleted by aytimothy
deleted 996 characters in body
Source Link
aytimothy
  • 17.9k
  • 17
  • 83
  • 140

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 hasWooland 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!

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 specifies the radius to detect. Set this to 1 as you do not want to detect others in adjascent jobs.
The x, y and z as above stated: Specifies the location to detect it from.

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 whether the player has the wool in his inventory, then add that scoreboard selector into your command.

/execute @p[r=1,x=0,y=65,z=0,scoreboard_hasWool_min=1,scoreboard_hasWool=1] /effect @p invisibility 12 3 true

The above command assumes that you're testing for a player standing on the block 0, 64, 0 and the name of the scoreboard detector is hasWool.

Also, set the co-ordinate to be one block above of the block you want the player to be standing on, as entering the block's co-ordinate will only detect if they're in (and not on) the block.

The reason it is selecting the closest player to the command block is because you have set the selector to @p, which selects the closest player to the command block to fit the rule...

You're better off selecting everybody who the rule fits to run the command on.

/execute @a[r=10000] ~ ~ ~ detect ~ ~-1 ~ wool 15 effect @p invisibility 12 3 true

This command executes the /effect command on everybodybody who is within 10,000 blocks of your command block and has a Black Wool block under their feet.

Also, when specifying the command to run, you do not need a second slash.
Secondly, don't forget to run this command in a redstone clock!

Post Deleted by aytimothy
Source Link
aytimothy
  • 17.9k
  • 17
  • 83
  • 140

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 specifies the radius to detect. Set this to 1 as you do not want to detect others in adjascent jobs.
The x, y and z as above stated: Specifies the location to detect it from.

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 whether the player has the wool in his inventory, then add that scoreboard selector into your command.

/execute @p[r=1,x=0,y=65,z=0,scoreboard_hasWool_min=1,scoreboard_hasWool=1] /effect @p invisibility 12 3 true

The above command assumes that you're testing for a player standing on the block 0, 64, 0 and the name of the scoreboard detector is hasWool.

Also, set the co-ordinate to be one block above of the block you want the player to be standing on, as entering the block's co-ordinate will only detect if they're in (and not on) the block.