Skip to main content

Overview

The ModelProfile interface represents a model’s skin profile, containing player information and skin data. It provides methods for creating, retrieving, and managing player profiles both synchronously and asynchronously.

Interface Definition

Constants

UNKNOWN

An unknown skin profile used as a fallback when profile information is unavailable.

Core Methods

info()

Gets the profile information.
Returns: The profile information (player UUID, name, etc.)

skin()

Gets the skin data.
Returns: The skin textures and properties

player()

Gets the online player associated with this profile.
Returns: The online player, or null if offline

asUncompleted()

Converts this profile to an uncompleted profile for async operations.
Returns: An uncompleted profile wrapper

Static Factory Methods

of(ModelProfileInfo)

Creates a profile with the given information and empty skin.
Parameters:
  • info - The profile information
Returns: A new model profile Example:

of(ModelProfileInfo, ModelProfileSkin)

Creates a profile with the given information and skin.
Parameters:
  • info - The profile information
  • skin - The skin data
Returns: A new model profile Example:

of(PlatformPlayer)

Gets the profile for an online player.
Parameters:
  • player - The online player
Returns: The player’s model profile Example:

of(PlatformOfflinePlayer)

Gets an uncompleted profile for an offline player.
Parameters:
  • offlinePlayer - The offline player
Returns: An uncompleted profile that can be resolved asynchronously Example:

of(UUID)

Gets an uncompleted profile by player UUID.
Parameters:
  • uuid - The player’s UUID
Returns: An uncompleted profile that can be resolved asynchronously Example:

Nested Types

Simple

A simple record implementation of ModelProfile.

Uncompleted

Represents a profile that needs to be completed asynchronously, typically for offline players or delayed skin fetching.

Methods

info() - Gets the available profile information complete() - Asynchronously completes the profile by fetching skin data fallback() - Returns a fallback profile without waiting for completion

Usage Examples

Basic Profile Creation

Async Profile Loading

Creating Custom Profiles

Checking Player Status

Working with Unknown Profiles

Profile Resolution Flow

  1. Online Player: ModelProfile.of(PlatformPlayer) returns immediate profile with full data
  2. Offline Player: ModelProfile.of(UUID) returns Uncompleted profile
  3. Fallback: Call fallback() for immediate partial data
  4. Complete: Call complete() for async full profile fetch
  5. Unknown: Use ModelProfile.UNKNOWN when no data is available

Thread Safety

Profile operations are designed to be thread-safe:
  • Synchronous methods (of(PlatformPlayer)) are safe for main thread
  • Async methods (complete()) handle profile fetching on background threads
  • The Uncompleted interface provides both immediate and async access patterns

See Also