Started by
SSockfire
on
Topic category: Help with Minecraft modding (Java Edition)
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!
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
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.
Thanks so much! This really helped!