Send Raw Console Message, Scanner

Discussion in 'Plugin Development' started by RcExtract, Mar 16, 2018.

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

    RcExtract

    So System.out.println("hi"); will become a log in console. Can i make it not a log? Also, can i use java.util.Scanner to detect input from console? Or should i use ServerCommandEvent? Thanks.
     
  2. Offline

    Zombie_Striker

    @RcExtract
    1. I don't think there is a way to intercept the println messages. For messages sent either by loggers or broadcasting systems, you can apply a Filter to the logger to catch any message you want: https://www.spigotmc.org/threads/intercept-broadcastmessage-output.130273/
    2. If you need to detect valid commands, use ServerCommandEvent. If you also need to detect for non-existant/unknown commands, then you will need to use a scanner.
     
  3. Offline

    RcExtract

    I think Bukkit did System.setOut(OutputStream) so the format of println can be changed. But i am not familiar with java.io. Please try helping again.
     
  4. Offline

    timtower Administrator Administrator Moderator

    @RcExtract Why do you need to change the message?
    And for what will the input be?
     
  5. Offline

    RcExtract

    Because i want to send messages to the console which are completely not related to logging
    I want to detect input from console without considering it as a command
     
  6. Offline

    timtower Administrator Administrator Moderator

    @RcExtract Not sure of the conversation api can handle the console.
     
  7. Offline

    RcExtract

    The only 3 messages that will show that the server has done something to the System.out is "**Error, this build is outdated...".
     
  8. Offline

    timtower Administrator Administrator Moderator

    Because they work outside the logger.
    Maybe before the logger gets setup
     
Thread Status:
Not open for further replies.

Share This Page