Overview
PlatformLocation represents a location in the underlying platform. It provides access to coordinates (x, y, z), rotation (pitch, yaw), and the world, as well as methods for manipulating locations and calculating distances.
Package: kr.toxicity.model.api.platform
Extends: PlatformRegionHolder
Since: 2.0.0
Core Properties
world()
x()
y()
z()
Rotation
pitch()
yaw()
Location Manipulation
add()
x- The X offsety- The Y offsetz- The Z offset
Distance Calculations
distance()
other- The other location
distanceSquared()
Use this method instead of
distance() when comparing distances, as it avoids the expensive square root calculation.other- The other location
Task Scheduling
Inherited fromPlatformRegionHolder:
task()
runnable- The task to run
null if scheduling failed
Since: 2.0.0
taskLater()
delay- The delay in ticksrunnable- The task to run
null if scheduling failed
Since: 2.0.0
Platform Adapter Usage
UseBukkitAdapter to convert Bukkit locations to PlatformLocation:
Usage Examples
Basic Usage
Distance Checking
Location Offsetting
Region-Safe Task Scheduling
Related Types
- PlatformEntity - Entity with location
PlatformWorld- World representationPlatformRegionHolder- Region-aware task schedulingModelTask- Scheduled task handle
