Help on reading from config

Discussion in 'Plugin Development' started by LukeyFlukey, Jun 16, 2012.

  1. Offline

    LukeyFlukey

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hey all,

    I would like to write to my config, something like this:

    Example:
    MobSpawner: MOB_SPAWNER
    Price: 12.0
    Plank: PLANK
    Price: 6.0

    OR:

    Example:
    MOB_SPAWNER
    Price: 12.0

    I have tried a few different ways of coding it but all have failed.
    I would also like this so that when a user types "/example" they get a list of the items for example:
    /example output: MobSpawner, Plank etc... OR Output: MOB_SPAWNER, PLANK etc...

    Any help would be greatly appreciated,

    Thanks!
  2. Offline

    chaseoes BukkitDev Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  3. Offline

    ferrybig

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    you can better do it like this:
    Code:YAML
    1. MOB_SPAWNER:
    2. Price: 12.0
  4. Offline

    LukeyFlukey

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks for the replies!

    So instead of having

    Example:
    MOB_SPAWNER
    Price: 12.0

    I should have

    MOB_SPAWNER
    Price: 12.0

    Also how would I list these item names on command for example /items

    Thanks again

Share This Page