Overview
TheRenderSource interface represents a source for rendering models, providing the necessary context such as location and entity data. It serves as the entry point for creating tracker instances and supports both entity-based and location-based (dummy) rendering.
Interface Hierarchy
Factory Methods
These static methods create appropriateRenderSource instances:
Location-Based Sources
location- The world location where the model will be rendered
BaseDummy instance
location- The world locationprofile- The uncompleted model profile (skin/texture)
ProfiledDummy instance
Entity-Based Sources
entity- The entity to attach the model to
BasePlayer if entity is a player, otherwise BaseEntity
entity- The entity to attach toprofile- The model profile
ProfiledPlayer if entity is a player, otherwise ProfiledEntity
Core Methods
location
create
pipeline- The render pipeline to usemodifier- The tracker modifier for behavior configurationpreUpdateConsumer- Consumer to run before each update
completeContext
fallbackContext
BoneRenderContext for this source
Dummy Sources
Location-based rendering without entity attachment.BaseDummy
ProfiledDummy
Entity Sources
Rendering attached to entity with automatic position tracking.Entity Interface
entity
getOrCreate
name- The name/identifier of the trackersupplier- Supplier for creating the render pipelinemodifier- Tracker modifierpreUpdateConsumer- Pre-update callback
BaseEntity
ProfiledEntity
BasePlayer
Profiled interface.
Additional Methods:
ModelProfile profile()- Returns player’s model profilePlayerArmor armors()- Returns player’s armorPlayerSkinParts skinParts()- Returns visible skin parts
ProfiledPlayer
Profiled Interface
Player sources implement this interface for additional data:Usage Patterns
Creating Trackers from Source
Working with Profiles
Async Context Loading
Entity Tracker Management
Type Selection Logic
The factory methods automatically select the appropriate implementation:Complete Example
See Also
- ModelRenderer - Uses sources to create trackers
- RenderPipeline - Created from render sources
- Tracker - Created by render sources
- ModelProfile - Profile data used by sources
