Overview
TheTracker class is the core controller for a specific model instance in BetterModel. It manages the lifecycle, rendering, animation, and player interaction of a model, coordinating with the RenderPipeline to update bone positions and send packets to players.
Package: kr.toxicity.model.api.tracker
Since: 1.15.2
Key Concepts
- Lifecycle Management: Controls spawning, despawning, and closing of model instances
- Animation Control: Plays, stops, and replaces animations on the model
- Player Visibility: Manages which players can see the model
- Scheduled Updates: Runs periodic tasks at frame-rate (25ms) or Minecraft tick intervals (50ms)
- Bone Management: Provides access to individual bones for manipulation
Constructor
pipeline- The render pipelinemodifier- The tracker modifier configuration
Core Methods
Lifecycle
location
close
close(CloseReason.REMOVE)).
despawn
isClosed
Animation
animate
true if the animation started
stopAnimation
true if the animation was stopped
replace
true if the replacement occurred
Rotation and Scale
rotation
rotator
scaler
Scheduling
task
frame
tick
schedule
perPlayerTick
Bone Access
bone
null if not found
bones
displays
Update Actions
update
tryUpdate
true if any bones were updated
HitBox and Nametag
createHitBox
true if any hitboxes were created
hitbox
null if not found/created
createNametag
true if any nametags were created
listenHitBox
Player Visibility
hide
true if hidden successfully
show
true if shown successfully
isHide
isSpawned
Other Methods
pause
true if the state changed
forceUpdate
true if the state changed
height
name
playerCount
renderer
modifier
handleCloseEvent
Constants
TRACKER_TICK_INTERVAL
MINECRAFT_TICK_MULTIPLIER
Inner Classes
ScheduledPacketHandler
Functional interface for handling scheduled packets.BundlerSet
Holds different types of packet bundlers for a tracker tick.CloseReason
Enum representing reasons for closing a tracker.Usage Examples
Basic Animation Control
Scheduling Tasks
Bone Manipulation
HitBox Management
Player Visibility
See Also
- EntityTracker - Tracker attached to entities
- DummyTracker - Standalone tracker at fixed location
- TrackerModifier - Configuration options
- TrackerUpdateAction - Update action types
