How to optimize this procedure?

Started by dingusman on

Topic category: Troubleshooting, bugs, and solutions

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to optimize this procedure?

I am making an ultra hard mode mod and the internal server keeps crashing, and I think this procedure might be the cause. Any way to optimize this?

Image: Image (You may have to zoom in)

If you do in range check to…
Sun, 02/22/2026 - 20:49

If you do in range check to not be null, save entity to local variable first.

Checking in range so many times is a very bad idea due to crashes and lag.

See https://mcreator.net/wiki/my-entity-procedure-crashes-game

---

In short, set entity in range to local variable of type enty, and then do null check and actions on this local variable instead

Joined Apr 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried that, and it still…
Thu, 03/05/2026 - 09:04

I tried that, and it still lags beyond comprehension