Teleporting a large number players (around 50)

Discussion in 'Plugin Development' started by dillyg10, Feb 14, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    dillyg10

    Hi there. So I need to be able to teleport about 50+ players to one location.... when i've tried, it will cause the players clients, and the server, to lag quite a bit. Any ideas on how to fix this? I know servers like Annihilation have managed to do this on a much larger scale.
     
  2. Offline

    GaaTavares

    Well I'm not sure but I think the unique way is using a for loop, which may lag if your server isn't "ready" for it. I mean, tps,etc
     
  3. Offline

    coasterman10

    Create a class, let's say, PlayerTeleporter or something, that contains an ArrayList of players to teleport. Schedule an event that runs every tick or two that teleports only a certain number of players at a time, say, 10. I say use an ArrayList since you can store an integer storing the current index, and then every tick you iterate through 10 more people starting at that index.
     
  4. Offline

    dillyg10

    Actually tried What GaaTavares said, did not alivate the problem.
     
  5. Offline

    xTrollxDudex

    dillyg10
    Use a BukkitRunnable to iterate to the next player per tick.
     
Thread Status:
Not open for further replies.

Share This Page