How to make a one-time procedure

Started by AndreychelQx on

Topic category: Help with modding (Java Edition)

Last seen on 20:37, 18. May 2024
Joined Apr 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a one-time procedure

May I ask you a question about MCreator? How to make a one-time procedure there (so that after its execution it does not work again)

Last seen on 05:05, 30. Oct 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First idea that comes to…
Mon, 04/18/2022 - 23:01

First idea that comes to mind is to use a global variable as a flag.  Set the  procedure to run only if the flag hasn't been set.  As part of the procedure set the flag to prevent further occurrences.