How to move an entity in the direction the player is facing

Started by MihlanDOta on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 year ago
Joined Nov 2020
Points:
615

User statistics:

  • Modifications: 2
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
How to move an entity in the direction the player is facing

I have a procedure that is executed when the player right-clicked on an entity.

The entity must "jump" in the direction the player is facing. Tell me, how can this be implemented?

 

Thanks

Active 1 year ago
Joined Nov 2020
Points:
615

User statistics:

  • Modifications: 2
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
So, I have found solution …
Sat, 04/24/2021 - 14:16

So, I have found solution

Set Event/target entity movement vector to vx: 0 - sin(Direction (yaw) in deg. relative to S of Source entity * PI / 180) vy: 0.3 vz: cos(Direction (yaw) in deg. relative to S of Source entity * PI / 180)

 

Active 2 years ago
Joined Apr 2021
Points:
756

User statistics:

  • Modifications: 1
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 292
MY EYES! please give a…
Mon, 06/21/2021 - 14:37

MY EYES! please give a screenshot, you can use "imgBB" for that.

Active 1 year ago
Joined Nov 2020
Points:
615

User statistics:

  • Modifications: 2
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
(No subject)
Sun, 06/27/2021 - 18:53

img

Active 2 years ago
Joined Apr 2021
Points:
756

User statistics:

  • Modifications: 1
  • Forum topics: 14
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 292
Big Thanks!
Fri, 07/02/2021 - 10:23

Big Thanks!

Active 1 month ago
Joined Mar 2021
Points:
983

User statistics:

  • Modifications: 3
  • Forum topics: 37
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 452
You're the only one in…
Mon, 07/05/2021 - 16:59

You're the only one in centuries succeeding in this

So I ask for your help maybe you can do it

I have a custom shield and want for it to block ONLY attacks coming from front and not back. Do you have an idea for it ?

Also how do you cast for example a fireball in the direction player is facing ?

I see you are good with this so maybe you can help

thank you

Active 2 years ago
Joined Jul 2021
Points:
645

User statistics:

  • Modifications: 0
  • Forum topics: 25
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 48
This doesnt work for me, it…
Mon, 08/16/2021 - 22:57

This doesnt work for me, it says the files dont compile properly and i cant even test it out, did i do something wrong?heres the code

Active 9 months ago
Joined Dec 2017
Points:
706

User statistics:

  • Modifications: 2
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
crowinsanity13 you can find…
Tue, 08/31/2021 - 07:02

crowinsanity13 you can find on the forum that the motion vector block only overrides the motion one tick and thus need to be called every tick.

Active 2 days ago
Joined Sep 2021
Points:
924

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
I just found out that you…
Thu, 03/07/2024 - 20:23

I just found out that you can set the Y velocity by replacing the 0.3 in MihlanDOta's procedure with the "Head pitch of [Target entity] in degrees" block.

Active 6 hours ago
Joined Feb 2025
Points:
9

User statistics:

  • Modifications: 0
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 3
how would i go further?
Sun, 04/13/2025 - 09:51

how would i go further?

Active 2 days ago
Joined Sep 2021
Points:
924

User statistics:

  • Modifications: 0
  • Forum topics: 77
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 118
Just multiply it.
Sun, 04/13/2025 - 14:56

Just multiply it.