Minecraft detect player distance to blocks?

Gi
1

I want to determine in Minecraft 1.14.4 how far the player is from a block. For example, If the player is only a block away from a gold block, it should be automatically removed / destroyed by command. I know a lot about commands, but the / execute command is not yet available to me. How can I set this command?

Me

Maybe as a small idea for you to toast:

You can use the whole time with e.g. The Fill command will remove all gold blocks around the player…

So you just keep removing all gold blocks around the player.

I do not know how it is in the 1.14, in the 1.8 this would look something like this:

(Synax certainly not right)

execute @a ~ ~ ~ / fill ~ 1 ~ ~ 1 ~ -1 ~ ~ -1 minecraft: air replace minecraft: gold_block