Overview
EntityTrackers are the core controller for model instances in BetterModel. They manage the lifecycle, rendering, animation, and player interaction of a model attached to an entity.Understanding Trackers
BetterModel provides three types of trackers:- EntityTracker: Attached to a living entity, synchronizes position and rotation
- PlayerTracker: Specialized for player entities with player-mode body rotation
- DummyTracker: Standalone models at fixed locations, not bound to any entity
Creating Entity Trackers
Basic Entity Tracker
Create a tracker attached to an entity:getOrCreate() returns an existing tracker if the entity already has this model attached, preventing duplicates.Creating with Custom Modifier
UseTrackerModifier to customize behavior:
Pre-spawn Configuration
Configure the tracker before it spawns to players:Creating Dummy Trackers
DummyTrackers are perfect for stationary models, decorations, or custom NPCs:Dummy Tracker with Player Skin
Create a dummy tracker using a player’s skin:Moving Dummy Trackers
Update the location of a dummy tracker:Working with the Registry
Retrieving Existing Trackers
Get a tracker for an entity that already has a model:Listing All Trackers for an Entity
Managing Tracker Lifecycle
Spawning to Specific Players
Control which players can see the model:Mark for Spawn
Control which players the model spawns for:Pausing and Resuming
Pause tracker updates temporarily:Closing Trackers
Properly close a tracker when you’re done:Advanced Features
Custom Scaling
Custom Rotation
Close Event Handling
Listen for when a tracker closes:Per-Tick Tasks
Run code every tracker tick (25ms):Player-Specific Models
Creating Player Trackers
Player trackers automatically handle player-specific body rotation:Simplified Player Animation API
Common Patterns
Entity Spawn Integration
Removing Models on Death
Next Steps
Playing Animations
Control and sequence animations
Custom Hitboxes
Add interactive hitboxes to your models
