Solved how to get if the player is in a specific world

Discussion in 'Plugin Development' started by KarimAKL, Mar 19, 2018.

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

    KarimAKL

    As the title says, how do i get the world the player is in? (I mean the world name like 'if player is in world with name "world" do this and that) What i've tried:
    Code:
    if (p.getWorld().getName().equals("world")) {
    }
    if (p.getWorld().getName().equalsIgnoreCase("world")) {
    }
    
     
  2. Offline

    Zombie_Striker

    @KarimAKL
    Do exactly what you have above.

    If you know the exact name, with the exact capitalization *(which you do), use .equals. Only use .equalsIgnoreCase if you do not know the correct capitalization.
     
  3. Offline

    KarimAKL

    Okay, so that means i did it right then? If so i'll change the title to Solved.
     
  4. Offline

    Matthewenderle

    Yes, that's correct.
     
  5. Offline

    KarimAKL

    Okay, thanks alot for the help. :D
     
Thread Status:
Not open for further replies.

Share This Page