Started by
zorualeloupsolitaire
on
Topic category: Help with Minecraft modding (Java Edition)
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!
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.