Get the Chat Received String

Discussion in 'Plugin Development' started by westerhack, Nov 13, 2012.

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


    Hello All. This is my first post. Anyways.
    I'm developing a plugin called AlertMe. In this plugin's final version, you will be able to declare 25 alerts. And, if any line of chat is received and contains one or more of the alerts you declared, minecraft will play a sound. I intend to use this so when your afking, you will be able to see when a message pops up for you. I'm wondering what onBLANK() to use. I have searched, but everything is being sent from a player not received.


    Also, It doesn't need to be from a player. Just if the player's chat box has the string in it
  2. Offline


    You could do this with player chats. I do not think you could do this with broadcasts, or you would have found a way to get that as well
  3. Offline


    If you're looking to filter incoming chat messages for each player, plain Bukkit can't help you (PlayerChatEvent is only for outgoing messages sent by players). You need to intercept packet 0x03 (chat message) as it's sent to the client. Comphenix's very cool ProtocolLib is probably the best way to handle this: intercept packet 0x03 as it's sent from server to client, and if the chat text contains one of your strings, take the appropriate action.
Thread Status:
Not open for further replies.

Share This Page