Best file type.

Discussion in 'Spigot Plugin Development' started by Mystic_Mark_, Oct 10, 2019 at 11:58 AM.

  1. I want to create a plugin where i can read a file that is in this format:

    Time to execute in milliseconds and than a list of commands to execute. But what will be the best file type for this.

    Something like this:

    1000|command1|command2
    2000|command3
    4000|command4

    Or if you have another format for saving this let me know.
     
  2. Why not simply use the Configuration API? The default implementation is YAML, but you're welcome to write your own if you dislike that for you.
     
  3. It's probably best to just use the proven YamlConfiguration from spigot, just create the config to resemble something like this:
    Code (YAML):
    Commands Times:
      1000
    :
       - command1
        - command2
      2000
    :
       - command3
      4000
    :
       - command4
     
    #3 Tiny_Spider, Oct 10, 2019 at 12:35 PM
    Last edited: Oct 10, 2019 at 1:43 PM
  4. Just use YAML then?
     
  5. Yes. What’s wrong with YAML? It’s easily understood by most if not everyone that’ll probably be using your plugin and it does exactly what you need it to do.