Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft

NBT API Plugin FAQ

10 questions players actually ask, answered.

How do I start using NBT API Plugin?
Load the plugin on your server, then begin by importing the NBT API classes into your project. The plugin provides utility methods to access NBT data from items and entities—start with the guides on reading and modifying NBT data to understand the basic workflow.
Can I use this plugin with my existing plugins?
Yes, NBT API Plugin is designed to work alongside other plugins without conflicts. It provides a stable API that other plugins can depend on, so you can safely add it to servers running multiple plugins.
What's the difference between NBT compounds and NBT lists?
Compounds are key-value pairs (like a map) that store related data together, while lists are ordered collections of the same data type. Use compounds for structured data like item enchantments, and lists for variable-length collections like inventory slots.
How do I add custom NBT tags to an item in my hand?
Get the item from the player's hand, access its NBT compound using the API, and use the set methods to add your custom tags with appropriate data types. See the 'Create a Custom Item with NBT Tags' guide for a complete example.
Will using this plugin slow down my server?
The plugin is performance-optimized and should have minimal impact on server performance. However, frequently reading or writing NBT data on many entities at once can add overhead—batch operations and avoid running NBT checks every tick if possible.
How do I check if an entity has a specific NBT tag?
Use the API's hasKey() or contains() method on the entity's NBT compound to check for tag existence before attempting to read it. This prevents errors and is useful for conditional logic in your code.
Can I modify NBT data on mobs or only on items?
You can modify NBT data on both items and entities, including mobs. The 'Read and Modify Entity NBT Data' guide covers how to access and change mob properties like health, custom names, and AI behavior through NBT.
What should I do if my NBT changes aren't showing up in-game?
Make sure you're calling the update or apply method after modifying NBT data—changes don't take effect until the data is written back to the item or entity. Use the debugging guide to inspect the actual NBT values and confirm your changes were saved.
How do I work with deeply nested NBT data?
Use the compound navigation methods provided by the API to traverse nested structures step-by-step, or use path-based access if available. The 'Work with Nested NBT Compounds and Lists' guide shows how to safely access data multiple levels deep.
Is there a way to see what NBT tags an item actually has?
Yes—use the debugging and inspection tools provided by the plugin to view all NBT data on an item or entity in a readable format. This is essential for troubleshooting and understanding what tags are already present before making changes.