Hey, I'm trying to create a command with BrigadierCommand.
Command:
/Server <Server>
If the player execute this command he send to the <server>. My problem is that I want to send the player a usage message if he only use "/Server", "/Server something something" so for all other cases where the argument length is not one. Here is my code:
Command:
/Server <Server>
If the player execute this command he send to the <server>. My problem is that I want to send the player a usage message if he only use "/Server", "/Server something something" so for all other cases where the argument length is not one. Here is my code:
Java:
LiteralCommandNode<CommandSource> cmd = LiteralArgumentBuilder
.<CommandSource>literal("server")
.then(RequiredArgumentBuilder.<CommandSource, String>argument("argument", StringArgumentType.word())
.executes(context -> {
// send player to the server
return 1;
})
.build()
)
// else part ???
.build();
- Version Output
- Velocity 3.1.2-SNAPSHOT (git-74edac96-b153)