cooldown and combat system procedure

Started by zorualeloupsolitaire on

Topic category: Help with Minecraft modding (Java Edition)

Joined Nov 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
cooldown and combat system procedure

Hello !

 

I have a problem with the combat system of my mod. Specifically, I've created a variable (see photos) to act as a cooldown.

 

I made several tests and yes, my entity is affected by the variable, what bothers me is that this variable “attackcool” is set to “false” by default.

And when I ask it to set it to “true”, I get the impression that it doesn't do so.

 

This procedure is based on the fact that the entity is hit, so every time it has less than 30 hp, it throws a projectile at me. When it shouldn't do so, it should have a 5-second delay before throwing another one at me.

 

Can someone explain where I'm going wrong?

 

Thanks in advance!


Procedure

another procedure

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Are you absolutely certain…
Thu, 06/26/2025 - 13:22

Are you absolutely certain that the entity is affected by the variable?

I would recommend trying with synced entity data or nbt tags in case it is the variable causing the problem. Because I don't think that a player variable can work for non-player entities, and that might be why it isn't being updated.