ive been trying to make a custom command on forge 1.8.9, but I couldnt find any guide or ducumentation on how to create argumens for the commands, the thing I want to do is for example "/settext ExampleText", the "ExampleText" should be a String, if anyone knows a solution I would really appreciate it.
I tried searching for documentation, youtube videos but couldnt find anything
Arguments by default (if there are no overloads) - are of string type already.
@Override
public void processCommand(ICommandSender sender, String[] args) {
if (args.length > 0) {
sender.addChatMessage(new ChatComponentText("you have set the text: " + text));
} else {
sender.addChatMessage(new ChatComponentText("Usage: /settext <text>"));
}
}
im wrote the code from this template:
public class SimpleCommands extends CommandBase {
@Override
public String getCommandName() {
return "whatsup";
}
@Override
public String getCommandUsage(ICommandSender sender) {
return "";
}
@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
// This is where I want it to send something in chat.
}
}