Make entity move in the direction its looking?

Started by Spyjetray on

Topic category: Help with modding (Java Edition)

Last seen on 14:17, 4. Dec 2020
Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make entity move in the direction its looking?

Hi,

I have made a procedure which makes an entity look in the same direction that the player looks but now I want to make the entity move in that direction, turning when the player also turns.

How do I achieve this as using straight-up movement vectors cause the entity to fly off in a specfic direction which doesn't work so what do I need to do to make it move in the direction it (and the player) is facing?

Thanks

Last seen on 23:41, 3. Jun 2021
Joined Dec 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Dude how did you make the…
Mon, 11/30/2020 - 21:42

Dude how did you make the entity so it’d look in the same direction?

Last seen on 18:55, 8. Apr 2024
Joined Jun 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
this would be really useful…
Tue, 04/20/2021 - 19:00

this would be really useful for my mod, please keep me posted if you find out anything

 

Last seen on 22:31, 19. Sep 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(If you look North the…
Tue, 09/21/2021 - 20:38

(If you look North the entity will move North)

Direction of player = North

Override motion vector of entity to vx: 0 vy: 0 vz: -1

 

(If player looks North the entity will look North)

Direction of player = North

Set Rotation of entity yaw: (180) pitch: ()

 

Yaw means left or right, and pitch means up and down.

Last seen on 22:31, 19. Sep 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Btw make the Event trigger…
Tue, 09/21/2021 - 20:41

Btw make the Event trigger to, On entity tick.

Last seen on 22:31, 19. Sep 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Was this helpfull?
Fri, 11/12/2021 - 16:45

Was this helpfull?

Last seen on 17:22, 17. Apr 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
is there a way make entity…
Sat, 08/26/2023 - 10:50

is there a way make entity always move straight/where its looking from where it spawns? if so please update me