Nbt Api Plugin Wiki › Guides › Read and Modify Entity NBT Data
Read and Modify Entity NBT Data
Understanding Entity NBT
Every entity in Minecraft stores data in NBT format—health, velocity, custom names, and more. The NBT API lets you inspect and change this data on mobs, players, and other entities.
Steps
1. Target an entity — Use a selector, UUID, or reference to identify the entity you want to modify.
2. Retrieve its NBT compound — Call the API function to extract the entity's full NBT data.
3. Locate the tag you need — Browse the compound structure to find tags like Health, Motion, CustomName, or Attributes.
4. Edit the value — Change numbers, strings, or nested data as needed.
5. Write the NBT back — Apply the modified compound to the entity.
6. Verify changes — Observe the entity's behavior or use commands to confirm the update.
Common Use Cases
- Adjust mob attributes (speed, damage) without commands.
- Add persistent custom data to track entity state.
- Clone entity configurations by copying NBT between entities.
- Remove or reset unwanted tags to restore default behavior.