Make commands not show in the console?

Discussion in 'Plugin Development' started by tylersyme, Jul 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    tylersyme

    Is there a way to keep the console from displaying the commands my plugin uses? This is a security type of plugin and I don't want those messages to show up in the console
     
  2. Offline

    soulofw0lf

    don't register the command in the plugin yml and make your PlayerCommandPreProcess event listen for them instead, make sure you cancel the event if it is your command that is inserted and have all your command handling from that event instead of the regular command handler
     
    Crast likes this.
  3. Offline

    Alex5657

    Need example code for that?
     
  4. Offline

    tylersyme

    that would be nice :)
     
  5. Offline

    soulofw0lf

    here's the method from my api
    Code:java
    1. @EventHandler(priority = EventPriority.HIGHEST)
    2. public void playerCommand(PlayerCommandPreprocessEvent event) {
    3. Player p = event.getPlayer();
    4. String s = event.getMessage();
    5. String[] args = s.split(" ");
    6. String cmdAlias = args[0].replaceAll("/", "");
    7. for (String command : commands) {
    8. if (cmdAlias.equalsIgnoreCase(command)) {
    9. event.setCancelled(true);
    10. UniqueCommands.BaseCommandHandler(p, args);
    11.  
    12. }
    13. }
    14. // For testing Trading
    15. args[0] = args[0].replace("/", "");
    16. TradeCommandProcessor.process(p, args);
    17. }


    if you want to look more into it feel free to browse around my github
    https://github.com/soulofw0lf/RpgAPIyou'll see the BaseCommandHandler method i have setup in the UniqueCommands has individual command handlers within it for each part of my plugin, look into those methods to see it functions just like setting up a regular command handler.
     
Thread Status:
Not open for further replies.

Share This Page