Hello! First you are going to need 4 things:
- Bow
- Repeating Command Block (type /give @s repeating_command_block
- Redstone Comparator
- Redstone Repeater
First by placing a command block, then 4 blocks away place another one. Get the comparators and repeaters and make this setup:


Now in the first command block, type this:
/testfor @e [type=arrow,r=100]

Now, on your Minecraft, press on the green arrow.

Then type this:

Finally, on the last command block, do this:

Now shoot the bow, make sure it’s far from the machine, or it’ll destroy it. Don’t do it too far, or the command block won’t work.
ALL COMMANDS:
- /testfor @e [type=arrow,r=100]
- /execute @e [type=arrow,r=100] ~~~ summon tnt ~~~
- kill @e [type=arrow,r=100]