NullPointer :(

Discussion in 'Plugin Development' started by JackWilder00, Jan 13, 2018.

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

    JackWilder00

    Can you help me with this please!

    Code:
    public class Main extends JavaPlugin{
        public static File f;
        public static FileConfiguration cfg;
       
        public void onEnable() {
            saveDefaultConfig();
            Main.f = new File("plugins/Bewerbung", "config.yml");
            Main.cfg = YamlConfiguration.loadConfiguration(f);
            Bukkit.getConsoleSender().sendMessage("§c Dies ist ein Bewerbungsplugin füur Durchrasten.de");
            Bukkit.getConsoleSender().sendMessage("§c Coded by Jack.");
            Bukkit.getConsoleSender().sendMessage("§c Das Plugin wurde aktiviert.");
           
            //CMD
            this.getCommand("invsee").setExecutor(new CMDInvsee());
            this.getCommand("setspawn").setExecutor(new CMDSetSpawn());
            this.getCommand("spawn").setExecutor(new CMDSpawn());
            this.getCommand("godmode").setExecutor(new CMDGod());
            this.getCommand("navi").setExecutor(new CMDComp());
           
           
            //Listener
            PluginManager pm = Bukkit.getServer().getPluginManager();
            pm.registerEvents(new Join(), this);
            pm.registerEvents(new Quit(), this);
            pm.registerEvents(new Interact(), this);
            pm.registerEvents(new InventoryInteract(), this);
            pm.registerEvents(new Godmode(), this);
        }
        public void onDisable() {
            Bukkit.getConsoleSender().sendMessage("§cDas Plugin wurde deaktiviert.");
        }
    
    }
     

    Attached Files:

  2. Offline

    Max8801

    What's at line number 40?
     
  3. Offline

    JackWilder00

    Can you be so kind and quote that line for me?
     
  4. Offline

    timtower Administrator Administrator Moderator

    @JackWilder00 That is the issue, we want to know which line it is, and we don't have the includes so we don't have a good line count.
    Check it in your IDE
     
Thread Status:
Not open for further replies.

Share This Page