Checking a world a player is running an event or a command in

Discussion in 'Plugin Development' started by grasshopperMatt123, Mar 16, 2014.

Thread Status:
Not open for further replies.
  1. Hello, I am fairly new to Bukkit and am wondering if there is a way to check what world a player is either running an event in or a command in. thanks -Matt
     
  2. Offline

    Wizehh


    PHP:
    World world player.getWorld();
    //Compatible return type
     
  3. Offline

    The Fancy Whale

    Code:java
    1. Player player = event.getPlayer();
    2. World world = player.getLocation().getWorld();
     
  4. I need it to check the name of 1 world and not work in the others, these 2 ways both get what world the player is in.
     
  5. Offline

    JD_Guy17

    Some thing like this? grasshopperMatt123

    Code:
    Player player = event.getPlayer()
     
    if (!(player.getWorld().equals("youworldname"))) return;
     
    grasshopperMatt123 likes this.
  6. JD_Guy17 Thank you, this is just what I was looking for, thumbs up'ed by me :)
     
Thread Status:
Not open for further replies.

Share This Page