Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // The ArrayList
- List<String> mods = new ArrayList<>();
- // Saving it to the config
- getConfig().set("mods", mods);
- // "mods" is the path you are saving it to and mods is the ArrayList
- // Saving the config, always do this when changing something in the config
- saveConfig();
- // Retrieving it from the config
- mods = new ArrayList<>();
- // Empty mods, or create the variable again
- for (Object object : getConfig.getList("mods")) {
- mods.add(object.toString());
- }
- // Now all the players in the list from the config are in the ArrayList, mods.
- // Now that is how you use it!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement