plugin not working

Discussion in 'Plugin Development' started by smurfexe, Jan 16, 2022.

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

    smurfexe

    hi, im new to java so i tried to make a simple plugin that sends text in chat at random times now i fixed all errors but it still doenst work can someone tell me what im doing wrong? i attached 2 screenshots
     

    Attached Files:

  2. Offline

    CageyDinosaur

    Did you code that while following a tutorial? Because I don't know if that would work even it was bug free. I would create a Runnable and then inside that make a random number generator and if statements. No need to have a sleep because you can adjust the time with Runnables.

    Disclaimer: I do not know if your code has an error, it is just different than what I am used to. I have been making plugins for four months, therefore I do not know that much. So do not take any of my critisism seriously.
     
  3. Offline

    Strahan

    Never never never use sleep in a Minecraft plugin. It will seize up the entire server. You need to use a runnable as mentioned prior.

    Also why are you creating that Conf class in your main class then also having a separate class file for it? The separate class file is the right way, remove that embedded class version. Also I do not see anywhere in your code that you actually use it.

    You should scrap all that and start over, after reading about runnables... and reading about Java in general ;)
     
  4. Online

    timtower Administrator Administrator Moderator

    @smurfexe You can't have 2 classes extending JavaPlugin
     
  5. Offline

    smurfexe

    made it a runnable and it works thanks
     
Thread Status:
Not open for further replies.

Share This Page