Returning Number Variable as text in a gui

Started by SSockfire on

Topic category: Help with modding (Java Edition)

Last seen on 15:16, 8. Apr 2024
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Returning Number Variable as text in a gui

Im Attempting to make a mana system for the mod im working on, but when i run it, minecraft is really slow. It uses 2 different procedures, one that gives the player 1 mana in a infinite loop when the player joins the world,  and another that returns the variable to a gui so the player can see it. The problem is that the game is REALLY slow. I dont know what the problem is.

Procedures: https://imgur.com/a/eMiKF4n

Plz Halp!

Last seen on 13:24, 6. Jun 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
actually, it's intentional…
Mon, 08/21/2023 - 15:51

actually, it's intentional that MCreator runs slowly, when you'll export the mod and test it in real minecraft, the lag will be gone, don't worry, nothing is wrong with your procedures

Last seen on 15:21, 16. Oct 2023
Joined Oct 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe the delays could…
Mon, 08/21/2023 - 16:54

I believe the delays could be due to an infinite loop on player join trigger. 

Consider using the player tick trigger (runs every tick, 20 ticks per second) instead of creating an infinite loop. Set up a player persistent/lifetime variable (based on whether death should also reset it) as a tick counter and increment it every tick. When the counter reaches a certain value, reset it and proceed with your task.

Last seen on 15:16, 8. Apr 2024
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks so much! This really…
Mon, 08/21/2023 - 17:42

Thanks so much! This really helped!