Config doesnt load

Discussion in 'Plugin Development' started by Casinator, Feb 17, 2020.

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

    Casinator

    Hello! Im trying to make a bossbar plugin, but each time I reload, my methods which need the config crash. This never happened before. I tried already to do sth in the onDisable() method. Here's the error:
    Code:
    [22:01:18 ERROR]: Cannot load plugins\challanges\config.yml
    org.bukkit.configuration.InvalidConfigurationException: could not determine a constructor for the tag tag:yaml.org,2002:org.bukkit.craftbukkit.v1_13_R2.boss.CraftBossBar
    in 'string', line 2, column 8:
          bar: !!org.bukkit.craftbukkit.v1_13_R ...
               ^
    
            at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:163) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:131) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:184) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:159) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:135) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at de.casinator.challanges.bossbar.StartCommand.onCommand(StartCommand.java:38) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.craftbukkit.v1_13_R2.CraftServer.dispatchCommand(CraftServer.java:704) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.PlayerConnection.handleCommand(PlayerConnection.java:1621) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:1461) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:9) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
            at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
            at net.minecraft.server.v1_13_R2.SystemUtils.a(SourceFile:199) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:896) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:831) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:729) [spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at java.lang.Thread.run(Thread.java:834) [?:?]
    Caused by: org.yaml.snakeyaml.constructor.ConstructorException: could not determine a constructor for the tag tag:yaml.org,2002:org.bukkit.craftbukkit.v1_13_R2.boss.CraftBossBar
    in 'string', line 2, column 8:
          bar: !!org.bukkit.craftbukkit.v1_13_R ...
               ^
    
            at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructUndefined.construct(SafeConstructor.java:541) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:453) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:184) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:434) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:521) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:30) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:453) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:184) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:434) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:521) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:30) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:204) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:193) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.constructDocument(BaseConstructor.java:159) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:146) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:524) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.yaml.snakeyaml.Yaml.load(Yaml.java:437) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:55) ~[spigot-1.13.2.jar:git-Spigot-1a3504a-84f3da3]
            ... 22 more
    plz help:)
     
  2. Online

    timtower Administrator Administrator Moderator

    @Casinator You can't store everything in yml.
    A bossbar seems to be one of those
     
    Casinator likes this.
  3. @Casinator As stated by timtower, you can't store the bossbar inside the yaml file; instead, you should store the information that you need and create the bossbar using that information.
     
    Casinator and Sw_aG like this.
  4. Offline

    Casinator

    Thanks:D Now everything works:D
     
    Last edited: Feb 18, 2020
Thread Status:
Not open for further replies.

Share This Page