TransWikia.com

How can I detect when an arrow is facing a player? Minecraft bedrock

Arqade Asked by TakeOutTim on April 6, 2021

I’m trying to make it so that when I fire a bow it instantly kills the person I’m looking at, I know to do that I need to know where the arrow is facing and I have no clue how to do that.

One Answer

If you need the arrow's direction to see if it will hit an entity to then kill it (as though you were looking at it), it would be the same as if it was you or any player, but it's with the arrow: in a repeating command block put /execute @e[type=arrow] ^ ^ ^1 execute @e[r=1] ~ ~ ~ kill @s. The ^ is taking where the entity is looking, so the ^ ^ ^1 is asking for the location where the arrow is facing. If you want the detection to last longer, you would need to duplicate the command, either into another command block or into a repeating function if you're making a behavior pack, and increase ^ ^ ^1 to ^ ^ ^2, etc.

Correct answer by rawsome1234 on April 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP