Package 

Interface CommandListener

  • All Implemented Interfaces:

    
    public interface CommandListener
    
                        

    Provides an interface to listen for command execution, with the option to intercept the command and execute your own code instead. Listeners are registered in data/console/command_listeners.csv.

    Important performance note:CommandListeners are persistent through the entire game session, so be careful with your memory management!

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

    • Method Detail

      • onPreExecute

         abstract boolean onPreExecute(@NotNull() String command, @NotNull() String args, @NotNull() BaseCommand.CommandContext context, boolean alreadyIntercepted)

        Called before a console command is executed, and gives the listener a chance to intercept execution and run its own code.

        Parameters:
        command - The command that is about to be run.
        args - The arguments passed into the command.
        context - The current console CommandContext.
        alreadyIntercepted - Whether another, higher-priority CommandListener has already declared they will intercept execution for this command.