Skip to main content

Overview

PlatformPlayer represents a player in the underlying platform. This interface combines the properties of a living entity and an offline player, providing access to player-specific data like name and online status, as well as all living entity functionality. Package: kr.toxicity.model.api.platform Extends: PlatformLivingEntity, PlatformOfflinePlayer Since: 2.0.0

Core Properties

name()

Returns the name of the player. Returns: The player name (never null for online players) Since: 2.0.0

Inherited from PlatformEntity

uuid()

Returns the unique identifier of the player. Returns: The player’s UUID Since: 2.0.0

location()

Returns the current location of the player. Returns: The player’s location Since: 2.0.0

registry()

Retrieves the tracker registry associated with this player. Returns: An optional containing the registry if it exists Since: 2.0.0

tracker()

Retrieves a specific tracker by name from this player’s registry. Parameters:
  • name - The name of the tracker
Returns: An optional containing the tracker if found Since: 2.0.0

Inherited from PlatformLivingEntity

eyeLocation()

Returns the eye location of the player (camera position). Returns: The eye location Since: 2.0.0 Example:

Task Scheduling

Inherited from PlatformRegionHolder:

task()

Schedules a task to run on the next tick, synchronized with this player’s region. Parameters:
  • runnable - The task to run
Returns: The scheduled task, or null if scheduling failed Since: 2.0.0

taskLater()

Schedules a task to run after a delay, synchronized with this player’s region. Parameters:
  • delay - The delay in ticks
  • runnable - The task to run
Returns: The scheduled task, or null if scheduling failed Since: 2.0.0

Platform Adapter Usage

Use BukkitAdapter to convert Bukkit players to PlatformPlayer:

Usage Examples

Basic Player Access

Custom Model Management

Player Tracking

Region-Safe Operations

PlayerChannel Integration

Interface Hierarchy

  • PlatformEntity - Base entity interface
  • PlatformLocation - Location representation
  • BaseEntity - Enhanced entity adapter
  • PlatformLivingEntity - Living entity interface
  • PlatformOfflinePlayer - Offline player data
  • EntityTrackerRegistry - Entity tracker management
  • PlayerChannel - Enhanced player wrapper with model data