Solved Help me! Error in String list (config)

Discussion in 'Spigot Plugin Development' started by --TOMAS--, May 15, 2016.

Thread Status:
Not open for further replies.
  1. I created a string list, but when I start the server, appear this error

    ERROR:
    Code (Text):
    [13:39:44] [Server thread/ERROR]: [UltraLobby] Cannot load configuration from jar
    org.bukkit.configuration.InvalidConfigurationException: while parsing a block mapping
    in 'string', line 13, column 1:
        News:
        ^
    expected <block end>, but found BlockEntry
    in 'string', line 27, column 1:
        - Fuck
        ^

        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:57) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.plugin.java.JavaPlugin.reloadConfig(JavaPlugin.java:214) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.plugin.java.JavaPlugin.getConfig(JavaPlugin.java:162) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at me.FiesteroCraft.UltraLobby.Main.<init>(Main.java:21) [UltraLobby.jar:?]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [?:1.8.0_77]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) [?:1.8.0_77]
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [?:1.8.0_77]
        at java.lang.reflect.Constructor.newInstance(Unknown Source) [?:1.8.0_77]
        at java.lang.Class.newInstance(Unknown Source) [?:1.8.0_77]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:329) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:291) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:505) [spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_77]
    Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping
    in 'string', line 13, column 1:
        News:
        ^
    expected <block end>, but found BlockEntry
    in 'string', line 27, column 1:
        - Fuck
        ^

        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:570) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:226) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:155) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:400) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:55) ~[spigot-1.8.jar:git-Spigot-550ebac-7019900]
        ... 16 more
     
  2. Send us your config file because you haven't spaced it/set it up properly.
     
  3. I said config, not plugin.
     
  4. Ohh, sorry xD.
    Code (Text):
    ################################################################
    #                                                              #
    #                   ULTRALOBBY BY FIESTEROCRAFT                #
    #                   SPIGOT NAME: --TOMAS--                     #
    #                   RECODED!!!                                 #
    #                                                              #
    #Placeholders: %player% - For player name!                     #
    ################################################################  

    #NEWS MESSAGE
    #You can add more lines, only copy and paste.
    #Use '&f' for spaces.
    News:
    - '&f'
    - '&aWelcome &c%player%'
    - '&f'
    - '&2The news are:'
    - '&2NEW SKYWARS &c(example)'
    - '&f'

    #ANTISWEAR
    #If this does not work properly, report this on page plugin, but remember that this beta.
    BadWords:
        Message: '&4&lTHIS IS A BAD WORD! &cModerate your language!'
        kickPlayer: false
        kickPlayerMessage: '&4&lYOU WERE KICKED FOR USING A BAD LANGUAGE'
    - Fuck
    - Lag
    - Hack
    - Hacker
    - eZ

    #MESSAGES
    Messages:
        onJoin: '&b%player% &ajoined the game!'
        onLeave: '&b%player% &cleft the game!'
        onHealth: '&aHealed!'
        playerNotOnline: '&cThis player is not online!'
        noPermission: '&cYou do not have permissions'
        onFly: '&aFlying enabled!'
        onUnFly: '&cFlying disabled!'
        notFindPlayer: '&cCould not find this player!'
        spawnSetted: '&aSpawn setted!'
        hubNotSetted: '&cThe hub has not yet been set!'
        teleportedToHub: '&aTeleported!'
    #OPTIONS
    #DISABLE OR ENABLE
    Options:
        flyMessages: true
        onJoinMessage: true
        onLeaveMessage: true
        onHealthMessage: true
        tpToHubMessage: false
     
     
  5. Problem^

    One: You have FOUR spaces from the side under BadWords, when it should be TWO spaces.
    Two: You can't put a stringlist, booleans, & strings under the same path.
     
  6. So? If i cant put string under the same path, how do I get the plugin detects when a player says some of the words that are in the StringList?
     
Thread Status:
Not open for further replies.