listenHitBox
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.
This delegates to handleCreateHitBox in this tracker's render pipeline event dispatcher.
tracker.listenHitBox((bone, builder) -> builder.interact(event -> {
// custom interaction handling
}));
Content copied to clipboard
Since
2.1.0
Parameters
function
the hitbox listener builder transformer
open fun <T : HitBoxEvent?> listenHitBox(@NotNull eventClass: @NotNull Class<T>, @NotNull consumer: @NotNull Consumer<T>)
Registers a hitbox event listener for newly created hitboxes.
This is a convenience wrapper over listenHitBox.
tracker.listenHitBox(HitBoxInteractEvent.class, event -> {
// custom interaction handling
});
Content copied to clipboard
Since
2.1.0
Parameters
eventClass
target hitbox event class
consumer
event consumer
<T>
event type