Re-implementing PluginInterface event.wait