Skip to main content
Learn how to create fully animated NPCs using BetterModel with custom interactions and behavior.

Overview

This example demonstrates creating an NPC system with:
  • Custom 3D model rendering
  • State-based animations (idle, talking, waving)
  • Click interactions using hitboxes
  • Player-specific visibility

Implementation

NPC Manager Class

Usage Example

Creating NPCs

Advanced Features

Scheduled Animations

Look at Player

Per-Player Interactions

Best Practices

  • Use DummyTracker for stationary NPCs - they’re more efficient than entity-based trackers
  • Always create a base entity (like ArmorStand) for hitbox interactions
  • Cache player interaction states to prevent spam clicking
  • Use PLAY_ONCE animation type for gesture animations
  • Remember to remove NPCs when your plugin disables
  • Store NPC data persistently if you want them to survive restarts
  • Limit the number of active NPCs in a single area for performance

Next Steps

Custom Events

Learn more about hitbox events and custom interactions

Conditional Animations

Create complex animation state machines

Player Cosmetics

Apply models to players as cosmetic items

Multi-part Entities

Build entities with multiple synchronized models