Pos3f

@Serializable
@SerialName(value = "pos3f")
data class Pos3f(val x: Float, val y: Float, val z: Float) : Pos3DimensionalConvertible<Float, Pos2f, Pos3f> (source)

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

Constructors

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

Properties

Link copied to clipboard
open override val x: Float

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

Link copied to clipboard
open override val y: Float

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

Link copied to clipboard
open override val z: Float

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: Float): Pos3f

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<Float, Float>

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(): Pos2f

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