[Server thread/ERROR]: null

Discussion in 'Plugin Development' started by srjames, Sep 14, 2020.

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

    srjames

    I can't solve the problem: the console shows the same thing. The point is to send information about the player to another class method when receiving a command.
    upload_2020-9-14_18-16-1.png upload_2020-9-14_18-17-24.png
    method "Loads" placed in one class, meanwhile "do some work" in main class. Here is main:
    upload_2020-9-14_18-19-6.png

    I don't know what to do anymore, I've been sitting on the error for more than two hours. thanks everyone for the help.
     
    Last edited: Sep 14, 2020
  2. Online

    timtower Administrator Administrator Moderator

    @srjames Don't make a new instance of your main class.
    Use the instance that you pass along instead.
     
  3. Offline

    srjames

    Nothing changed, same error. Code:
    upload_2020-9-14_20-15-46.png
    upload_2020-9-14_20-16-1.png
     
  4. Online

    timtower Administrator Administrator Moderator

    @srjames Why are you doing "new MagicaRaces" ?
    Remove that.
     
  5. Offline

    srjames

    removed, still that error
     
  6. Online

    timtower Administrator Administrator Moderator

    Please post your new code.
     
  7. Offline

    srjames

    Ok, i removed everything from command method upload_2020-9-14_20-23-49.png
    upload_2020-9-14_20-24-3.png
    I need only to send message using another class. Error starts when i use "plugin.dosomework(p);"
     
    Last edited: Sep 14, 2020
  8. Online

    timtower Administrator Administrator Moderator

    @srjames And where are you setting the value for "plugin"?
     
  9. Offline

    srjames

    sorry, there

    upload_2020-9-14_20-33-13.png
     
  10. Online

    timtower Administrator Administrator Moderator

    @srjames See, you are not setting the value of plugin.
    You need to do that in the constructor.
     
  11. Offline

    srjames

    Solved! Thx you a lot!
     
  12. Online

    timtower Administrator Administrator Moderator

    plugin = magicaRaces;

    Suprised that you have the constructor but are not using it that way.
     
Thread Status:
Not open for further replies.

Share This Page