22 lines
915 B
Java
22 lines
915 B
Java
package com.hypixel.hytale.builtin.commandmacro;
|
|
|
|
import com.hypixel.hytale.server.core.Message;
|
|
import com.hypixel.hytale.server.core.command.system.CommandContext;
|
|
import com.hypixel.hytale.server.core.command.system.arguments.system.RequiredArg;
|
|
import com.hypixel.hytale.server.core.command.system.arguments.types.ArgTypes;
|
|
import com.hypixel.hytale.server.core.command.system.basecommands.CommandBase;
|
|
import javax.annotation.Nonnull;
|
|
|
|
public class EchoCommand extends CommandBase {
|
|
private final RequiredArg<String> messageArg = this.withRequiredArg("message", "The message to send to the user of this command", ArgTypes.STRING);
|
|
|
|
public EchoCommand() {
|
|
super("echo", "Echos the text you input to the user");
|
|
}
|
|
|
|
@Override
|
|
protected void executeSync(@Nonnull CommandContext context) {
|
|
context.sender().sendMessage(Message.raw(this.messageArg.get(context).replace("\"", "")));
|
|
}
|
|
}
|