Command Chat

Discussion in 'Plugin Development' started by ItsBlockFighter, May 14, 2017.

Thread Status:
Not open for further replies.
  1. Hi!
    I made a command and I want you to enter /b (text) to type (Playername) >> (text)
    How could this be solved?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @ItsBlockFighter Probably want to add a target variable.
    Loop through the arguments with an int for loop.
    Start at the position where the message starts.
    Stop at the end of the array.
    Put the strings together ( don't forget the spaces :p )
    Send the message.
     
  3. @timtower
    Somehow should I start?
    Code:
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args) {
            Player target = (Bukkit.getServer().getPlayer(args[0]));
                if(cmd.getName().equalsIgnoreCase("b")) {
            }
            return false;
        }
    }
    If so how do you go on?
     
  4. Offline

    timtower Administrator Administrator Moderator

    RcExtract likes this.
  5. Offline

    Forest_SD

    Last edited: May 18, 2017
    Listvli likes this.
Thread Status:
Not open for further replies.

Share This Page