Would it be illegal to shoot my neighbor's dog with a BB gun?

maybe the collar can shock the owner when it barks.