What is better for performance

Started by nilek20 on

Topic category: Advanced modding

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What is better for performance

I am making a very large mod with a couple thousand lines of block code and had a couple of questions on how to make sure it runs well.

First. I have a procedure that updates globally of player tick update. this procedure is going to need to run about 50 individual functions. is it better to have those functions in there own procedures and then call them with the main procedure or have them all in the main procedure.

Second. This question is similar to the first but with some nuance. I have multiple procedures that change how much damage the player does, some triggering on the players side and some on the target entities side, is it better to combine them all in to one procedure for each global trigger or should i keep them separate.

Third. How does Minecraft call global triggers. In specific does have a lot of global triggers with if conditions cause lag or can you get away with having alot of small global trigger procedures.

First. I have a procedure…
Sun, 08/31/2025 - 12:44

First. I have a procedure that updates globally of player tick update. this procedure is going to need to run about 50 individual functions. is it better to have those functions in there own procedures and then call them with the main procedure or have them all in the main procedure.

Does not matter that much. Do it in a way that is clearer. Still keep in mind that if 50 those functions are complex, your game will lag a lot. Global tick triggers are not supposed to be heavy at all.

Second. This question is similar to the first but with some nuance. I have multiple procedures that change how much damage the player does, some triggering on the players side and some on the target entities side, is it better to combine them all in to one procedure for each global trigger or should i keep them separate.

Best to do one global trigger and then call other procedures if too complex.

Third. How does Minecraft call global triggers. In specific does have a lot of global triggers with if conditions cause lag or can you get away with having alot of small global trigger procedures.

It is all about what those triggers do. Calling many empty triggers is not a problem, but if you do a lot of complex stuff there, the game will lag