Filled ConsoleMessageRun

Discussion in 'Plugin Requests' started by Dr_Lobster_face, Nov 2, 2018.

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

    Dr_Lobster_face

    Plugin category: Custom Triggers and Scripts
    Minecraft version: Minecraft 1.11.2

    Suggested name: ConsoleMessage
    What I want: I'd like a plugin that can run a user defined command when the console receives a certain message.

    For example: When the console gets the message "[Vault] No new version available" the plugin runs the command (defined in config.yml) "/say blah blah blah"

    Idea for how config would look:
    Code:
    (user defined name)
    message: '[Vault] No new version available'
    command(s): '/say blah blah blah'
    
    (user defined name)
    message: '[Plugin] oops!'
    command(s):
      - '/say command #1'
      - '/say command #2'
    
    Ideas for commands:
    /cm reload - Reloads the config

    Ideas for permissions: No permissions are needed for this plugin

    When I'd like it by: ASAP!
     
    Last edited: Nov 2, 2018
  2. Offline

    timtower Administrator Administrator Moderator

    @Dr_Lobster_face You are looking for [code]<config here>[/code] for the config thing.
    Please replace the image by a text version.
     
  3. Offline

    Dr_Lobster_face

    done
     
  4. Offline

    Dr_Lobster_face

    anyone able to make this?
     
  5. Yes, I think it could be done by checking the last line of logs's file every tick
     
  6. Offline

    timtower Administrator Administrator Moderator

    Easier to hook into the logger directly.
     
  7. I don't know what do you mean by that. I was thinking about an handler, but an handler doesn't seems to be able to read files
     
  8. Offline

    timtower Administrator Administrator Moderator

    You don't need to read files.
    The logger that Bukkit uses has its own system for events.
    You can hook into that system, then your method gets called for every log line that gets printed.
     
  9. I finally managed to use the logger instead of reading the file. That was hard, but it'll be a lot more relliable.
    Here's the plugin https://www.spigotmc.org/resources/console-log-commands.62126/
     
    Resoluciones likes this.
  10. Offline

    Dr_Lobster_face

Thread Status:
Not open for further replies.

Share This Page