diff --git a/.docs/api/properties.md b/.docs/api/properties.md index dfa82e9..62a5614 100644 --- a/.docs/api/properties.md +++ b/.docs/api/properties.md @@ -15,6 +15,20 @@ properties.setValue(SlimeProperties.SPAWN_Z, 170); /* Add as many as you like */ ``` +Properties can be modified after-the-fact aswell assuming it's loaded in the `worlds.yml` file. +```java +SlimePlugin plugin = (SlimePlugin) Bukkit.getPluginManager().getPlugin("SwoftyWorldManager"); +World world = // your world here +WorldsConfig config = plugin.getConfigManager().getWorldConfig(); +WorldData worldData = config.getWorlds().get(world.getName()); + +// Other properties can also be changed, this example is just using the spawn property as an example +worldData.setSpawn(sender.getPlayer().getLocation().getBlockX() + ", " + sender.getPlayer().getLocation().getBlockY() + ", " + sender.getPlayer().getLocation().getBlockZ()); + +// Save config after the fact +config.save(); +``` + [1]: ../../swoftyworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimeProperty.java [2]: ../../swoftyworldmanager-api/src/main/java/com/grinderwolf/swm/api/world/properties/SlimeProperties.java