Skip to main content

Overview

The TrackerModifier record class defines configuration options for a Tracker. It controls various behaviors such as visibility checks (sight trace), automatic damage animations, and damage tinting effects. Package: kr.toxicity.model.api.tracker Since: 1.15.2

Record Components

sightTrace

Whether to perform sight tracing for visibility. When enabled, the model is only visible to players who have line of sight to it. Default: true JSON Name: sight-trace

damageAnimation

Whether to play automatic damage animations when the entity takes damage. Default: true JSON Name: damage-animation
This only applies to EntityTracker. DummyTracker does not use this setting.

damageTint

Whether to apply a red tint when the entity is damaged. Default: true JSON Name: damage-tint
This only applies to EntityTracker. DummyTracker does not use this setting.

Constants

DEFAULT

The default modifier configuration with all features enabled.

Methods

builder

Creates a new builder initialized with default values. Returns: A new builder

toBuilder

Creates a new builder initialized with this modifier’s values. Returns: A new builder

Builder

The TrackerModifier.Builder class provides a fluent API for constructing TrackerModifier instances.

sightTrace

Sets whether to use sight tracing. Parameters:
  • sightTrace - true to enable sight tracing
Returns: This builder

damageAnimation

Sets whether to enable damage animations. Parameters:
  • damageAnimation - true to enable damage animations
Returns: This builder

damageTint

Sets whether to enable damage tinting. Parameters:
  • damageTint - true to enable damage tinting
Returns: This builder

build

Builds the TrackerModifier. Returns: The created modifier

Usage Examples

Using Default Settings

Custom Configuration

Modifying Existing Configuration

Configuration Profiles

JSON Serialization

Configuration Files

Feature Details

Sight Trace

When sightTrace is enabled:
  • The model checks line of sight from each player’s eye location to the model location
  • Players without line of sight will not see the model
  • Useful for realistic visibility (models behind walls are hidden)
  • Has a small performance cost for the raytrace calculation
When disabled:
  • The model is visible to all players within render distance
  • Better performance for models that should always be visible
  • Recommended for bosses, decorations, and important entities

Damage Animation

When damageAnimation is enabled:
  • The tracker automatically plays the “damage” animation when the entity takes damage
  • Falls back to “hurt” animation if “damage” is not available
  • Animation priority can be configured in the animation file
When disabled:
  • No automatic damage animation
  • You can still manually trigger animations with tracker.animate("damage")
  • Useful when you want custom damage animation logic

Damage Tint

When damageTint is enabled:
  • The model is tinted red when the entity takes damage
  • Tint color can be customized with EntityTracker.damageTintValue(int)
  • Tint duration is 10 tracker ticks (250ms) by default
  • Uses TrackerUpdateAction.tint() internally
When disabled:
  • No automatic damage tint
  • You can still manually apply tints with tracker.update(TrackerUpdateAction.tint(color))
  • Useful for custom damage indication logic or when tinting conflicts with other effects

Best Practices

  1. Use Profiles: Create reusable modifier profiles for different entity types
  2. Performance: Disable sightTrace for models that should always be visible
  3. Consistency: Use the same modifier settings for similar entity types
  4. Documentation: Document why you disabled certain features in comments
  5. Testing: Test with different settings to find the best balance for your use case

See Also

  • Tracker - Base tracker class that uses this modifier
  • EntityTracker - Entity tracker that uses damage features
  • DummyTracker - Dummy tracker (doesn’t use damage features)