EntityTracker
A tracker implementation that is attached to a living entity.
This tracker synchronizes the model's position, rotation, and animations with the target entity. It handles hitboxes, nametags, damage tinting, and mounting mechanics.
Since
1.15.2
Inheritors
Constructors
Link copied to clipboard
@ApiStatus.Internal
Creates a new entity tracker.
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
Converts the current tracker state to a TrackerData object.
Link copied to clipboard
Returns the entity body rotator.
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
Checks if this tracker's data can be saved.
Link copied to clipboard
Checks if the model can be spawned for a specific player.
Link copied to clipboard
Cancels the active damage tint effect.
Link copied to clipboard
open fun createHitBox(@Nullable listener: @Nullable HitBoxListener, @NotNull predicate: @NotNull BonePredicate): Boolean
Creates hitboxes for the entity based on a predicate.
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
Triggers the damage tint effect if enabled.
Link copied to clipboard
Returns the current damage tint color value.
Sets the damage tint color value.
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
Returns the hide option for this tracker.
Sets the hide option for this tracker.
Link copied to clipboard
@Nullable
Retrieves or creates a hitbox for the entity.
@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
Marks a set of players for spawning the model.
Marks a player for spawning 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
Returns the entity tracker registry associated with this tracker.
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
Returns the source entity being tracked.
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
Unmarks a player for spawning the model.
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.
Link copied to clipboard
Synchronizes the tracker with the base entity's data asynchronously.