How can I summon an object in motion where a player is looking?
I got this to work:
In a repeating command block:
/execute @e[type=snowball,tag=!standSummoned] ~ ~ ~ summon armor_stand ~ ~0.1 ~ {Marker:1,Small:1b,CustomName:snowballStand,NoGravity:1}
In a conditional chain command block:
/scoreboard players tag @e[type=snowball,tag=!standSummoned] add standSummoned
In a regular chain command block:
/execute @e[type=snowball,tag=standSummoned] ~ ~ ~ /teleport @e[name=snowballStand] ~ ~-0.1 ~
The Marker:1
tag gives it a really tiny hitbox, so offsetting it slightly is enough to keep it from getting in the snowball's way. Note that this summons the armor stand with its feet at the snowball, you might want to offset it farther down to get the effect you want.
Edit
I may have misunderstood the problem. Were you trying to get a projectile to kill an existing invulnerable armor stand on hit? If so, this is what you want:
/execute @e[type=arrow] ~ ~ ~ scoreboard players tag @e[type=armor_stand,name=targetedArmorStandName,r=3] remove vulnerable
/execute @e[type=arrow] ~ ~ ~ scoreboard players tag @e[type=armor_stand,name=targetedArmorStandName,r=2] add vulnerable
/entitydata @e[tag=vulnerable] {Invulnerable:0}
/entitydata @e[tag=!vulnerable,type=armor_stand,name=targetedArmorStandName] {Invulnerable:1}