How to make arrows disappear when hitting the ground and not players

I was wondering how to do this because I've been struggling with it the last 2 hours (making a minecraft minigame map).


Solution 1:

First you will have to scoreboard tag arrows when they are in the ground using {inGround:1b}:

scoreboard players tag @e[type=arrow] add inGround {inGround:1b}

Then you can target them with a kill command:

kill @e[tag=inGround]