I'm wondering how I would go about getting something about a player from somewhere. For example Let's say a Levels plugin, and the player is level 13 in a skill, and they could bring up a Gui which tells them their levels, on the lore of it would get the level, where would I save the players level to?
that is up to you Do you want bulk saving and loading with unreadable by human eyes data? use Java serialization. Do you want per player files readable by humans? do you want to save to a large file (unrecomended)
I'd like it so they could be readable by human eyes, and that each player has their own file @mine-care
Save it to a hasmap(UUID, Int) the uuid as the player , int as they're level. now your going to have to put a different hashmap for each player interact event. for example if a player hold a fishing rod and fishes, listen for the interact event of fishing rod and use the hashmap "fishing(uuid, Int) " and add to the players int whenever they catch a fish or someting.
@Phishy you can then save it to a config.yml as .getConfig().set("player.getname", level); where you may see the players name or you can use the players uuid, and for level you put the players level integer. OR you just save and load the hashmap. personally id rather the config with ("playername", level) as you can further this and set peoples levels in game and sutff, it makes impleemnting things into your plugin more open
You have to save the map when the player quit and load it when the player join, and ondisable save all players inside the map.
getConfig().set(A String that will be the path, Your data (you can store the int/String here, or the hasmap))
@Phishy @Phishy i already told you you can then save it to a config.yml as .getConfig().set("player.getname", level); where you may see the players name or you can use the players uuid, and for level you put the players level integer. OR you just save and load the hashmap. personally id rather the config with ("playername", level) as you can further this and set peoples levels in game and sutff, it makes impleemnting things into your plugin more open