Coord

Represents a coordinate in the Minecraft world.

This also includes the tilde (~) operator, which represents the current position of caller.

This supports math using the +, -, *, and / operators.

Tilde values don't support multiplication or division.

By default, the toString method will return the coordinate in the format x y z. With all values rounded to integers (with tildes).

If you want to output floating point values, you can use the Coord.toFloatString method.

Example:

val coord = Coord(1, 2, 3)
val coord2 = Coord(4, 5, 6)
val coord3 = coord + coord2
val coord4 = coord3 - Coord(Tilde(), 5, 6)
val coord4 = coord3 - Coord(Tilde(), 5, Tilde())

Constructors

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

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
operator fun div(other: Float): Coord
Link copied to clipboard
operator fun minus(other: Coord): Coord
Link copied to clipboard
operator fun plus(other: Coord): Coord
Link copied to clipboard
fun setblock(block: String): String

Set the block at this coordinate.

Link copied to clipboard
operator fun times(other: Float): Coord
Link copied to clipboard

Convert this coordinate to the format x y z with floating point values.

Link copied to clipboard
open override fun toString(): String

Convert this coordinate to the format x y z with integer values.