1.14.4 Is there a Console Message Send Event?

Discussion in 'Spigot Plugin Development' started by santafejay, Mar 24, 2020.

  1. So I'm making a plugin where it detects if console or a player sent a message with a specific prefix: ';'. Would I use the ConsoleCommandEvent (I think that's the name) Or is there another event that I can use to detect when the message is sent?
     
  2. I've used server command event for a similar sounding thing, worked fine.
     
    • Agree Agree x 1
  3. You could use AsyncPlayerChatEvent, check if the message starts with ; then direct it to a method
    Then make a command /; (Because that's what the console would say) and link it to the same method.
     
  4. I have the AsyncPlayerChatEvent controlling for when the player sends a message with ; at the start then I'll have the ServerCommandEvent because I checked and you can detect the message that was sent with the event so that will probably work.
     
  5. Since console doesn't have to put a slash, all chat is just a "command" and sent to ServerCommandEvent :)
     
    • Agree Agree x 1