Skip to main content

Overview

The TrackerUpdateAction sealed interface represents an action that updates the state of a RenderedBone. Actions can modify display properties like brightness, glow, item stack, billboard mode, and more. They are applied to bones matching a specific predicate. Package: kr.toxicity.model.api.tracker Since: 1.15.2

Interface Methods

test

Applies the action to a bone if it matches the predicate. Parameters:
  • bone - The target bone
  • predicate - The predicate to check against
Returns: true if the bone was updated

then

Chains this action with another action. Parameters:
  • action - The next action
Returns: The combined action

stream

Returns a stream of actions (useful for flattening composites). Returns: The stream of actions

Factory Methods

brightness

Creates an action to update display brightness. Parameters:
  • block - The block light level (0-15)
  • sky - The skylight level (0-15)
Returns: The brightness action

glow

Creates an action to toggle the glowing effect. Parameters:
  • glow - true to enable glow
Returns: The glow action

glowColor

Creates an action to set the glow color. Parameters:
  • glowColor - The RGB glow color (hex format)
Returns: The glow color action

viewRange

Creates an action to set the view range. Parameters:
  • viewRange - The view range in blocks
Returns: The view range action

tint

Creates an action to apply a tint color. Parameters:
  • rgb - The RGB tint color (hex format)
Returns: The tint action

previousTint

Creates an action to revert to the previous tint. Returns: The previous tint action

enchant

Creates an action to toggle the enchanted glint effect. Parameters:
  • enchant - true to enable glint
Returns: The enchant action

togglePart

Creates an action to toggle the visibility of a part. Parameters:
  • toggle - true to show, false to hide
Returns: The toggle part action

itemStack

Creates an action to update the displayed item stack. Parameters:
  • itemStack - The new item stack
Returns: The item stack action

billboard

Creates an action to set the billboard constraint. Parameters:
  • billboard - The billboard type (FIXED, VERTICAL, HORIZONTAL, CENTER)
Returns: The billboard action

itemMapping

Creates an action to update the item mapping. Returns: The item mapping action

moveDuration

Creates an action to set the movement interpolation duration. Parameters:
  • moveDuration - The duration in ticks
Returns: The move duration action

composite

Combines multiple actions into a single composite action. Parameters:
  • actions - The actions to combine
Returns: The composite action

perBone

Creates an action that generates a specific action for each bone. Parameters:
  • builder - The function to generate actions
Returns: The per-bone action

none

Returns a no-op action. Returns: The none action

Action Types

Brightness

Updates the display brightness (light levels).

Glow

Toggles the glowing effect.

GlowColor

Sets the glow color (RGB hex).

ViewRange

Sets the view range in blocks.

Enchant

Toggles the enchantment glint effect.

Tint

Applies a color tint (RGB hex).

PreviousTint

Reverts to the previous tint.

TogglePart

Toggles part visibility (show/hide).

ItemStack

Updates the displayed item stack.

Billboard

Sets the billboard constraint mode.

ItemMapping

Updates the item mapping.

MoveDuration

Sets movement interpolation duration.

Composite

Combines multiple actions.

PerBone

Generates dynamic actions per bone.

None

No-op action.

Usage Examples

Basic Updates

Filtered Updates

Composite Actions

Per-Bone Dynamic Actions

Billboard Modes

Item Stack Updates

Movement Interpolation

Visibility Control

View Range Control

Advanced Examples

Damage Effect

Glowing Outline

Equipment Display

Night Vision Effect

Best Practices

  1. Combine Actions: Use composite() or then() to apply multiple changes atomically
  2. Use Predicates: Filter bones efficiently with BonePredicate instead of updating all bones
  3. Revert Changes: Store previous states when making temporary changes
  4. Performance: Batch updates together rather than calling update() multiple times
  5. None Action: Use none() for conditional logic instead of null checks

See Also