Skip to main content
Learn how to optimize BetterModel for large servers with many players and models.

Overview

Performance optimization strategies:
  • Efficient tracker management
  • Animation optimization
  • Network packet optimization
  • Memory management
  • Async operations

Tracker Management

Efficient Tracker Creation

Animation Optimization

Efficient Animation Updates

Sight Trace Optimization

Visibility Management

Update Action Optimization

Batching Updates

Memory Management

Preventing Memory Leaks

Async Operations

Offloading Heavy Tasks

Best Practices Summary

Performance Checklist

1

Tracker Management

  • Use getOrCreate() to prevent duplicates
  • Cache tracker references
  • Implement cleanup tasks
  • Use WeakHashMap for temporary references
2

Animation Optimization

  • Cache animation states
  • Use tick intervals instead of frames
  • Only update when state changes
  • Use predicates for conditional animations
3

Network Optimization

  • Batch updates with composite()
  • Disable unnecessary features (sight trace, damage tint)
  • Use view distance limits
  • Implement per-player animations sparingly
4

Memory Management

  • Always close trackers when done
  • Remove event listeners
  • Clear caches periodically
  • Monitor memory usage
  • Profile your plugin with tools like Spark
  • Monitor tracker count with /bettermodel debug
  • Use sight trace only when necessary
  • Batch updates whenever possible
  • Implement aggressive cleanup for temporary models
  • Don’t create trackers every tick
  • Avoid updating animations without state checks
  • Don’t forget to close trackers
  • Monitor network usage with many models
  • Test with realistic player counts

Monitoring Performance

Debug and Profiling

Next Steps

Basic Entity Model

Start with optimized implementations

Installation

Configure BetterModel settings

API Reference

Explore the complete API

Bukkit/Spigot/Paper

Platform-specific guides