Minecraft 1.14 - how detect blocks at some distance from the player
Solution 1:
There is no easier way than what you tried. @e
and other selectors only work for entities, not blocks.
I have made a complicated system in the past that would allow you to do something similar, but (it's not updated to 1.13 and) it would need quite a bit of setup and would create much more lag than simply typing in the 27 commands for your system.