with
fun Location.with(world: World = this.world, x: Double = this.x, y: Double = this.y, z: Double = this.z, yaw: Float = this.yaw, pitch: Float = this.pitch): Location
Creates a new Location with selectively modified properties.
This function allows creating a copy of a Location with specific properties changed while keeping others unchanged. All parameters default to the current Location's values.
Example:
val original = Location(world, 10.0, 64.0, -20.0, 90f, 0f)
val modified = original.with(y = 100.0, pitch = 45f) // Only y and pitch changedContent copied to clipboard
Return
A new Location with the specified properties
Parameters
world
The world for the new Location (default: current world)
x
The x-coordinate for the new Location (default: current x)
y
The y-coordinate for the new Location (default: current y)
z
The z-coordinate for the new Location (default: current z)
yaw
The yaw rotation for the new Location (default: current yaw)
pitch
The pitch rotation for the new Location (default: current pitch)