#detect when an entity is hit by a tagged arrow

1 messages · Page 1 of 1 (latest)

sharp dew
#

I tried doing it lazily with if entity @e[distance..] but the arrow travels too fast at some speeds for the function to work. so is there a way to be hit by an arrow and have it run a function based on the tag it had in midair

opal radishBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1730499687:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

thorny willow
#

It's hard to detect when an entity is hit by something, but you can detect when the player's projectile hits an entity.

You could either use an advancement, which would require running a reward function to then find that damaged entity, or give the bow that shoots the arrows (or possibly even the arrow entities themselves) a custom enchantment that can then run the function as the victim

sharp dew
#

alright, I'll look into it; thanks