Solved Need some help with console time command.

Discussion in 'Plugin Development' started by Mozartripper, Mar 1, 2013.

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

    Mozartripper

    Hi I am currently trying to make a console only command(that I can use with command blocks as well) to set the time of the specified world.
    This is my current code:
    Code:
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        //Time
        if (cmd.getName().equalsIgnoreCase("timed")) {
            if(!(sender instanceof Player)){
                StringBuilder world = new StringBuilder();
                if (args.length == 1) {
                    world.append(args[0]);
                    getServer().getWorld(world.toString()).setTime(1000L);
                    return true;
                    }
                }
            else {
                return false;
                }
        }
    But when I type "timed world" in the console it says unknow command.
    Any help would be appreciated !
     
  2. Offline

    caseif

    Have you registered the command in the plugin.yml?
     
  3. Offline

    Mozartripper

    Damn I wrote timd instead of timed. Feel so stupid lol. Thx for the quick help !
     
Thread Status:
Not open for further replies.

Share This Page