Hey! I'm making a plugin where users are writing lua code and it's being run asynchronously and being monitored. I want the user to be able to cancel certain events like on break block but I know that you can not cancel events asynchronously. I was wondering if there was any way (Other than manually undoing the event) to cancel the event while not on the main thread
I had an idea which was to cancel the event when it's received but then "uncancel" it when the thread gets around to the event. I would rather not do this because it would mean manually reimplement a ton of mc code that Id rather not do haha.
The reason I don't want the event to be handled on the main thread is that the users' lua code potentially can create some lag or can create some wait time which is not ideal running on main.
So if there's a better solution to this I'm all ears! If not I am alright manually creating uncancel functions