When i started my server i got this error

Discussion in 'Plugin Development' started by Joplayx, Jun 15, 2022.

  1. Offline

    Joplayx

    Code:
    [13:11:42 ERROR]: Error occurred while enabling Tutorial v1.0 (Is it up to date?)
    java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.joe.creepers.Main.getCommand(String)" is null
            at me.joe.creepers.Main.onEnable(Main.java:14) ~[Plz.jar:?]
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
            at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-378]
            at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-378]
            at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-378]
            at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-378]
            at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-378]
            at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-378]
            at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-378]
            at java.lang.Thread.run(Thread.java:833) ~[?:?]
     
  2. Offline

    Joplayx

    i need help
     
  3. Offline

    timtower Administrator Administrator Moderator

    @Joplayx Please show your plugin.yml and your onEnable
     
  4. Offline

    DopeBrot

    you need to give the command a name in your main class:
    error
    Code:
    getCommand("").setExecutor(new test(this));
    no error
    Code:
    getCommand("commandName").setExecutor(new test(this));
     

Share This Page