I have a player x,y,z stored in a double and put into a location, how can I serialise this location and save the xyz to config, thanks Sent from my iPhone using Tapatalk
Tried that, displays in config as “notnullx” Using a ConfigurationSection also which I don’t see a problem with Sent from my iPhone using Tapatalk
Location implements ConfigurationSerializable, so you're better off just writing the Location object itself to config instead of the X/Y/Z. You get more usable data that way.
It's automatic. If you do something like getConfig().set("player.location", playerObject.getLocation()); it will write a Location object to the config. Then later you can do Location playerLocation = getConfig().getLocation("player.location"); No manual serialization required.
Interesting, I’ll give this a go. Will it look similar to how I have it now or will it print every detail(yaw/pitcj/world/), Sent from my iPhone using Tapatalk
It's just a Location object, you do with it whatever you want. If you are using the stored location to teleport a player for example, you just playerObject.teleport(locationObject); It depends what you are trying to achieve. For something like teleportation, using a Location instead of X/Y/Z is far better as it stores those extra details so they can appear exactly where they were.