my command block says detect is an invalid number in /execute D:
Create an account or sign in to comment.
16
its fixed
What's the error? Are you running this on a clock? Are the objectives if there are any, set up correctly?
no objectives, just a repeat command block.
As I said. What is the error?
detect is not a valid number
Copy paste the EXACT command that gives this error, straight from the command block. This is most likely a issue with either you messing up where the co-ordinates respective to 'detect' should be or you forgetting a datavalue.
/execute @a ~ ~ ~ detect ~ ~2 ~ redstone_block 0 /kill @p[c=1]
This works, you have to walk under the block, to walk over it you need ~-1. If you check in a command block it should say that it failed the command "execute" unless you walked under the block.
This works, you have to walk under the block, to walk over it you need ~-1. If you check in a command block it should say that it failed the command "execute" unless you walked under the block.
As said before, @a detects dead players while @p does not, this means that a dead player with a redstone block 2bs (blocks) above him/her will trigger even when dead, but since @p doesn't track dead players it'll kill the nearest ALIVE player. That'd cause dead players to kill living players if the detect is successful. Also @p already tracks one target which is the closest as well so a [c=1] is really not needed here.
not working
still not working D:
The ~ before the detect change the origin from the player. But the detect command already has the ability to specify absolute or relative co-ordinates.
Eg:
/execute @a ~ ~ ~ detect ~ ~-1 ~ stone -1 say standing on stone
Says "standing on stone" if any stone type is a block below you.
Eg:
/execute @a ~ ~ ~ detect ~ ~-1 ~ stone -1 say standing on stone
Says "standing on stone" if any stone type is a block below you.
When using execute, your command NEEDS the format of this: /execute @a[the specifics] ~ ~ ~ the command that needs executing and then the specifocs of the executed command. Heres an example:
/execute @a[score_attack=0] ~ ~-1 ~ /fill ~3 ~ ~-3 ~-3 ~ ~3 stone
Where I think you messed up is right after here : /execute @a[stuff] detect <--- THERE
You need coordinates there before the detect command. If you are trying to detect the block under the players foot you will want:
/execute @a[your specifics] ~ ~-1 ~ detect then whatever you had next. If you want to detect the player's coordinates exactly, you can use:
/execute @a[specifics] ~ ~ ~ detect
P.S. You dont need to use @a as you probably know. All @'s work
/execute @a[score_attack=0] ~ ~-1 ~ /fill ~3 ~ ~-3 ~-3 ~ ~3 stone
Where I think you messed up is right after here : /execute @a[stuff] detect <--- THERE
You need coordinates there before the detect command. If you are trying to detect the block under the players foot you will want:
/execute @a[your specifics] ~ ~-1 ~ detect then whatever you had next. If you want to detect the player's coordinates exactly, you can use:
/execute @a[specifics] ~ ~ ~ detect
P.S. You dont need to use @a as you probably know. All @'s work
Well what is your actual execute command?
/execute @a ~ ~ ~ detect ~ ~2 ~ minecraft:redstone_block kill @p[c=1]
@a tracks dead players while @p doesn't so you shouldn't mix these. You also forgot to add a value to the block, since there's only one state for a redstone block you'd set it to 0 or -1 to ignore all values
/execute @a ~ ~ ~ detect ~ ~2 ~ redstone_block 0 /kill @a[c=1]
/execute @a ~ ~ ~ detect ~ ~2 ~ redstone_block 0 /kill @a[c=1]
still not working D: