Overview
TheEntityTracker class is a Tracker implementation that is attached to a living entity. It synchronizes the model’s position, rotation, and animations with the target entity, and handles hitboxes, nametags, damage tinting, and mounting mechanics.
Package: kr.toxicity.model.api.tracker
Extends: Tracker
Since: 1.15.2
Key Features
- Entity Synchronization: Automatically follows the target entity’s position and rotation
- Damage Effects: Supports damage tinting and animations
- Shadow Rendering: Automatically manages entity shadows
- Head Rotation: Synchronizes head bone rotation with entity look direction
- Mounting: Supports mounting entities on model bones
- Nametag Management: Automatically displays entity custom names
- Persistence: Can save and restore tracker state
Constructor
registry- The entity tracker registrypipeline- The render pipelinemodifier- The tracker modifierpreUpdateConsumer- A consumer to run before the first update
This constructor is marked
@ApiStatus.Internal and should not be called directly.
Use BetterModelAPI.createEntityTracker() or similar factory methods instead.Methods
Entity Information
sourceEntity
registry
location
Damage Effects
damageTint
damageTintValue
0xFF8080 (light red)
cancelDamageTint
Entity Synchronization
updateBaseEntity
refresh
This method is marked
@ApiStatus.Internal and is typically called automatically.HitBox Management
createHitBox
listener- Optional hitbox listener for interaction eventspredicate- Bone predicate to filter which bones get hitboxes
true if any hitboxes were created
hitbox
listener- Optional hitbox listenerpredicate- Bone predicate
null if not found/created
Rotation Control
bodyRotator
rotation
Player Spawning Control
markPlayerForSpawn
true if any players were added
unmarkPlayerForSpawn
true if the player was removed
canBeSpawnedAt
true if allowed
Visibility Options
hideOption
hideOption- The new hide option controlling when the entity is hidden
Persistence
asTrackerData
TrackerData object for persistence.
Returns: The tracker data
canBeSaved
true if saveable
Lifecycle
despawn
CloseReason.DESPAWN.
Otherwise, it calls the parent despawn() method.
Usage Examples
Creating an Entity Tracker
Damage Effects
Entity Synchronization
HitBox and Mounting
Body and Head Rotation
Player-Specific Spawning
Hide Options
Persistence
Events
The following events are fired for entity trackers:CreateEntityTrackerEvent- When the tracker is createdMountModelEvent- When an entity mounts a boneDismountModelEvent- When an entity dismounts a bone- All standard
Trackerevents (spawn, despawn, close, etc.)
See Also
- Tracker - Base tracker class
- DummyTracker - Standalone tracker
- TrackerModifier - Configuration options
- TrackerUpdateAction - Update actions
