Skip to main content

Overview

The DummyTracker class is a Tracker implementation that is not attached to any entity. Dummy trackers are positioned at a fixed location in the world and can be moved manually. They are useful for static models, decorative elements, or models controlled entirely by scripts, plugins, or mods. Package: kr.toxicity.model.api.tracker Extends: Tracker Since: 1.15.2

Key Features

  • Fixed Position: Positioned at a specific location, independent of entities
  • Manual Control: All movement and rotation must be controlled programmatically
  • Lightweight: No entity synchronization overhead
  • Static or Dynamic: Can be completely static or dynamically controlled
  • Custom Rotation: Rotation based on location pitch/yaw

Constructor

Creates a new dummy tracker. Parameters:
  • location - The initial location
  • pipeline - The render pipeline
  • modifier - The tracker modifier
  • preUpdateConsumer - A consumer to run before the first update
This constructor is public but typically you should use BetterModelAPI.createDummyTracker() or similar factory methods.

Methods

Location Management

location

Returns the current location of the tracker. Returns: The location

location (setter)

Moves the model to a new location. This method handles teleporting all bones and sending packets to all viewing players. Parameters:
  • location - The new location (must not be null)
This method is synchronized and involves packet sending. Avoid calling it excessively (e.g., every tick) for performance reasons.

Player Management

spawn

Spawns the model for a specific player. This immediately spawns the model and sends all necessary packets to the player. Parameters:
  • player - The target player

Default Behavior

When a DummyTracker is created:
  1. Spawn Animation: Automatically plays the “spawn” animation with PLAY_ONCE modifier (if available)
  2. Scale: Uses the configured ModelScaler from the tracker
  3. Rotation: Uses the location’s pitch and yaw for model rotation

Usage Examples

Creating a Dummy Tracker

Moving a Dummy Tracker

Animated Movement

Rotating Dummy Tracker

Static Decoration

Interactive Dummy

Spawning for Specific Players

Cleanup

Common Use Cases

1. Static Decorations

Use dummy trackers for decorative models that don’t move:
  • Statues
  • Furniture
  • Buildings
  • Signs

2. Animated Props

Use for props with looping animations:
  • Windmills
  • Waterfalls
  • Flags

3. Cutscene Elements

Use for scripted cutscene models:
  • NPCs in cutscenes
  • Moving platforms
  • Cinematic objects

4. World Bosses (Non-Entity)

Use for custom boss models not tied to entities:

Performance Considerations

  1. Location Updates: Minimize calls to location(PlatformLocation) as they send packets to all viewers
  2. Pausing: Use pause(true) for completely static models to save CPU
  3. View Distance: Use TrackerModifier.sightTrace(false) if models don’t need line-of-sight checks
  4. Animations: Static models should use AnimationModifier.playOnce(true) for spawn animations

Events

The following events are fired for dummy trackers:
  • CreateDummyTrackerEvent - When the tracker is created
  • All standard Tracker events (spawn, despawn, close, etc.)

See Also