You can make code run asynchronously from the main thread using runTaskAsynchronously. This is useful for doing intensive math or database operations, as they will prevent the main thread from freezing (and the server from lagging).
Few Bukkit API methods are thread-safe, so many will cause undefin...