echo command

This commit is contained in:
Chipmunk 2023-01-19 18:43:46 -05:00
parent 5deddd71ab
commit 7016057399

View file

@ -14,19 +14,18 @@ public class RunCommand extends Command {
super(); super();
this.node( this.node(
literal("run") literal("echo")
.then( .then(
argument("command", greedyString()) argument("text", greedyString())
.executes(this::run) .executes(this::echo)
) )
); );
} }
public int run (CommandContext<CommandSource> context) { public int echo (CommandContext<CommandSource> context) {
final CommandSource source = context.getSource(); final CommandSource source = context.getSource();
final ChipmunkBot client = source.client(); final String text = getString(context, "command");
source.sendOutput(Component.text(text));
client.core().run(getString(context, "command"));
return 1; return 1;
} }