This will NullPointerException if sent from console. Better way like this : 
```java
if (sender instanceof ProxiedPlayer) 
{
    ProxiedPlayer player = (ProxiedPlayer) sender;
    player.sendMessage( ChatColor.BLUE + "You are in the " + player.getServer().getInfo().getName() + ".");
} else {
    sender.sendMessage( "This command can only be sent from ingame" );
}
```

Something like that.