Skip to main content

Overview

The ModelRenderer record represents a blueprint renderer that manages the lifecycle of rendered models. It provides methods to create trackers for both location-based (dummy) and entity-based rendering, with support for model profiles and customization.

Record Components

Query Methods

groupByTree

Retrieves a renderer group by traversing the bone tree. Parameters:
  • name - The bone name to search for
Returns: The matching renderer group, or null if not found

flatten

Returns a flattened stream of all renderer groups in the hierarchy. Returns: Stream of all renderer groups

animation

Retrieves a blueprint animation by name. Parameters:
  • name - The animation name
Returns: Optional containing the animation if found

Creating Location-Based Trackers

Basic Creation

Creates a dummy tracker at a specific location without entity attachment. Parameters:
  • location - The world location for the model
  • modifier - (Optional) Modifier for tracker behavior, defaults to TrackerModifier.DEFAULT
  • preUpdateConsumer - (Optional) Consumer executed before each update tick
Returns: A new DummyTracker instance Example:

With Model Profile

Creates a dummy tracker with a specific model profile (skin/texture). Parameters:
  • location - The world location
  • profile - The model profile or its uncompleted variant
  • modifier - (Optional) Tracker modifier
  • preUpdateConsumer - (Optional) Pre-update callback
Example:

Creating Entity-Based Trackers

Basic Entity Trackers

Creates a tracker attached to an entity. The model will follow the entity’s position and rotation. Parameters:
  • entity - The platform entity or BaseEntity to attach to
  • modifier - (Optional) Tracker modifier
  • preUpdateConsumer - (Optional) Pre-update callback
Returns: A new EntityTracker instance Example:

Entity Trackers with Profile

Creates an entity tracker with a specific model profile. Example:

Get or Create Pattern

Retrieves an existing tracker for the entity, or creates a new one if none exists. Useful for ensuring only one tracker per entity. Returns: Existing or newly created EntityTracker Example:

BaseEntity Variants

All PlatformEntity methods have corresponding BaseEntity variants:
These methods work identically but accept BaseEntity instead of PlatformEntity. Example:

Renderer Type

Defines the renderer type:
  • GENERAL - Standard models that can be saved
  • PLAYER - Player-specific models that cannot be saved
Access:

Complete Example

See Also