So i made this code (in 1.15.2):
@Mod.EventBusSubscriber
public class Events {
@SubscribeEvent
public static void CommandEvent(CommandEvent event) {
String cmd = event.getParseResults().getReader().getString();
cmd.replace("%value%", "example");
}
}
But i cant find how i can edit the command itself before it gets executed.
I can't use ChatEvent because i also want to edit the commands from a command block,
thanks for the help.
Hello,
i was wondering how i can intercept a command, so i can replace certain things in the command and then execute the command when it's edited.
I want to be able to use variables inside my commands, like %variableName%, those get then changed to the value of the variable,
thanks for the help.