Directional Launch/Jump (Entity)

Started by Mopru on

Topic category: Help with Minecraft modding (Java Edition)

Active 5 months ago
Joined Jan 2023
Points:
505

User statistics:

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

Active 2 months ago
Joined May 2022
Points:
1311

User statistics:

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