HitBox

interface HitBox : Identifiable

Represents a hitbox for a model part, allowing for interaction and collision detection.

Hitboxes are often implemented using invisible entities (like Slimes or Interaction entities) and are linked to specific bones in the model.

Since

1.15.2

Functions

Link copied to clipboard
abstract fun dismount(@NotNull entity: @NotNull PlatformEntity)
Dismounts an entity from this hitbox.
Link copied to clipboard
abstract fun dismountAll()
Dismounts all passengers from this hitbox.
Link copied to clipboard
abstract fun forceDismount(): Boolean
Checks if a dismount operation is forced.
Link copied to clipboard
@NotNull
open fun groupName(): @NotNull BoneName
Returns the name of the bone group associated with this hitbox.
Link copied to clipboard
Checks if this hitbox is being controlled by another entity.
Link copied to clipboard
abstract fun hasMountDriver(): Boolean
Checks if this hitbox has a mount driver.
Link copied to clipboard
@ApiStatus.Internal
abstract fun hide(@NotNull player: @NotNull PlatformPlayer)
Hides this hitbox from a specific player.
Link copied to clipboard
abstract fun id(): Int
Returns the integer ID of the object (e.g., entity ID).
Link copied to clipboard
@NotNull
abstract fun listener(): @NotNull HitBoxListener
Returns the listener associated with this hitbox.
open fun listener(@NotNull function: @NotNull (HitBoxListener.Builder) -> HitBoxListener.Builder)
Updates the listener for this hitbox using a builder function.
@ApiStatus.Internal
abstract fun listener(@NotNull listener: @NotNull HitBoxListener)
Sets the listener for this hitbox.
Link copied to clipboard
abstract fun mount(@NotNull entity: @NotNull PlatformEntity)
Mounts an entity onto this hitbox.
Link copied to clipboard
@NotNull
abstract fun mountController(): @NotNull MountController
Returns the mount controller for this hitbox.
abstract fun mountController(@NotNull controller: @NotNull MountController)
Sets the mount controller for this hitbox.
Link copied to clipboard
abstract fun onWalk(): Boolean
Checks if the passenger of this hitbox is walking.
Link copied to clipboard
@NotNull
abstract fun positionSource(): @NotNull RenderedBone
Returns the rendered bone that acts as the position source for this hitbox.
Link copied to clipboard
@NotNull
open fun registry(): @NotNull Optional<EntityTrackerRegistry>
Returns the entity tracker registry for this hitbox's source entity.
Link copied to clipboard
@NotNull
abstract fun relativePosition(): @NotNull Vector3f
Returns the relative position of this hitbox to its source entity.
Link copied to clipboard
abstract fun removeHitBox()
Removes this hitbox safely.
Link copied to clipboard
@ApiStatus.Internal
abstract fun show(@NotNull player: @NotNull PlatformPlayer)
Shows this hitbox to a specific player.
Link copied to clipboard
@NotNull
abstract fun source(): @NotNull PlatformEntity
Returns the source entity of this hitbox.
Link copied to clipboard
@NotNull
abstract fun uuid(): @NotNull UUID
Returns the UUID of the object.