sandstone-mc / sandstone

Sandstone | Next Generation Framework for Minecraft
https://sandstone.dev/
MIT License
171 stars 15 forks source link

Add `await until()` #194

Open MulverineX opened 1 year ago

MulverineX commented 1 year ago

await until(condition: ConditionNode, pollRate: TimeArgument)

Will poll until the condition is met instead of a timer or a nested while. pollRate runs off a global loop; possible delay till first check is 0..pollRate. Evaluates to setting a temp score to the global until score (for the pollRate), adding to the global until score, adding to the local until score, & if the temp score is 0 will run the global loop. When a local until terminates it will subtract from the global & local until scores. If a local until score reaches 0 the condition will not be tested (add visitor for command conditions). If the global until score (for the pollRate) reaches 0, do not continue the loop.