var Bukkit = org.bukkit.Bukkit;
Bukkit.getScheduler().runTask(Bukkit.getPluginManager().getPlugin("OpenJS"), new java.lang.Runnable({
run: function() {
// code you want to execute in the main thread here
// example: Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
// dispatchCommand only works in the main thread, allowing the script to execute commands
}
}));