How to cancel Chat / get Search

Discussion in 'Spigot Plugin Development' started by ShishKaBobz, Apr 23, 2017.

  1. Hello! I have 2 questions today so if anyone can help me that would be great! I would like to know how to do a event (ASyncChat) to cancel a players chat from broadcasting (Ex: If i did ?Help) it would Display my code and Nothing from the player would show!
    Ik this would be java wise, But how can i do a google seach? like if i did ?5 + 7 it would search google and display the answer? Thanks!
     
  2. If e.getMessage() is equals to your desired message then cancel the event and execute some code, for the google part: That's hard, what you could do is generate a link (similar to how lmgtfy does) and send it to the player (No idea how to generate them), but they will have to click the accept button thingy like for all links in mc, there's probably some ways to give answers directly in the chat. but that's much more complicated
     
  3. Thanks So much!