getAsLocation

fun ConfigurationSection.getAsLocation(path: String, def: Location? = null): Location?

Retrieves a Location from the configuration section at the specified path.

The configuration is expected to have the following structure:

  • path.world: String representing the world name

  • path.x: Double representing the x-coordinate

  • path.y: Double representing the y-coordinate

  • path.z: Double representing the z-coordinate

Return

The Location object if the world exists and all coordinates are present, otherwise the default value

Parameters

path

The configuration path to read the location from

def

The default location to return if the world is not found or the path is invalid. Defaults to null.