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

Started by MihlanDOta on

Topic category: Help with modding (Java Edition)

Last seen on 19:18, 16. Jan 2024
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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

Last seen on 19:18, 16. Jan 2024
Joined Nov 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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)

 

Last seen on 09:43, 1. Jun 2022
Joined Apr 2021
Points:

User statistics:

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

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

Last seen on 19:18, 16. Jan 2024
Joined Nov 2020
Points:

User statistics:

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

img

Last seen on 09:43, 1. Jun 2022
Joined Apr 2021
Points:

User statistics:

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

Big Thanks!

Last seen on 13:53, 19. Apr 2024
Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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

Last seen on 19:33, 16. Apr 2023
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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

Last seen on 11:49, 16. Jul 2023
Joined Dec 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Last seen on 18:49, 16. Apr 2024
Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.