Gecklib attack animation not syncing with damage

Started by Sharpblade1 on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Gecklib attack animation not syncing with damage

In using the geckolib plugin, I’ve noticed that when a mob with an attack animation attacks you, the player is damaged and then, the animation plays. In the mod “Call of Yucatah” created by “Sweetygamer2” they seemed to be able to use attack animations, and they work properly.

So is there anything you can suggest, for a solution to this problem of damage and then animation.

Thank you

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To fix this problem I…
Wed, 07/17/2024 - 14:20

To fix this problem I usually set the damage of the entity to 0 and make the procedure: 

-global trigger entity attacked 

-if source entity is subtype of (your custom entity)

-wait (duration of the animation) ticks 

-deal (how much damage you want the entity to do) damage to event target entity from source damage source of type: mob attack caused by: source entity

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you I'll try that.
Wed, 07/17/2024 - 15:18

Thank you I'll try that.

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Also if you could send a…
Wed, 07/17/2024 - 15:26

Also if you could send a screenshot, showing the procedure that would be very helpful.

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
So I tested using the…
Wed, 07/17/2024 - 19:59

So I tested using the producer that you sent in the image and I encountered two problems.

  1. The producer [deal (whatever) damage to -event/target entity- from source. Damage source type: (whatever) caused by: -source entity-.] Doesn't exist the thing closest to that is. [deal (whatever) damage to -event/target entity- Type: (whatever).]

 

       2. I created the producer put the name of my custom entity in [is -source entity- (sub)type of (my entities name)] put the event trigger on -entity attacked-. When the entity attacked me nothing happened, but when I attacked it the producer ran and my custom entity took damage, and then the producer looped and damaged the entity until it was dead.

I even put the player instead of the entities name in [is -source entity- (sub)type of (The player)]. And the same thing happened except I was damaged.

What I am trying to do is when the attack animation plays for my mob, I want to be able to sync it to the damage.

Here is what I am thinking when the attack/melee animation plays, if the player is in range he will be damaged if he is out or gits out of range he will not git damaged.

If you can think of a way to fix this problem, and can send me a screenshot I would appreciate it.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
1- It does exist, it's a…
Wed, 07/17/2024 - 20:19

1- It does exist, it's a combination of 2 blocks, first search "deal" in the search bar and take the block for entities (I think you already did this) then delete the pink block inside of it and replace it with :"damage source of type:(whatever) caused by: source entity" that can be found in the damage procedures tab

 

2- That's weird because the procedure works for me, could you send a screenshot? and what MCreator version are you using? 

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I searched and was unable to…
Wed, 07/17/2024 - 20:32

I searched and was unable to find the lines of code you where talking about.

My version is 2023.1

Here is the screenshot. https://ibb.co/CbxntdS

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the first event target…
Wed, 07/17/2024 - 20:38

the first event target entity should be source entity, and probably you don't find those lines of code because they added them after that version

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What do you mean "source…
Wed, 07/17/2024 - 20:42

What do you mean "source entity"? S is the name of my custom entity.

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I know, but you have to…
Wed, 07/17/2024 - 20:49

I know, but you have to replace the blue block that says "event/target entity" with another one that says "source entity" you can find it in the minecraft components tab

(replace only the first one)

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank so much for your…
Wed, 07/17/2024 - 20:55

Thank so much for your interest in helping me figuring this out. I am going to download the latest version of Mcreator, to see if you are right about the code not being in my version.

But I'm am not going to be back on the forums until at least Saturday, if the code is there in the new version I will test it and if I encounter any more problems I will contact you again.

Thank you and have a great day.

 

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's a pleasure 
Wed, 07/17/2024 - 20:57

It's a pleasure 

Last seen on 19:24, 7. Sep 2024
Joined Jul 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hello. So I installed the…
Sat, 07/20/2024 - 12:35

Hello.

So I installed the newest version, and the peace of code was there. I tested it and it worked but the damage is still looping. How to do deal with the looping problem?

Last seen on 11:33, 7. Sep 2024
Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did you replace the First …
Sat, 07/20/2024 - 13:31

Did you replace the First "event/target entity" block with "source entity"?