Stevertus / mcscript

A programming language for Minecraft Vanilla
https://mcscript.stevertus.com
MIT License
236 stars 17 forks source link

Add schedule code blocks #34

Open mathgeniuszach opened 3 years ago

mathgeniuszach commented 3 years ago

Minecraft has support for a built in function called schedule that combined with code blocks could create very basic asynchronous code. Supporting the schedule command as a language feature rather than a command is mostly just syntactic sugar:

after (<time>d|s|t, replace) {
    /say hi!
}

The replace field is optional and could be a different keyword or identifier. By default though, this should compile to append rather than replace.

This would be similar to putting your code in other function and calling /schedule

Heath123 commented 3 years ago

Sadly this isn't really supported or updated any more...