Detecting when an arrow shoots a mob

I've coded a datapack that makes an arrow explode when it lands. However, when hitting a mob it of course doesn't explode. How could I fix this? Right now my code is: execute as @e[type=arrow,nbt={inGround:1b}, tag=explosive_arrow] at @s run function pack:explode tag=explosive arrow is added if it is shot from a bow with a custom enchant, and pack:explode just summons a creeper with fuse 0
Continue to help post