Help reducing lag from tick events

Started by KingBugz on

Topic category: Help with modding (Java Edition)

Last seen on 05:06, 6. Jul 2023
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help reducing lag from tick events

So short and sweet as usual,

I my mod produces a HUGE amount of lag, this appears to be from too many tick events. My question is can I keep the events while reducing lag, or would combining procedures with the same global event help?

Also would item held and such tick events cause this lag without having the item in inventory? Or do these ticks only trigger once you have the item/holding the item?

 

ANY HELP WOULD BE GREATLY APPRECIATED, ty.

Last seen on 00:03, 27. May 2022
Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
All i know for sure is too…
Mon, 10/19/2020 - 23:16

All i know for sure is too many things happening at once will cause allot of cpu and ram usage.

to combat this the best way is either to reduce the amount happening entirely or reduce the amount happening at once by using a timer/cooldown procedure.

the last and final piece of advice is to take out anything that is not needed or Simplify what you have already so it's not doing more than needed.

if you need help understanding how to make a timer there are plenty of videos and info out there with a simple search.

Last seen on 05:06, 6. Jul 2023
Joined Sep 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I cant think of much that…
Tue, 10/20/2020 - 01:40

I cant think of much that would be going on at all times is the problem there.

Most things need to be unlocked. But I did notice a big improvement when combining procedures with the same global trigger.

Triggers will cause…
Wed, 10/21/2020 - 19:25

Triggers will cause additional computing, use as little tick triggers as possible, and don't do much in procedures called on ticks.