Started by
ManuehTheModder405
on
Topic category: Help with Minecraft modding (Java Edition)
In my mod there's an entity that always track the player, the problem is that i need to use the procedure "find path movement to (x,y,z) with speed...", i have to put it into entity tick update, and im not the only one because i've seen in other posts that other people does/recommends it, but when i do it i suffer lag spikes every time the mob moves (cause is a weeping angel), i don't know if only happens to me, i tried increasing the ram to 8000mb but still the same, does anyone know about this or has suffered the same bug?
Edited by ManuehTheModder405 on Fri, 03/29/2024 - 12:08
Calling this every tick will lag a lot. The procedure is very heavyweight and it can't be executed on every tick as this will overload computer resources
I've already noticed that something was wrong about the tick update, but when every post that i found said that this must be inside it and made me doubt and try it. Thanks, i will try another way to do it ;)
One way would be to only run the procedure every N ticks, say 100 ticks and cache the value in-between somehow
I've done something different before reading your answer but I realized that your way is more optimized than using a global value that updates every tick, I'm going to try it, thank you so much :D