Delay respawning

Discussion in 'Plugin Development' started by Josvth, Oct 28, 2011.

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

    Josvth

    I've made a plugin called Random Spawn that spawns players at a random location in the world when they die. It works quite well but the only problem is that when a player is spawned at a location that is not generated it causes the server to lag. Is it possible to delay the respawning until the respawn location is generated?
     
  2. Offline

    jblaske

    I would check the world object, maybe try doing a getBlock() for the location you intend to spawn them, and if its null then pick a new location.

    I'm not sure if a call to getBlock() will cause a chunk to generate or not however, you might want to test that out.
     
  3. Offline

    Josvth

    getBlock() will not cause a chunk to be generated. It appears it only loads a chunk. But I want to be able to spawn players in ungenerated chunks.

    I've tried the regenerateChunk(int x, int z) methode but it gives me an error. How do I use this methode? And could it be usefull?
     
Thread Status:
Not open for further replies.

Share This Page