Started by
Ypermat
on
Topic category: Help with Minecraft modding (Java Edition)
Hello !
I am trying to do an achievement + looting tables mod to work with a modpack.
I am trying to check how many zombies / zombified creatures (including piglins) the player have killed.
But the problem is that the variable is not going up. I displayed multiple messages ("before add" and "after add") to see what is going on and see the second image, it seems that the variable reset to 0 every time.
The variable is created as "number".
1st image :
Second image :
Thank you in advance !
1st image :
Second image :
You're using a Local Variable to store your count. These are "local" to the procedure trigger instance that they are in, they reinitialize each time the trigger is called.
You need to use a Global Variable, in this particular case, the PLAYER_PERSISTENT variety. You can assign global variables by opening the "Variables" tab on the main workspace.
Thanks for the answer !
Unfortunatly, now, the variable won't even go up...
Sorry to bother you :/
I figured it out, I'm just dumb, the variable was for the target entity instead of the source entity, the player...
Thank you very much !