Syncronise attack with animations

Started by Spayzers on

Topic category: Help with MCreator software

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Syncronise attack with animations

Hey, I am making a mod using the geckolib plugin, and I want to make so that one of my mob only deals the damage on a specific time, because right now, the animation only stars when the damage is dealt. Also i'd like to know how to put a cooldown on damage that are dealt and how to put multiples attack pattern (kinda like a boss) 

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The tricky part is that…
Sat, 01/27/2024 - 17:50

The tricky part is that minecraft processes attacks instantly, (the game doesn't know the entity is going to attack until it does), and changing attack behavior is tricky. You can, however, manually design your own attack- you're just also going to have to specifically code how the damage is dealt. (Though this has its advantages.)

A custom boss attack would probably require some NBT number tags for the boss, (to act as timers for the attacks- you could use procedures to count down the timers and reset them/trigger the attack when they reach zero), and then a procedure for the attack itself, which would trigger the animation, wait a couple of ticks depending on the length of the animation, and then fire a projectile, or deal damage using an entity iterator bracket to target entities that are caught in the radius of the attack. (Say, within a certain distance of your boss, or a certain distance of where their giant fist should be relative to their current position.)

But yeah, it'll be specific to whatever you're trying to do. Long story short, you need to code the attack manually.

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Gonna try to figure out…
Sat, 01/27/2024 - 18:10

Gonna try to figure out without image, but thank you anyway !

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I had make a tick procedure…
Tue, 12/31/2024 - 13:14

I had make a tick procedure to adjust the attack damage. Sometimes the attack animation can't be seen, but the damage has been made. I had use the procedure of geckolib to check the name of the animation in the certain tick, the mob was playing the animation, but I can't see it!

A starting point can be this…
Tue, 12/31/2024 - 13:32

A starting point can be this tutorial: https://www.youtube.com/watch?v=AybUiMcnq-U

One way to do it would be use AI attack task (e.g. melee attack) and use its "start" condition procedure to set value of synced data to true, and then just return true in all cases so the AI task still starts. This way, you can prime animation on the start of any AI task execution, for example.

Another way would be to check if entity has attack target set as the condition, but in this case attack may not be 100% synced.

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So, I have a question. My…
Wed, 01/01/2025 - 06:03

So, I have a question. My animation has 25ticks. I want to the mob attack other entity in 17th tick. Could you please tell me how to realize this? Sorry I am from China, my English is bad.

Ok one way may be to start…
Thu, 01/02/2025 - 14:34

Ok one way may be to start counting timer in start condition and only allow the AI task to run after N ticks, while animation starts as soon as the counter is not zero

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you very much, brother!
Fri, 01/03/2025 - 06:40

Thank you very much, brother!