Overview
PlatformEntity represents an entity in the underlying platform (Bukkit, Folia, etc.). It provides a platform-agnostic interface for accessing basic entity properties like UUID and location, as well as integration with BetterModel’s entity tracking system.
Package: kr.toxicity.model.api.platform
Extends: PlatformRegionHolder
Since: 2.0.0
Core Methods
uuid()
location()
Tracking Integration
registry()
tracker()
name- The name of the tracker
Task Scheduling
Inherited fromPlatformRegionHolder:
task()
runnable- The task to run
null if scheduling failed
Since: 2.0.0
On Folia servers, tasks are automatically scheduled on the entity’s region thread.
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 entities to PlatformEntity:
Hierarchy
PlatformEntity is extended by:
PlatformLivingEntity- Adds living entity properties (eye location)PlatformPlayer- Adds player-specific properties (name, online status)
Usage Example
Related Types
- BaseEntity - Enhanced entity adapter with model data
- PlatformLocation - Location representation
- PlatformPlayer - Player-specific interface
EntityTrackerRegistry- Entity tracker managementPlatformRegionHolder- Region-aware task scheduling
