Really confused....

Good morning/afternoon/evening! Hope yall are doing well... So I have a major issue with trying to connect my minecraft plugin onEnable right? It seems like I have absolutely everything setup right (this isnt my first rodeo making plugins). However, im steadily getting a NPE stating that my instance variable is null even though there isn't anything null about it. In the plugin.yml as well the main class is initialized perfectly too in the screenshots provided everything seems fine. I checked every class I have and nothing is extending JavaPlugin other than the main class itself. Package names are fine...everything seems fine...Does anyone may have an idea of what this could be?
No description
No description
No description
No description
9 Replies
JavaBot
JavaBot9mo ago
This post has been reserved for your question.
Hey @Jordan σ_σ! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
Koblížkáč
Koblížkáč9mo ago
initialize the DatabazeFactory inside onEnable and Connection in DatabaseFactory ctor
Defective
Defective9mo ago
You are calling DatabaseFactory's constructor before your plugin has been enabled (and onEnable() called), so Library.instance is still null at the time Instantiate your DatabaseFactory in the onEnable()method Also there is no point in reassigning your instance to null When writing Minecraft plugins you will almost always want to initialize everything in onEnable
JavaBot
JavaBot9mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Jordan σ_σ
Jordan σ_σOP9mo ago
you make a solid point here! I definitely appreciate this so much thank you
JavaBot
JavaBot9mo ago
If you are finished with your post, please close it. If you are not, please ignore this message. Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
Jordan σ_σ
Jordan σ_σOP9mo ago
thank you for the help here! Much appreciated
JavaBot
JavaBot9mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
JavaBot
JavaBot9mo ago
Post Closed
This post has been closed by <@649487890858115072>.

Did you find this page helpful?