# NBTHelpers

Lets scripts distinguish numbers, lists, and compounds in NBT data through the `NBTHelpers` global.  
 `List` includes array-tag helpers; string tags have no separate helper class.  
 ```js
const player = Player.getPlayer();  
if (player !== null) {
  const tag = player.getNBT();  
  if (tag instanceof NBTHelpers.Compound) {
    Chat.log(tag.getKeys());  
  }
}
 ```

These names are available in JavaScript and Python without importing anything. They are read-only aliases of Java types, so `instanceof` works as usual.

| Script name | What it is |
| --- | --- |
| [`NBTHelpers.Compound`](/2.3.0/1.21.10/classes/com/jsmacrosce/jsmacros/client/api/helper/NBTElementHelper.NBTCompoundHelper.md) | Wraps a compound tag and provides access to its keys and values. |
| [`NBTHelpers.Element`](/2.3.0/1.21.10/classes/com/jsmacrosce/jsmacros/client/api/helper/NBTElementHelper.md) | Wraps an NBT tag and provides type checks, typed helper views, and path lookup. |
| [`NBTHelpers.List`](/2.3.0/1.21.10/classes/com/jsmacrosce/jsmacros/client/api/helper/NBTElementHelper.NBTListHelper.md) | Provides indexed access to list and array tags, and converts four-int arrays to UUIDs. |
| [`NBTHelpers.Number`](/2.3.0/1.21.10/classes/com/jsmacrosce/jsmacros/client/api/helper/NBTElementHelper.NBTNumberHelper.md) | Wraps a numeric tag and provides conversions to primitive numeric types. |

