getting a players last message?

Discussion in 'Plugin Development' started by jb42300, Oct 25, 2014.

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


    No how can i get a players last message that they sent, i want to use it in a no spam plugin :p any help would be great
  2. Offline



    Do you want it to get the last message or review the message before it's displayed?
  3. Offline


    ebear i wana get the last message


    jb42300: hi
    if i say hi again
    you may not reapet the same message
  4. Offline



    My best idea would be to log the messages as they are sent into a database file or something.

    You'd check to see if the first message was identical to the message sent, and if it is, set the message to null and send the player the message saying that they're spamming.

    I'm not going to write the code for you, but I'll help you this much. If there's another issue, let me know. I'll try my best to help.
  5. Offline


    Use a Map<String, String> the key would be the players name(or uuid if you so choose) and the value would be their last sent message.
    ebear likes this.
Thread Status:
Not open for further replies.

Share This Page