now this worked fine in the past but all the command blocks with this and similair commands stopped working recently. I can't seem to spot the fault myself. Does anyone see what's wrong with the commando when executed in Minecraft 1.12.1. The error is (translated from Dutch) "The block could not be placed".
Greetings Thomas Mulder
PS. I believe that the the problem is caused by a mc update which changed the syntax for the command but I can't seem to find what changed.
When bugfixing these things start by issuing the command(s) manually, that's a sure way to see what's going on. When the same command doesn't work try looking it up on the wiki and try variants, as cb already mentioned.
Sorry for my late response. Was a bit busy with school recently and didn't have much time to play minecraft/ check the forums. The replace part of the command was indeed the problem. Replacing "replace" with "destroy" did indeed solve the problem. Thanks command_block_shadow (and the others) for the help