Minecraft execute command gives error message "Could not execute "detect" as Creeel"

I am trying to make a puzzle map and I want a redstone block to be placed when a certain block is broken. I am putting this command into a Repeating, Always Active command block:

execute @p ~ ~ ~ detect -712 58 -1887 minecraft:air 0 setblock -729 56 -1884 minecraft:redstone_block

The command will always spit out "Could not execute "detect" as Creeel"


Try this if you are in 1.13:

/execute as @p if block -712 58 -1887 minecraft:air run setblock -729 56 -1884 minecraft:redstone_block replace

In 1.12.2 I tried:

execute @p ~ ~ ~ detect -712 58 -1887 air 0 setblock -729 56 -1884 minecraft:redstone_block

and it worked. It only returned that message if there was already a redstone block there. Did you check if there was one or just check the command block? BTW it worked when I used minecraft:air instead of air as well.