How To Overlay a variable

Started by Mkm_Gamer on Tue, 12/06/2022 - 10:53

Topic category: Help with modding (Java Edition)

Last seen on 13:04, 28. Dec 2022
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How To Overlay a variable
Tue, 12/06/2022 - 10:53

Hello I would like to know how to display a variable on an overlay. The variable is of type number and player persistence , i Made a procedure that when a player kills a mob it adds 1 to the variable and I would like to show that variable on the players screen as a kill count. i would really appreciate any help 

Last seen on 13:04, 28. Dec 2022
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I looked at it and it really…
Tue, 12/06/2022 - 20:25

I looked at it and it really doesn’t help that much but the main problem is with the procedure I think , what is basically happening is I made a global trigger procedure when an entity dies and checking is source entity is server player and target entity zombie then I set my variable to ( get variable + 1) but it does not update in the overlay

If you would like a screenshot instead let me know 

Last seen on 13:04, 28. Dec 2022
Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I see there has been no…
Wed, 12/21/2022 - 19:23

I see there has been no reply to this so I’ll be more in depth. The code for setting the variable(btw is a number and the gui is on var:integer:variable name)

 

Global trigger is when entity dies 

If - is source entity sub type of PLAYER

Do - Set global:Variable name to ( get global variable name + 1) for entity event/target entity 

 

If anything is wrong please tell me