Skip to content

Position

Omar Mohamed edited this page Mar 24, 2026 · 2 revisions

Position

Represents a block position in the world using integer X, Y, Z coordinates.


Constructor

Position(x, y, z)

Creates a new Position with the given coordinates.

  • Parameters:
    • x, y, zInteger
make pos new Position(100, 64, -200)
say pos.toString()
~ Output: "Position{x=100, y=64, z=-200}"

Functions

getX()

Returns the X coordinate.

  • Returns: Integer

getY()

Returns the Y coordinate.

  • Returns: Integer

getZ()

Returns the Z coordinate.

  • Returns: Integer

setX(x)

Sets the X coordinate.

  • Parameters:
    • xInteger

setY(y)

Sets the Y coordinate.

  • Parameters:
    • yInteger

setZ(z)

Sets the Z coordinate.

  • Parameters:
    • zInteger
make pos player.getPosition()
say pos.getX()
say pos.getY()
say pos.getZ()

pos.setY(100)
say pos.toString()

getDistanceTo(other)

Returns the distance to another Position.

  • Parameters:
  • Returns: Long

getDistanceTo(x, y, z)

Returns the distance to a position given as raw coordinates.

  • Parameters:
    • x, y, zInteger
  • Returns: Long
make playerPos player.getPosition()
make spawnPos new Position(0, 64, 0)
make dist playerPos.getDistanceTo(spawnPos)
say "Distance from spawn: " + dist

~ Or using raw coordinates
make dist2 playerPos.getDistanceTo(0, 64, 0)

toString()

Returns a string representation of this position.

  • Returns: String — e.g. "Position{x=10, y=64, z=-30}"

📖 InteractiveStuff Docs


🧱 Types


⚙️ Scripting

📃 Built-in Library

Clone this wiki locally