Skip to main content

Overview

The BetterModel class provides static access to the platform instance, configuration, model managers, NMS handlers, and entity registries. It serves as a service provider for interacting with the BetterModel engine. This is the primary class you’ll use to access all BetterModel functionality.
The BetterModel class cannot be instantiated. All methods are static and accessed directly.

Package

Static Methods

Configuration

config()

Returns the platform configuration manager.
Returns: BetterModelConfig - The configuration manager Since: 1.15.2 Example:

Model Management

model()

Retrieves a model renderer by its name, wrapped in an Optional.
String
required
The name of the model to retrieve
Returns: Optional<ModelRenderer> - An optional containing the renderer if found Since: 1.15.2 Example:

modelOrNull()

Retrieves a model renderer by its name, or null if not found.
String
required
The name of the model to retrieve
Returns: ModelRenderer - The renderer, or null if not found Since: 1.15.2

models()

Returns a collection of all loaded model renderers.
Returns: Collection<ModelRenderer> - An unmodifiable collection of models Since: 1.15.2

modelKeys()

Returns a set of all loaded model names.
Returns: Set<String> - An unmodifiable set of model keys Since: 1.15.2

Player Limb Management

limb()

Retrieves a player limb renderer by its name, wrapped in an Optional.
String
required
The name of the limb model to retrieve
Returns: Optional<ModelRenderer> - An optional containing the renderer if found Since: 1.15.2 Example:

limbOrNull()

Retrieves a player limb renderer by its name, or null if not found.
String
required
The name of the limb model to retrieve
Returns: ModelRenderer - The renderer, or null if not found Since: 1.15.2

limbs()

Returns a collection of all loaded player limb renderers.
Returns: Collection<ModelRenderer> - An unmodifiable collection of limb models Since: 1.15.2

limbKeys()

Returns a set of all loaded player limb model names.
Returns: Set<String> - An unmodifiable set of limb keys Since: 1.15.2

Player Management

player()

Retrieves a player channel handler by the player’s UUID.
UUID
required
The player’s unique identifier
Returns: Optional<PlayerChannelHandler> - An optional containing the channel handler if found Since: 1.15.2 Example:

Entity Registry Management

registry(UUID)

Retrieves an entity tracker registry by the entity’s UUID.
UUID
required
The entity’s unique identifier
Returns: Optional<EntityTrackerRegistry> - An optional containing the registry if found Since: 1.15.2

registry(PlatformEntity)

Retrieves an entity tracker registry for a platform entity.
PlatformEntity
required
The platform entity (e.g., Bukkit entity)
Returns: Optional<EntityTrackerRegistry> - An optional containing the registry if found Since: 1.15.2

registry(BaseEntity)

Retrieves an entity tracker registry for a base entity.
BaseEntity
required
The base entity
Returns: Optional<EntityTrackerRegistry> - An optional containing the registry if found Since: 1.15.2

registryOrNull(UUID)

Retrieves an entity tracker registry by the entity’s UUID, or null if not found.
UUID
required
The entity’s unique identifier
Returns: EntityTrackerRegistry - The registry, or null if not found Since: 1.15.2

registryOrNull(PlatformEntity)

Retrieves an entity tracker registry for a platform entity, or null if not found.
PlatformEntity
required
The platform entity (e.g., Bukkit entity)
Returns: EntityTrackerRegistry - The registry, or null if not found Since: 1.15.2

registryOrNull(BaseEntity)

Retrieves an entity tracker registry for a base entity, or null if not found.
BaseEntity
required
The base entity
Returns: EntityTrackerRegistry - The registry, or null if not found Since: 1.15.2 Example:

Platform Access

platform()

Returns the singleton instance of the BetterModel platform.
Returns: BetterModelPlatform - The platform instance Throws: NullPointerException - If the platform has not been initialized Since: 2.0.0 Example:

nms()

Returns the NMS handler instance for version-specific operations.
Returns: NMS - The NMS handler Since: 1.15.2

eventBus()

Returns the event bus for registering and handling events.
Returns: BetterModelEventBus - The event bus Since: 2.0.0

Complete Example

See Also