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?
9 Replies
⌛
This post has been reserved for your question.
Hey @Jordan σ_σ! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./close
or theClose 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.
initialize the DatabazeFactory inside onEnable
and
Connection in DatabaseFactory ctor
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
💤
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.
you make a solid point here! I definitely appreciate this so much thank you
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.
thank you for the help here! Much appreciated
💤
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.
Post Closed
This post has been closed by <@649487890858115072>.