Skip to main content

Overview

Hitboxes in BetterModel allow you to create interactive regions on your model that respond to player clicks, attacks, and entity mounting. They’re implemented using invisible entities synchronized with bone positions.

Understanding Hitboxes

What are Hitboxes?

Hitboxes are invisible collision boxes attached to model bones that:
  • Detect player interactions (right-click, left-click, attack)
  • Support entity mounting and vehicles
  • Follow bone transformations (position, rotation, animation)
  • Can be created automatically or manually

Hitbox Types

BetterModel uses different entity types for hitboxes:
  • Interaction entities (1.19.4+): Precise click detection
  • Slimes: Compatibility for older versions

Automatic Hitbox Creation

Using Bone Tags

Tag bones in BlockBench with hitbox to auto-create hitboxes:
Hitboxes are created automatically when the tracker spawns.

Using Bone Names

Name a bone hitbox to auto-create:

Manual Hitbox Creation

Creating a Single Hitbox

Create hitboxes programmatically using bone predicates:

Creating with Custom Listener

Add custom interaction handling:

Hitbox Events

Available Events

Tracker-Level Event Listening

Register event listeners directly on a tracker:

Working with Hitboxes

Retrieving Hitboxes

Get a hitbox from a bone:

Accessing from Registry

Get all hitboxes for an entity:

Removing Hitboxes

Remove a specific hitbox:

Mounting System

Mount Controllers

Control mounting behavior:

Mounting Entities

Mount an entity to a hitbox:

Mount Events

Listen for mount/dismount:

Vehicle Movement

Check if passenger is walking:

Advanced Hitbox Usage

Conditional Hitbox Creation

Create hitboxes based on conditions:

Dynamic Hitbox Listeners

Change hitbox behavior at runtime:

Multi-Hitbox Interactions

Create complex interaction patterns:

Hitbox Visibility Control

Show/hide hitboxes for specific players:

Hitbox Best Practices

Performance Tips:
  • Limit hitboxes to interactive areas only
  • Use bone tags for automatic creation
  • Avoid creating/destroying hitboxes frequently
  • Cache hitbox references when possible
Common Pitfalls:
  • Hitboxes follow animations - ensure bones are properly positioned
  • Large hitbox counts can impact performance
  • Mount points require proper pivot positioning
  • Hitbox size is determined by bone group configuration

Naming Conventions

Use clear, descriptive bone names:

Size Configuration

Configure hitbox size in bone groups:

Debugging Hitboxes

Visual Debugging

Make hitboxes visible temporarily:

Logging Interactions

Example: Interactive NPC

Next Steps

Player Models

Work with player limb models and customization

Per-Player Animation

Individual animation states per player