Error occurred while enabling [Plugin] v1.0 (is it up to date)

Discussion in 'Plugin Development' started by ssnipxr, Jun 22, 2021.

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

    ssnipxr

    so i've been trying to code my own plugins and i just figured out why they never showed up in my /plugins (it was from a yml error) but in logs it said "Error occurred while enabling deathswap v1.0 (Is it up to date?)
    java.lang.NullPointerException: Cannot invoke" Can you guys help? I've always wanted to play deathswap and i spent a good amount of time coding it,, I've tried searching on google but no one answered the question in general.

    Full Error Log:

    Code:
    [12:06:44] [Worker-Main-4/INFO]: Preparing spawn area: 0%
    [12:06:45] [Worker-Main-4/INFO]: Preparing spawn area: 0%
    [12:06:45] [Worker-Main-5/INFO]: Preparing spawn area: 0%
    [12:06:46] [Worker-Main-4/INFO]: Preparing spawn area: 1%
    [12:06:46] [Worker-Main-4/INFO]: Preparing spawn area: 40%
    [12:06:47] [Worker-Main-4/INFO]: Preparing spawn area: 74%
    [12:06:47] [Worker-Main-6/INFO]: Preparing spawn area: 91%
    [12:06:47] [Server thread/INFO]: Time elapsed: 3169 ms
    [12:06:47] [Server thread/INFO]: [deathswap] Enabling deathswap v1.0
    [12:06:47] [Server thread/ERROR]: Error occurred while enabling deathswap 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.Rayne.DeathSwap.Main.getCommand(String)" is null
        at me.Rayne.DeathSwap.commands.SwapCommand.<init>(SwapCommand.java:21) ~[?:?]
        at me.Rayne.DeathSwap.Main.onEnable(Main.java:12) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:495) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:409) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:608) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:264) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:987) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot-1.17.jar:3159-Spigot-f773da8-887bc05]
        at java.lang.Thread.run(Thread.java:831) [?:?]
     
  2. Online

    timtower Administrator Administrator Moderator

    @ssnipxr Did you read the error?
    because the return value of "me.Rayne.DeathSwap.Main.getCommand(String)" is null
     
  3. Offline

    ssnipxr

    yeah but how do i fix it?? I followed a tutorial and the guy in the video had no problem
     
  4. Online

    timtower Administrator Administrator Moderator

    You didn't specify the command in your plugin.yml
     
  5. Offline

    ssnipxr

    heres my plugin.yml (copy paste) if you could tell me what to fix that'd be great-
    Code:
    name: BlockShuffle
    version: 1.0
    api-version: 1.17
    author: Rayne
    main: me.Rayne.BlockShuffle.Main
    description: Block Shuffle
    
    commands:
    'startBS':
       description: starts the block shuffle game for all
    'stopBS':
       description: ends the block shuffle game for all
     
    Last edited by a moderator: Jun 26, 2021
  6. Online

    timtower Administrator Administrator Moderator

    @ssnipxr Show a screenshot of the file, because right now the indentation seems wrong.
     
  7. Offline

    ssnipxr


    here
     

    Attached Files:

  8. Online

    timtower Administrator Administrator Moderator

    @ssnipxr The actual commands need to indent as well.
     
  9. Offline

    ssnipxr

    Can you post the correct plugin.yml here or the indentation format so i can copy paste it?
     
  10. Online

    timtower Administrator Administrator Moderator

    No, just edit it yourself
     
  11. Offline

    ssnipxr

    well wdym by the commands need to indent?
     
  12. Online

    timtower Administrator Administrator Moderator

    2 spaces in front of them, add 2 more for the descriptions as well.
     
  13. Offline

    ssnipxr

    okay, thanks for helping! I hope it finally works!
     
Thread Status:
Not open for further replies.

Share This Page