How to make a Charge Attack?

Started by Hollowplayz on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a Charge Attack?

So I'm trying to make both a boss and a mount entity, and I'm wondering how I make a charge attack for them. I messed around with vector overrides and "on contact with entity" procedures, but they don't work well.

 

Just wondering how I make a charge as well as normal attacks with it?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could try coding a…
Mon, 10/02/2023 - 15:29

You could try coding a behavior that gets the vector to the player, then adds a bunch of velocity in that direction. (Get the x and z differences between the target's position, and use them to determine how much x and z velocity to add to the boss, possibly using some magical trig functions.)

That'll just add a lot of velocity all at once, you could also try making some custom NBT tags for the target x and z location, then using the same system as above, but setting the target as a constant value the entity remembers, making it charge towards that location at a constant rate until it reaches it. This would likely be quite a bit more complicated, (and would almost certainly need trig), but would probably be more what you were going for.