Solved incorrect return?

Discussion in 'Plugin Development' started by user_91277742, Apr 16, 2018.

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

    user_91277742

    Hi there!
    So.. when i run a command, appear the command in the chat and i tried to remove that command by the return, but.. doesnt works.
    Code:
                if(cmd.getName().equalsIgnoreCase("qanunciar")) {
                    for (Player p : Bukkit.getOnlinePlayers()) {
                        main.anuncioQuidditch(p);
                    }
                    return true;
                }
    
    P.D: Happends in all my commands in this plugin
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    user_91277742

  4. Offline

    timtower Administrator Administrator Moderator

    @Ahrigumi Please post the full method then.
     
  5. Offline

    user_91277742

    @timtower
    In the commands "set" doesnt appear the commands in the chat, but the rest yes.
    Code:
    @SuppressWarnings("deprecation")
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(sender instanceof Player){
                Player player = (Player) sender;
                if(cmd.getName().equalsIgnoreCase("qsetball")) {
                    String world = player.getWorld().getName();
                    main.getConfig().set("Balon.World", world);
                    main.getConfig().set("Balon.X", player.getLocation().getX());
                    main.getConfig().set("Balon.Y", player.getLocation().getY());
                    main.getConfig().set("Balon.Z", player.getLocation().getZ());
                    main.saveConfig();
                    main.reloadConfig();
                    player.sendMessage(blabla);
                    return true;
                }
                if(cmd.getName().equalsIgnoreCase("qsetlobby")){
                    String world = player.getWorld().getName();
                    main.getConfig().set("Lobby.World", world);
                    main.getConfig().set("Lobby.X", player.getLocation().getX());
                    main.getConfig().set("Lobby.Y", player.getLocation().getY());
                    main.getConfig().set("Lobby.Z", player.getLocation().getZ());
                    main.getConfig().set("Lobby.Yaw", player.getLocation().getYaw());
                    main.getConfig().set("Lobby.Pitch",player.getLocation().getPitch());
                    main.saveConfig();
                    main.reloadConfig();
                    player.sendMessage(blabla);
                    return true;
                }
                if(cmd.getName().equalsIgnoreCase("qempezar")) {
                    if(isStarted = false) {
                        isStarted = true;
                        //stuff
                        return true;
                    }
                    return true;
                }
                if(cmd.getName().equalsIgnoreCase("qanunciar")) {
                    for (Player p : Bukkit.getOnlinePlayers()) {
                        main.anuncioQuidditch(p);
                    }
                    return true;
                }
                if(cmd.getName().equalsIgnoreCase("qasistir")) {
                    main.entrarPartida(player);
                    main.setBoard(player);
                    player.sendMessage(blablabal;
                    return false;
                    }
                }
            }
            return true;
        }
    }
    
     
  6. Offline

    timtower Administrator Administrator Moderator

    @Ahrigumi If you change the usage in the plugin.yml, does the message change with it?
     
  7. Offline

    user_91277742

    @timtower
    I have in plugin.yml to all my commands
    Code:
    command:
          usage: /<command>
          description: blabla
    
     
  8. Offline

    timtower Administrator Administrator Moderator

    @Ahrigumi But does the message change if you change the usage in the plugin.yml
     
  9. Offline

    user_91277742

  10. Offline

    timtower Administrator Administrator Moderator

    Is it the only plugin on the server next to the dependencies?
     
  11. Offline

    RcExtract

    Don't understand ur situation. Do u mean the usage of command is returned? If so, have u registered the command executors?
     
  12. Offline

    user_91277742

    @RcExtract obviously yes

    @timtower I tested with all my plugins and I fixed the problem... was an export error.
    Days ago i exported the same plugin but with a different name.. so... facepalm x2
     
Thread Status:
Not open for further replies.

Share This Page