New to plugins, on chat message.

Discussion in 'Plugin Development' started by ThLoser, Aug 6, 2020.

  1. Offline

    ThLoser

    Hello people!

    I've just started to flip around with coding plugins to minecraft, and i'm just trying to understand one thing, how to check if the user is sending a specific word and then send a message back to all of the users like a broadcast message.

    And right now in this stage i have just followed tutorials and it still aint working.


    This is my code so far: https://pastebin.com/ttCQSuZx - The problem i got now is:

    - The Method registerEvents .....


    And the command doesn't work, but maybe it has something with the registerevents problem to do?


    The thing im trying to fix is when someone write !fish in chat server answers with this is fish.


    I'm really new with this, so if u got any good guides and stuff that i should check post it aswell! Im reading tutorials as we speech
     
    Last edited: Aug 6, 2020
  2. Offline

    bowlerguy66

    You have to implement listener. After you say that your plugin extends JavaPlugin add "implements Listener" and that will clear up your registerEvents problem. Also, for your chat message it will only detect the !fish tag if they do it in the exact case you posted. Add .toLowerCase() before your .contains() and that will fix the problem.
     
  3. Offline

    KarimAKL

Share This Page