Get CommandSender location?

Discussion in 'Plugin Development' started by Tauryuu, Feb 11, 2012.

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

    Tauryuu

    I can't find a way, possible with this. Please help, thanks!
     
  2. Offline

    ThatBox

    Code:java
    1. Player p = (Player) commandSender;
    2. p.getLocation();
     
  3. Offline

    ZephyrSigmar

    First its nice to make sure the sender is a player.So:
    Code:java
    1.  
    2. //If sender is a Player
    3. if(sender instanceof Player){
    4. //Then we cast the sender to player,which means now we can handle him through 'player' variable like any other players
    5. Player player=(Player) sender;
    6. player.getLocation();
    7. }
     
  4. Offline

    ThatBox

    :p Forgot that.
     
Thread Status:
Not open for further replies.

Share This Page