Overlay does not display global var

Started by Zatrex on Thu, 09/01/2022 - 17:09

Topic category: Help with modding (Java Edition)

Last seen on 17:58, 13. Oct 2022
Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Overlay does not display global var
Thu, 09/01/2022 - 17:09

Hello, I want to display the ammoCharged global variable in an overlay but the overlay displays the value for a millisecond then displays 0. To be sure I print the values ​​in the chat every tick and the values ​​are never at 0 so I don't don't understand why it displays a 0!

overlay : https://postimg.cc/mzY9LjbM

var : https://postimg.cc/kBrHhXHp

ingame : https://postimg.cc/sQ7L3kQc

ps: sorry for my poor english
Last seen on 15:38, 26. Nov 2022
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Variables of the type player…
Thu, 09/01/2022 - 20:49

Variables of the type player_persistent and player_lifetime are server side and won't work with GUI.

You need to use a global variable of the type Global Map that has the value of the player_persistent Variable.

Last seen on 17:58, 13. Oct 2022
Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thank you for your reply. I…
Thu, 09/01/2022 - 21:11

Thank you for your reply.
I have a player_persistent type var named money which works with my GUI so I don't really understand.
If I make a global type var and go to a server, all players will have the same value for this variable, right?

Last seen on 17:58, 13. Oct 2022
Joined Feb 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
solved! I used an nbt tag…
Thu, 09/01/2022 - 21:39

solved! I used an nbt tag instead. Thank you anyway for your help