Reduction of tick event lag via random number gen

Started by ivanwafles67 on

Topic category: Help with modding (Java Edition)

Last seen on 19:34, 22. Dec 2023
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Reduction of tick event lag via random number gen

I am making a sort of territory system where people get certain anti-griefing effects upon entering an opponent's territory. However, this requires a large tick update procedure for multiple entities. To reduce the lag of this procedure, would this picture work, by which there's only a 10% chance that the procedure executes per tick, and thus would only run fully every half second? 

screenshot

Or does java load the entire procedure regardless of how much of it goes through? Would this method actually reduce lag?