Directional Launch/Jump (Entity)

Started by Mopru on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Directional Launch/Jump (Entity)

Kind of confused with this one. when I use "Attempt to override motion vector of entity" i can only make it go in a direction based on coordinates, so how do I instead launch an entity through directions through pitch (horizontal direction) and maybe even yaw and roll

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There's a seperate function…
Tue, 01/02/2024 - 12:44

There's a seperate function to manage yaw and pitch; the x/y/z Override Motion Vector does not ask for coordinates, but rather for x/y/z velocities. (How much to add to the player's current velocity in each axis. I think they renamed it 'motion delta' in the latest version, but it's essentially velocity.) As such, if you want to update the player's current velocity, you would override the entity's motion vector to their current x/y/z velocities, plus a certain amount, or multiplied by a certain amount, etc. You can also use the look angle vector of the current entity as velocities and multiply them by a desired value to move an entity in the direction it's currently looking at. For more complex velocity changes, you'll need some basic trig, but for basic stuff it's usually not necessary.