InvalidPluginException | java.lang.ExceptionInInitializerError | java.lang.NullPointerException

Discussion in 'Server & Community Management' started by byCaptain, May 31, 2017.

  1. Hello guys,

    i'm little brainfucked.

    i've got a problem with one simple class:

    https://hastebin.com/edajepinij.swift

    i've have also try to change the main but it doesn't work.

    my console exception:

    http://prntscr.com/fe6kbb

    also tried with craftbukkit/spigot/other versions -> don't work.

    i just censored some private stuff

    can sb help me ;-;
     
  2. electronicboy

    IRC Staff

    private static String tempp = getConfigConfig().getString("prefix");

    fields are initialized before the constructor is even touched, initialize your values inside onEnable after you've set your config file up properly.
    Beyond that, clean up your code, there is also no need to create your own config file for config.yml, just use getConfig() in order to get the YamlConfiguration that bukkit creates for you with the JavaPlugin class