Skip to main content
The HitBox interface represents an interactive collision box attached to a bone. Hitboxes enable player interaction, damage detection, and entity mounting for models.

Class Information

Package: kr.toxicity.model.api.nms
Type: Interface
Extends: Identifiable
Since: 1.15.2

Overview

Hitboxes are typically implemented using invisible entities (like Slimes or Interaction entities) that follow bone positions. They enable:
  • Click/interact detection
  • Damage/attack detection
  • Entity mounting and riding
  • Custom collision shapes per bone

Creation

Hitboxes are created through RenderedBone:
Example:

Identification

Get information about the hitbox’s associated bone and entity. Example:

Interaction Events

Internal Trigger Methods

These methods are called internally by the NMS implementation:
Note: These are invoked automatically when players interact with the hitbox entity. Use HitBoxListener to handle these events.

Visibility Control

Control hitbox visibility per player. These methods manage packet sending for the underlying entity.

Position and Transform

Returns the hitbox position relative to its source entity. Example:

Mounting System

Mount Controller

Get or set the mount controller that defines mounting behavior. Example:

Mounting Entities

Manage entities mounted on this hitbox. Example:

Event Handling

Returns the listener attached to this hitbox. Example:

Registry Access

Returns the entity tracker registry for the source entity, if available. Example:

Lifecycle

Safely removes the hitbox and cleans up associated resources. Example:

Complete Example: Interactive Door

Complete Example: Rideable Mount

See Also