I've recently added some new commands into a .mcfunction, since 1.12 is now out. What I wanted was that if the player ran directly into a block, it destroys it, now that works with this command:
execute @a ~ ~ ~ detect ~1 ~ ~ minecraft:wool 7 setblock ~1 ~ ~ minecraft:air 0 destroy
But my only problem, is that it only works from 1 side, not all 4 sides of the block. Can anyone help me out? I really only want it to work from the front, left, right and back sides.