Chunks problem

Discussion in 'Plugin Development' started by girardcome, Jan 14, 2015.

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


    I have the following code, however it does not seem to function. this work, except for chunk. When someone did the command /spawn (custom command), it's normally teleport him from a radius of 500x500 max, but i don't know why it's not loading chunks so when a player do the command /spawn it's teleporting him trough the void for 5 to 10 seconds (which is very very very very very very very very very very Boring). Please i need help.

    final Location loc = p.getLocation();
                        Random rand = new Random();
                        loc.setX(-500 + rand.nextInt(1000));
                        loc.setZ(-500 + rand.nextInt(1000));
                        Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
                            public void run() {
                        }, 20L);
                        return false;
  2. Offline


    That sounds more like the server being slow or the connection.

  3. Offline


    I believe the chunk becomes unloaded if there isn't a player in it. So either cancel the chunk when it tries to unload VIA the event, or load the chunk when you teleport the player.
  4. Offline



    Because the server is generating the chunks underneath him, which takes time. You can solve this by pre-loading the chunks.
  5. Offline


  6. Offline


    2L is only 2 ticks.

    Every second is 20 ticks so I'd suggest making the person wait 5 seconds before teleport. Which is 5 * 20
Thread Status:
Not open for further replies.

Share This Page