Topic category: Help with MCreator software
I have two variables, x and x_Max. x ranges from 0 to x_Max.
Both of these variables are set to 0 in the 'initial value' box of the 'Variables' tab. When the player damages a mob, I have it set so that the player's NBT value 'x_NBT' will increase by 5, up to a value of x_Max_NBT. x_NBT is set to 0 when the world in loaded in and x_Max_NBT is set to 50 at the same time. The GUI that displays this information is using the <VAR:integer:x> and <VAR:integer:x_Max> values. I have a procedure that sets the value of x and x_Max to the value of their NBT counterparts x_NBT and x_Max_NBT respectively.
My issue is this:
When the world is first loaded, this works the way I intend. The information on the GUI is updated correctly and the NBT data lines up with the variable data given by the /data get command. However, when I exit the world and rejoin, the values on the GUI seem to 'flicker' constantly between 0 and whatever values I left the world with, so for example x would flicker between 25 and 0 and x_Max would flicker between 50 and 0. I have tried everything I can think of trying to solve this issue and have searched the forums for a suitable solution, however they seems outdated, or Klemen has said personally that the issue I have was fixed upon the introduction of the player variables (all of the issue reports have been before 2020). I am pulling my hair out over this as it is super frustrating and I have spent so much time working on solving this small issue. Thank you.
I think this issue can be circumvented if I found a way to change player variables using the 'Entity Attacked' external call.