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

Started by MihlanDOta on

Topic category: Help with Minecraft modding (Java Edition)

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

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)

 

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.

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

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

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.

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.