Wait or delay function?

Started by Spleen on

Topic category: Mod design feedback

Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wait or delay function?

I have a simple mod that enables flying when you are near your spawn/bed. This allows people on our survival server to build around their home easily, but doesn't break the game by allowing them to fly everywhere and avoid all danger.

I am checking SpawnX/Z NBT tag to make sure they are near enough before enabling flying, but I also have to then have a function that turns flying off if they go outside the radius. 

What is the right procedure for this? I keep trying to use the "Wait x ticks then do" procedure but it freezes the game. Is there a better way to do this using do/while loops? is there any other kind of delay function or way to monitor a variable until it goes above a threshhold?

I am not very good at this so if there is a much better complete approach to this, I am all ears. 

There are plenty of waits to…
Mon, 08/01/2022 - 09:56

There are plenty of waits to wait.

I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei