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 !