Why is my /execute command not working?
Solution 1:
You are trying to use a syntax of /execute
that is for 1.13+. This syntax does not work on 1.8.9. The equivalent of /execute if entity
is /testfor
, so you should be using that.
To make another command block run if the command is a success, you'll need to use a Redstone Comparator that points outwards from the command block with the /testfor
. You will then need to make a redstone circuit that powers another command block, only if the comparator is on.
I'm not a redstone engineer, but I know how all this stuff works, so I managed to come up with this. It could probably be made more compact, so please add another answer if you have a more compact circuit:
The command block on the right would contain your /testfor
command, and the command block at the bottom contains your command to run if the /testfor
is a success.
Question: Why can't the comparator face directly into the command block?
Good question! The comparator doesn't pulse on and off like the redstone clock does. Instead, it just turns on once when the /testfor
succeeds, and stays on until the /testfor
fails. This means that your second command would only run one time when you enter, not repeatedly. What I did was connect the second command block to the redstone clock.
Finally, you might want to check the target selector you are using. If you are trying to have (46, 1, 70) as the opposite coordinates, this is wrong. dx
, dy
, and dz
are sizes, not opposite coordinates. If you are trying to select the area between (46, 1, 70) and (82, 1, 73), the correct target selector is:
@a[x=46,y=1,z=73,dx=36,dy=0,dz=12]