Solved Teleport all players from a world to default world.

Discussion in 'Plugin Development' started by LegacyGaming, Dec 14, 2014.

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

    LegacyGaming

    I have come code which should teleport all the players from a world but it doesn't teleport the player. It just skips that code. Any ideas?

    Code:
                        List<Player> PlayerList = Island.getPlayers();
                        for (Player Players : PlayerList) {
                        if(Players.getWorld().equals(WorldName)) {
                        Players.teleport(Spawn.getSpawnLocation());
                        }
                        }
     
  2. Offline

    TheCodingCat

    whole class please
    EDIT: is WorldName the name of a world because then you should check the worlds name with
    World#getName()
     
  3. Offline

    LegacyGaming

    WorldName is equal to "String WorldName = Player.getWorld().getName();" That works fine, i am using that else where and it works exactly like it should. Its just when it comes to get the players its not working.
     
  4. Offline

    ChipDev

    You are checking if a World equals a string. no no
     
  5. Offline

    LegacyGaming

    Nope, not if the world equals a string, if the world name equals a string. Besides, i fixed it anyway.
     
Thread Status:
Not open for further replies.

Share This Page