Tracker
Represents the core controller for a specific model instance.
A Tracker manages the lifecycle, rendering, animation, and player interaction of a model. It coordinates with the RenderPipeline to update bone positions and send packets to players.
Since
1.15.2
Inheritors
Constructors
Link copied to clipboard
constructor(@NotNull pipeline: @NotNull RenderPipeline, @NotNull modifier: @NotNull TrackerModifier)
Creates a new tracker.
Types
Link copied to clipboard
Holds different types of packet bundlers for a tracker tick.
Link copied to clipboard
enum CloseReason
Reason for closing a tracker.
Link copied to clipboard
Functional interface for handling scheduled packets.
Properties
Functions
Link copied to clipboard
Plays an animation by name with default settings.
open fun animate(@NotNull animation: @NotNull TrackerAnimation<out Any>, @NotNull removeTask: @NotNull Runnable): Boolean
open fun animate(@NotNull animation: @NotNull String, @NotNull modifier: @NotNull AnimationModifier): Boolean
Plays an animation by name with a modifier.
open fun animate(@NotNull animation: @NotNull BlueprintAnimation, @NotNull modifier: @NotNull AnimationModifier): Boolean
Plays a blueprint animation with a modifier.
open fun animate(@NotNull animation: @NotNull String, @NotNull modifier: @NotNull AnimationModifier, @NotNull removeTask: @NotNull Runnable): Boolean
Plays an animation by name with a modifier and a completion task.
open fun animate(@NotNull animation: @NotNull BlueprintAnimation, @NotNull modifier: @NotNull AnimationModifier, @NotNull removeTask: @NotNull Runnable): Boolean
Plays a blueprint animation on filtered bones.
Link copied to clipboard
Retrieves a bone by name string.
@Nullable
Retrieves the first bone matching a predicate.
Retrieves a bone by name.
Link copied to clipboard
Returns a collection of all bones in the model.
Link copied to clipboard
open fun createHitBox(@NotNull entity: @NotNull BaseEntity, @Nullable listener: @Nullable HitBoxListener, @NotNull predicate: @NotNull BonePredicate): Boolean
Creates a hitbox for bones matching a predicate.
Link copied to clipboard
open fun createNametag(@NotNull predicate: @NotNull BonePredicate, @NotNull consumer: @NotNull BiConsumer<RenderedBone, ModelNametag>): Boolean
Creates a nametag for bones matching a predicate.
Link copied to clipboard
Returns a stream of all model displays.
Link copied to clipboard
Flags the tracker for a forced update on the next tick.
Link copied to clipboard
Checks if the tracker is marked for removal.
Marks the tracker for removal.
Link copied to clipboard
Registers a handler to run every frame (tracker tick).
Link copied to clipboard
Registers a handler for the tracker close event.
Link copied to clipboard
Hides the tracker from a specific player.
Link copied to clipboard
@Nullable
Retrieves or creates a hitbox for a specific bone.
Link copied to clipboard
Checks if the tracker is hidden from a specific player.
Link copied to clipboard
Checks if the tracker's update task is currently scheduled.
Link copied to clipboard
open fun listenHitBox(@NotNull function: @NotNull BiFunction<RenderedBone, HitBoxListener.Builder, HitBoxListener.Builder>)
Registers a hitbox-listener builder hook that is applied when hitboxes are created.
open fun <T : HitBoxEvent?> listenHitBox(@NotNull eventClass: @NotNull Class<T>, @NotNull consumer: @NotNull Consumer<T>)
Registers a hitbox event listener for newly created hitboxes.
Link copied to clipboard
Returns the current location of the model.
Link copied to clipboard
Returns the tracker modifier.
Link copied to clipboard
Registers a handler to run every tick for each visible player.
Link copied to clipboard
Returns the number of players currently viewing the model.
Link copied to clipboard
Removes the model for a specific player.
Link copied to clipboard
Returns the renderer associated with this tracker.
Link copied to clipboard
open fun replace(@NotNull target: @NotNull String, @NotNull animation: @NotNull String, @NotNull modifier: @NotNull AnimationModifier): Boolean
Replaces a running animation on filtered bones.
open fun replace(@NotNull target: @NotNull String, @NotNull animation: @NotNull BlueprintAnimation, @NotNull modifier: @NotNull AnimationModifier): Boolean
Replaces a running animation on filtered bones with a blueprint animation.
Link copied to clipboard
Returns the current rotation of the model.
Sets the supplier for the base model rotation.
Link copied to clipboard
Sets the model rotator strategy.
Link copied to clipboard
Returns the model scaler.
Sets the model scaler.
Link copied to clipboard
Schedules a handler to run periodically.
Link copied to clipboard
Shows the tracker to a specific player.
Link copied to clipboard
Stops an animation by name.
open fun stopAnimation(@NotNull filter: @NotNull Predicate<RenderedBone>, @NotNull animation: @NotNull String): Boolean
Stops an animation on filtered bones.
open fun stopAnimation(@NotNull filter: @NotNull Predicate<RenderedBone>, @NotNull animation: @NotNull String, @Nullable player: @Nullable PlatformPlayer): Boolean
Stops an animation on filtered bones for a specific player (optional).
Link copied to clipboard
Registers a handler to run every Minecraft tick (50ms).
Registers a handler to run every N Minecraft ticks.
Link copied to clipboard
open fun tryUpdate(@NotNull action: @NotNull BiPredicate<RenderedBone, BonePredicate>, @NotNull predicate: @NotNull BonePredicate): Boolean
Tries to apply an update action to bones matching a predicate.
Link copied to clipboard
Forces an update action on all bones.
open fun <T : TrackerUpdateAction?> update(@NotNull action: @NotNull T, @NotNull predicate: @NotNull Predicate<RenderedBone>)
open fun <T : TrackerUpdateAction?> update(@NotNull action: @NotNull T, @NotNull predicate: @NotNull BonePredicate)
Forces an update action on filtered bones.