How can I add this exact layout to the config?

Discussion in 'Plugin Development' started by SleepyDog, Apr 15, 2015.

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

    SleepyDog

    I need to add the exact layout to the config on the command /helpmenu add <name>. They will then edit the menu in the config.

    example:
    1: "&8&m====================================================="
    2: "&a&l Help > Example"
    3: "&3/spawn &7- Go to the server spawn."
    4: "&3/spawn &7- Go to the server spawn."
    5: "&3/spawn &7- Go to the server spawn."
    6: "&3/spawn &7- Go to the server spawn."
    7: "&3/spawn &7- Go to the server spawn."
    8: "&3/spawn &7- Go to the server spawn."
    9: "&3/spawn &7- Go to the server spawn."
    10: "&3/spawn &7- Go to the server spawn."
    11: "&8&m====================================================="

    I also need to check if the page already exists before I add it.

    How could I go about this?
     
  2. Something like this:
    Code:java
    1. for (int i = 1; i < 1000; i++) {
    2. if (!getConfig().contains(i + "") {
    3. getConfig().set(i + "", "text");
    4. saveConfig();
    5. break;
    6. }
    7. }
     
Thread Status:
Not open for further replies.

Share This Page