Plugin for lobby

Discussion in 'Spigot Plugin Help' started by deret123, May 13, 2015.

  1. Hi everybody, I need help to develop plugin it will be for use a command if a player is in the good world but I've begin to learn java today and it's very difficult for me...
    I've try with this but don't work there's probably lots of mistakes ...
    public boolean onCommand (CommandSender sender, Command cmd, java.lang.String label, String args[]) {

    Player player = (Player) sender;
    if (sender instanceof Player) {

    if (label.equalsIgnoreCase("lobby") ) {
    if ( player.getWorld().getName() == "world") {
    player.getServer().getConsoleSender().sendMessage("/gamemode 1");
    player.sendMessage("Work");
    return true;
    }
    return false;
    }
    Thanks for your help :)
    And sorry if my english is bad
     
  2. Try just writing return false; or return true; not both, but both work if they are alone, maybe that is your problem