This documentation is written for NameplateBuilder >= v4.260326.7 with API >= v2.2.0.
- From API 1.0.0 to 2.1.0
- From API 2.0.0 to 2.1.0
- From API 2.1.0 to 2.2.0
- Already on 2.2.0
What Changed
API 2.0.0 has two changes:- All method names were renamed for clarity (required - your code won’t compile until you rename them)
- Resolvers were added as a new way to provide segment text (optional but recommended - your existing tick systems still work)
Step 1: Update Dependencies
Replace the API jar in yourlibs/ folder and update both files:build.gradle:manifest.json:Step 2: Rename Methods
Find and replace these five method names across your code. The behavior is identical - only the names changed.After this step, your code compiles and works exactly as before. You’re done with the required migration.
NameplateData methods are unchanged. If you use data.setText(), data.getText(), etc. directly on the component, nothing needs to change.Step 3: Switch to Resolvers (Recommended)
This step is optional. Your renamedsetText() / clearText() code works fine. But if your segment’s value comes from an ECS component on the entity (health, stats, faction, etc.), resolvers are simpler and more efficient.The idea: Instead of writing a tick system that reads a component and calls setText() every tick, you give NameplateBuilder a function that does the reading. NameplateBuilder calls it automatically - no tick system needed.Before (1.0.0 pattern)
You had to write a tick system class, register it, handle spawn initialization withCommandBuffer, and update every tick:After (2.0.0 with resolver)
Everything is insetup(). No tick system class needed:HealthNameplateSystem), its registration in setup(), and the CommandBuffer initialization logic. The resolver replaces all of it.You can also add .cacheTicks(100) for data that rarely changes (faction, level, tier) to avoid recomputing every tick. See Resolvers for the full guide.When to Keep Using setText()
Keep your existing setText() / clearText() code if your segment’s value doesn’t come from an ECS component. For example:- A bounty stored in your mod’s config file or database
- A title assigned by an admin via a chat command
- A buff applied through an event, not stored as a component
setText() is the right approach.Rule of thumb: If you’re reading a component inside a tick system and calling setText() with the result, that’s a resolver. If you’re reacting to an event or command, keep setText().