how to push entity to its look coordinates?

Started by vlonabuser on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how to push entity to its look coordinates?
Sat, 11/04/2023 - 16:46 (edited)

I know that i need to use attempt to override motion vector block, but i cant find a way to make it move straight to xyz of block that its looking at.

Edited by vlonabuser on Sat, 11/04/2023 - 16:46
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You should be able to add…
Sat, 11/04/2023 - 18:01

You should be able to add the x/y/z values of the entity's look angle vector to their current x/y/z velocities to make them move in the direction they're looking. (The 'x-value of look angle vector,' for example, takes the x component of the vector from the entity's look position.) If you multiply each of these values, it will increase the speed with which the entity moves in that direction.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here's how I'd do it, very…
Wed, 11/29/2023 - 00:32

Here's how I'd do it, very similar to Mindthemoods': (You'll probably want to mess around with the values you divide by, in the example, the 3s and 6) ""