Player Variable in GUI is stuck at 0 when reloading the world

Started by Octave_ on

Topic category: Troubleshooting, bugs, and solutions

Last seen on 00:46, 5. Jun 2023
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Player Variable in GUI is stuck at 0 when reloading the world

I have a player variable that is set to an NBT value which ticks up when the player damages a mob. When the world is first loaded, the player variable is displayed correctly and ticks upwards when the mob is damaged. However, when the world is reloaded, the player variable is displayed as 0 in the GUI, even though the player variable still ticks up when a mob is damaged (using the /data get command). Additionally, a 'flickering' effect sometimes occurs where the variable will constantly change between 0 and the correct value on the display (in this case the variable still functions normally in the background, it's simply the GUI that is messing up).

Do not use player NBT but…
Thu, 04/29/2021 - 07:49

Do not use player NBT but player variables. Read more on our wiki on variables page.

Last seen on 00:46, 5. Jun 2023
Joined Apr 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you for the reply. I…
Mon, 05/03/2021 - 11:10

Thank you for the reply.

I was using NBT as I can't seem to update player variables within the 'Entity Attacked' global trigger. I understand that NBT has issues with server/client syncing however it was the only method I had found to bypass player variables not updating in that global trigger.