Pos3d

@Serializable
@SerialName(value = "pos3d")
data class Pos3d(val x: Double, val y: Double, val z: Double) : Pos3DimensionalConvertible<Double, Pos2d, Pos3d> (source)

A class representing a triple of x, y and z (being 3-dimensional double coordinates), where y is the height in Minecraft.

Constructors

Link copied to clipboard
constructor(x: Double, y: Double, z: Double)

Properties

Link copied to clipboard
open override val x: Double

Horizontal x-coordinate, equivalent of x in a Minecraft world.

Link copied to clipboard
open override val y: Double

Vertical y-coordinate, equivalent of y in a Minecraft world. This coordinate represents the height.

Link copied to clipboard
open override val z: Double

Horizontal z-coordinate, equivalent of z in a Minecraft world. In general maths this would be the y coordinate on a regular 2d plane.

Functions

Link copied to clipboard
open override fun atY(y: Double): Pos3d

Takes the x and z coordinate and adds them together with the given new y.

Link copied to clipboard
open fun toBlockPos(): BlockPos
Link copied to clipboard
open fun toMcBlockPos(): BlockPos
Link copied to clipboard
open fun toMcVec3(): Vec3
Link copied to clipboard
open fun toMcVec3i(): Vec3i
Link copied to clipboard
open fun toMcVector3d(): Vector3d
Link copied to clipboard
open fun toMcVector3f(): Vector3f
Link copied to clipboard
open fun toPair(): Pair<Double, Double>

Converts this position to a basic Kotlin Pair of x and z.

Link copied to clipboard

Converts this position to a Kotlin Triple of x, y and z.

Link copied to clipboard
open override fun withoutHeight(): Pos2d

Removes the y coordinate and returns a new instance of Pos2Dimensional.