Hello i used this code in my plugin project
public static void teleportToSpawn(Player player) {
Main.getPlugin().getServer().getScheduler().runTask(SpeedRun.getPlugin(), () -> {
player.teleport(Settings.spawnLocation);
});
}
and by spark profiler this produce massive lags when server reach like 90 players, there's any reason why and way to fix this?