Point Interface
ThePoint interface is the base for all coordinate types in Minestom. It represents a 3D point in space.
Basic Coordinates
Gets the X coordinate
Gets the Y coordinate
Gets the Z coordinate
Block Coordinates
Gets the floored value of the X coordinate (block position)
Gets the floored value of the Y coordinate (block position)
Gets the floored value of the Z coordinate (block position)
Chunk and Section Coordinates
Gets the chunk X coordinate (16-block sections)
Gets the chunk Z coordinate (16-block sections)
Gets the section X coordinate
Gets the section Y coordinate
Gets the section Z coordinate
Arithmetic Operations
Adds the specified coordinates to this point
Adds another point to this point
Subtracts the specified coordinates from this point
Multiplies this point by the specified coordinates
Divides this point by the specified coordinates
Distance Calculations
Calculates the Euclidean distance between this point and another
Calculates the squared distance (more efficient, avoids sqrt)
Comparison Methods
Checks if two points have identical coordinates
Checks if two points are in the same block
Checks if two points are in the same chunk
Pos (Position with View)
ThePos record represents a position with yaw and pitch rotation, typically used for entities.
Creating Positions
View Methods
Gets the yaw rotation (-180 to 180 degrees)
Gets the pitch rotation (-90 to 90 degrees)
Creates a new position with the specified view angles
Sets yaw and pitch to point toward a target
Creates a position looking at a specific point
Gets a unit vector pointing in the direction of yaw and pitch
Gets the closest cardinal direction this position is facing
Coordinate Methods
Creates a new position with different coordinates but same view
Creates a new position with one coordinate changed
Vec (Vector)
TheVec record represents an immutable 3D vector, ideal for directions, velocities, and vector math.
Predefined Vectors
Vector with all components at 0
Vector with all components at 1
Vector with all components at 16 (section size)
Creating Vectors
Vector Operations
Converts to a unit vector (length of 1)
Gets the magnitude (length) of the vector
Gets the squared magnitude (more efficient)
Calculates the dot product with another vector
Calculates the cross product (perpendicular vector)
Gets the angle between two vectors in radians
Utility Operations
Negates all components
Gets absolute value of all components
Creates vector with minimum of each component
Creates vector with maximum of each component
Rotation Methods
Rotates vector around X-axis (angle in radians)
Rotates vector around Y-axis (angle in radians)
Rotates vector around Z-axis (angle in radians)
Rotates vector based on view angles
Linear interpolation between two vectors
BlockFace and Directions
TheBlockFace enum represents the six faces of a block.
BlockFace Values
BOTTOM- Down face (Direction.DOWN)TOP- Up face (Direction.UP)NORTH- North faceSOUTH- South faceWEST- West faceEAST- East face
Methods
Converts BlockFace to Direction
Gets the opposite face
Gets horizontal BlockFace from yaw angle
Gets adjacent point in the specified direction
CoordConversion Utilities
TheCoordConversion class provides utilities for converting between coordinate systems.
Constants
The size of a section (chunk width/depth)
The size of a region in blocks
Conversion Methods
Converts global coordinate to block coordinate (floor)
Converts global coordinate to chunk coordinate
Converts global coordinate to section coordinate
Gets position within a section (0-15)
Index Methods
Encodes chunk coordinates into a single long
Encodes section-relative coordinates (0-15) into an index
Hashing Methods
Generates a hash for block coordinates
Generates a hash for global (double) coordinates
Practical Examples
All coordinate classes are immutable. Methods like
add(), mul(), and withX() return new instances rather than modifying the original.For performance-critical distance checks, use
distanceSquared() instead of distance() to avoid the expensive square root calculation.