Solved Config yml

Discussion in 'Spigot Plugin Development' started by Lifeonblack, May 19, 2017.

  1. first my config.yml
    Code (Java):

    ##################
    ########
    #####

    # Here you can edit all messages
    Messages:

       # They must be logged in to do something like Moving, Messaging, etc
       Must Login: '&8You must be logged in to do that'

       # They must be registered to join to the server
       Must Register: '&8Hi &c%player% &8to register use /authpin'

       # Invalid permission message
       Permission: '&4You have no permission to do that'

       # Console tried to use the command
       Console: '&4You must be a player to do that'

       # Already registered message
       Login Now: '&4You are already registered'

       # Spawn error message
       Spawn Error: '&4To set spawn use &6/auth setspawn'

       # Reload message
       Reload: '&aConfigs successfully reloaded'

       # Unknown command message
       Unknown: '&4Unknown command use &6/auth &4for list of commands'

       # Successfully spawn message
       Spawn: '&aTeleported successfully'

       # Delete Spawn
       Delete Spawn: '&aSpawn deleted successfully'

       # Set Spawn
       Set Spawn: '&aSpawn set successfully'

       # Register success message
       Register: '&aSuccessfully registered'

       # Login success message
       Login: '&aSuccessfully logged in'

       # Change password success message
       Changepass: '&aPassword changed successfully'

       # Tell their password after registration
       Registry: '&aYour password is &c%pass%'

       # Pass error message
       PassError: '&4Incorrect pincode'

       # Already logged message
       AlreadyLogged: '&4You are already logged in'

       # Logout success message
       Logout Success: '&aSuccessfully logged out'

       # Upon changepass tell them the new password
       ChangeRegistry: '&aYour new password is &c%pass%'

    ##################
    ########
    #####

    # Here you can change all names in the gui
    Names:

      # The register gui name
      Register: '&6&lRegister'
      # The main authpin gui name
      Main: '&6&lAuthPin'
      # The login gui name
      Login: '&6&lLogin'
      # The change pass gui name
      Changepass: '&6&lChangepass'
      # Changepass looking for old pincode
      Changepass_old: '&6&lOld Pin'
      # Changepass looking for new pincode
      Changepass_new: '&6&lNew Pin'
      # Confirmation pin
      Confirm: '&6&lRetype Pin'
      # Current pin name
      MainPin: '&6&lCurrent Pin'
      # Logout name
      Logout: '&4&lLogout'
      # Confirm register
      # Confirm and ConfirmReg should be different
      ConfirmReg: '&6&lConfirm Register'
    ##################
    ########
    #####

    # Set the gamemode when joins
    Gamemode: 'Adventure'

    # They must login after they registered
    Login After Register: false

    # Remove authpin item after login
    Remove AuthPin Item: false
    # Sounds to play
    # Go to https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Sound.html for all sounds
    Sounds:
        # When error came such as no permission and the password you input is incorrect
        Error: 'ENTITY_CHICKEN_EGG'
           # The volume of the sound
           volume: 10
           # The pitch of the sound
           pitch: 10
        # When the login change register and some comand at this plugin process correctly and having a permission to do so
        Success: 'BLOCK_ANVIL_FALL'
           # The volume of the sound
           volume: 10
           # The pitch of the sound
           pitch: 10
    ##################
    ########
    #####

    # Setup the authpin item on join
    AuthPin:
       Item:
         type: 'blaze_rod'
         name: '&6&lAuthpin'
         enchantments: true
         slot: 1
         lore:
           - click this for authpin

    ##################
    ########
    #####
    so when and how did I messed up because the error persists :
    Code (Java):

    ERROR:

    while parsing a block mapping
      in "<unicode string>", line 119, column 5:
            Error: 'ENTITY_CHICKEN_EGG'
            ^
    expected <block end>, but found '<block mapping start>'
      in "<unicode string>", line 121, column 8:
               volume: 10
               ^
    where the error persists in config.yml ? I'm pretty sure they are in:
    Code (Java):
    Sounds:
        # When error came such as no permission and the password you input is incorrect
        Error: 'ENTITY_CHICKEN_EGG'
           # The volume of the sound
           volume: 10
           # The pitch of the sound
           pitch: 10
        # When the login change register and some comand at this plugin process correctly and having a permission to do so
        Success: 'BLOCK_ANVIL_FALL'
           # The volume of the sound
           volume: 10
           # The pitch of the sound
           pitch: 10
     
    #1 Lifeonblack, May 19, 2017
    Last edited: May 19, 2017
  2. Code (Text):
    Sounds:
        # When error came such as no permission and the password you input is incorrect
        Error: 'ENTITY_CHICKEN_EGG'
           # The volume of the sound
           volume: 10
           # The pitch of the sound
           pitch: 10
        # When the login change register and some comand at this plugin process correctly and having a permission to do so
        Success: 'BLOCK_ANVIL_FALL'
           # The volume of the sound
           volume: 10  # <-- WHY THIS SPACE HERE?
           # The pitch of the sound
           pitch: 10
    Why there is a space between Success path and volume path (The same in the block above)? If you don't know how to read parser error, use a browser yaml validator
     
  3. I am using to get string with this way "Error.volume" or "success.volume" or anything let me try that
     
  4. Then you have not to define a value for both Error or success
     
  5. Ooops didn't realized that let me try fixing that one.
     
  6. changed to
    Code (Java):

    Sounds:
       # When error came such as no permission and the password you input is incorrect
       Error:
         # Type of sound
         Sound: 'ENTITY_CHICKEN_EGG'
         # The volume of the sound
         volume: 10
         # The pitch of the sound
         pitch: 10
       # When the login change register and some comand at this plugin process correctly and having a permission to do so
       Success:
         # Type of sound
         sound: 'BLOCK_ANVIL_FALL'
         # The volume of the sound
         volume: 10
         # The pitch of the sound
         pitch: 10
    now it doesn't persist single error.
     
  7. Because now it's correct. I suggest you to check how to write yaml file (It's not that hard) on google or learn how to read the error generator. If the case is solved, mark the thread as solved, thank you!
     
  8. Appreciate :)