Prerequisites
- BetterModel plugin installed on your server
- A
.bbmodelfile placed inplugins/BetterModel/models/ - Basic Java/Kotlin knowledge
For this tutorial, we’ll assume you have a model file named
demon_knight.bbmodel with an animation called attack.Step 1: Get a Model
1
Load the Model
Use
BetterModel.model() to retrieve a model renderer by name. The name corresponds to the .bbmodel file without the extension.Use
BetterModel.modelOrNull() if you prefer null checks over Optional.2
Understanding Model Types
BetterModel supports two types of models:
- General models (
BetterModel.model()) - Located inBetterModel/models/, used for entities - Player limb models (
BetterModel.limb()) - Located inBetterModel/players/, used for player cosmetics
Step 2: Spawn the Model
You can spawn models on entities or at specific locations.Attach to an Entity
Attach a model to a living entity (e.g., zombie, armor stand):BukkitAdapter.java
BukkitAdapter.adapt() converts Bukkit entities to BetterModel’s platform-agnostic entity wrapper.Spawn at a Location (Dummy)
Create a standalone model at a specific location:Get or Create Pattern
UsegetOrCreate() to reuse existing trackers or create a new one:
Step 3: Play an Animation
Once spawned, animate the model using the tracker:Advanced Animation Control
Control animation speed, looping, and transitions:Stop an Animation
Step 4: Customize Display Properties
Update the model’s appearance usingTrackerUpdateAction:
Apply Updates Before Spawn
You can apply updates before the model is sent to players:Complete Example
Here’s a full working example that ties everything together:CompleteExample.java
Common Patterns
Check if Entity Already Has Model
Remove Model from Entity
Listen for Animation Events
Troubleshooting
Model returns null or empty
Model returns null or empty
- Verify the
.bbmodelfile is inplugins/BetterModel/models/ - Check the filename matches (case-sensitive)
- Look for errors in
plugins/BetterModel/logs/or server console - Ensure the model was loaded on server start
Animation doesn't play
Animation doesn't play
- Confirm the animation name matches exactly (case-sensitive)
- Check the animation exists in the
.bbmodelfile - Verify the tracker is not closed or removed
- Ensure players are within render distance
Model not visible
Model not visible
- Check that the entity is in a loaded chunk
- Verify sight tracing settings in
TrackerModifier - Ensure the model has valid textures
- Try adjusting view range with
TrackerUpdateAction.viewRange()
Next Steps
API Reference
Explore all available methods and classes
Animation System
Deep dive into animation control
Player Models
Learn about 12-limb player animations
Examples
See real-world usage examples
