-
Notifications
You must be signed in to change notification settings - Fork 0
Position
Omar Mohamed edited this page Mar 11, 2026
·
2 revisions
Represents a block position in the world using integer X, Y, Z coordinates.
Creates a new Position with the given coordinates.
-
Parameters:
-
x,y,z—Integer
-
make pos new Position(100, 64, -200)
say pos.toString()
~ Output: "Position{x=100, y=64, z=-200}"
Returns the X coordinate.
-
Returns:
Integer
Returns the Y coordinate.
-
Returns:
Integer
Returns the Z coordinate.
-
Returns:
Integer
Sets the X coordinate.
-
Parameters:
-
x—Integer
-
Sets the Y coordinate.
-
Parameters:
-
y—Integer
-
Sets the Z coordinate.
-
Parameters:
-
z—Integer
-
make pos player.getPosition()
say pos.getX()
say pos.getY()
say pos.getZ()
pos.setY(100)
say pos.toString()
Returns the distance to another Position.
-
Parameters:
-
other—Position
-
-
Returns:
Long
Returns the distance to a position given as raw coordinates.
-
Parameters:
-
x,y,z—Integer
-
-
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)
Returns a string representation of this position.
-
Returns:
String— e.g."Position{x=10, y=64, z=-30}"
GET IN TOUCH - omar@merakistudios.dev
© 2026 Omar Mohamed. All Rights Reserved.