Shoot an arrow at every monster around the Player

Started by Skittlq on

Topic category: Help with Minecraft modding (Bedrock Edition)

Active 1 year ago
Joined May 2022
Points:
378

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
Shoot an arrow at every monster around the Player

I have everything sorted and it all works fine apart from the part where it shoots the arrow, I'm struggling to know where to shoot the arrows in the direction of the entity.

 

Here is my code so you can see what I'm trying to do

My Code

Active 8 months ago
Joined Dec 2013
Points:
786

User statistics:

  • Modifications: 0
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 39
You can try some maths:…
Wed, 09/28/2022 - 13:02

You can try some maths:

target position - player position = direction from player to target

For dx:

entity iteration x position - event/target entity x position

For dy:

entity iteration y position - event/target entity y position

For dz:

entity iteration z position - event/target entity z position

Active 1 year ago
Joined May 2022
Points:
378

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
Dude thank you so god damn…
Mon, 10/03/2022 - 13:33

Dude thank you so god damn much, I have been trying to figure this out for far too long and I can finally finish this mod.

Active 9 months ago
Joined Jun 2020
Points:
710

User statistics:

  • Modifications: 0
  • Forum topics: 17
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 49
Could you send a photo of…
Sat, 05/20/2023 - 17:54

Could you send a photo of how you look? I didn't quite understand how it should be, it would help me to finish my mod!