Hello i am trying to create a file so i can store players data and other stuff fx: Players.yml please help
Code:java File Playersfile = new File(plugin.getDataFolder().getPath(),"Players.yml");FileConfiguration players = YamlConfiguration.loadConfiguration(Playersfile);players.set("suffix", "[Example]");players.save(Playersfile);
Can I also get some help on this tread? How can i get/set the config from another class. I cant get FileConfiguration rom the other class. I need to make it public
Make an instance of your other class and the do <Your other class instance>.<Your FileConfigurationName>.get(path)
In your main class do Code:java public final MyConfigClass mcc = new MyConfigClass(this); @Overridepublic void onEnable() {getServer().getPluginManager().registerEvents(mcc, this);} and on your other class you have to make your fileconfiguration public fx: Code:java public final FileConfiguration fc = YamlConfiguration.loadConfiguration(new File((File) plugin.getDatabase(), "Data.yml")); and then now you can do Code:java FileConfiguration fc = mcc.fc.set("player", "arcticmike");