Teleport Minecraft players one by one?

Ce
- in Servers
4

I'm currently programming a game mode in Minecraft.

My problem now is that after the lobby phase all players are teleported to their location and that eats up a lot of performance and brings the server to lag for a short time.

My question now is how you can teleport players one after the other (e.g. One player every 0.5 seconds) so that it doesn't eat too much power at once.

Or maybe you have a different idea or an additional idea how to teleport because the server does not lag?

Dr

Why is the server lagging when you teleport a few players around.

Where is your server running? On a toaster?

Your code may not work very well. Efficient?
Or the server?

Ce

Instead of some pointless… Writing you can just answer? If I teleport ~ 40 players at the same time, you can see the processor kicking out briefly.

Pa

I understand your problem. Even with 60-70 players this shouldn't be a problem. Your solution with 0.5 seconds can be done but I would not recommend it. If you want, you can send a small code excerpt here and we can look for your mistake. As I said, that doesn't answer your question correctly, but something can't be right.

Ce

For (Player current: players) {

current.setGameMode (GameMode.SURVIVAL);

if (team.equals (BwTeam.ORANGE1))
current.teleport (map.getSpawnLocations () [0]);
if (team.equals (BwTeam.AQUA2))
current.teleport (map.getSpawnLocations () [1]);

}

This is roughly how my code is structured. Also a problem: when teleporting, sometimes a few players fall into a block before it could load and then get stuck in it.