---
title: NBTData -
---
//[KSpigot](../../index.md)/[net.axay.kspigot.data](../index.md)/[NBTData](index.md)
# NBTData
[jvm] class [NBTData](index.md)
## Constructors
| Name| Summary|
|---|---|
| [NBTData](-n-b-t-data.md)| [jvm] fun [NBTData](-n-b-t-data.md)(nbtTagCompound: NBTTagCompound?)
| [NBTData](-n-b-t-data.md)| [jvm] fun [NBTData](-n-b-t-data.md)()
| [NBTData](-n-b-t-data.md)| [jvm] fun [NBTData](-n-b-t-data.md)(nbtString: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
## Types
| Name| Summary|
|---|---|
| [Companion](-companion/index.md)| [jvm]
Content
object [Companion](-companion/index.md)
## Functions
| Name| Summary|
|---|---|
| [equals](../../net.axay.kspigot.utils/-registerable-command/index.md#kotlin/Any/equals/#kotlin.Any?/PointingToDeclaration/)| [jvm]
Content
open operator override fun [equals](../../net.axay.kspigot.utils/-registerable-command/index.md#kotlin/Any/equals/#kotlin.Any?/PointingToDeclaration/)(other: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
| [get](get.md)| [jvm]
Brief description
This method gets the value at the given key. The returned dataType must be specified. The returned value is null, if it was not possible to find any value at the specified location, or if the type is not the one which was specified.
Content
operator fun <[T](get.md)> [get](get.md)(key: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), dataType: [NBTDataType](../-n-b-t-data-type/index.md)<[T](get.md)>): [T](get.md)?
| [hashCode](../../net.axay.kspigot.utils/-registerable-command/index.md#kotlin/Any/hashCode/#/PointingToDeclaration/)| [jvm]
Content
open override fun [hashCode](../../net.axay.kspigot.utils/-registerable-command/index.md#kotlin/Any/hashCode/#/PointingToDeclaration/)(): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)
| [minusAssign](minus-assign.md)| [jvm]
Content
operator fun [minusAssign](minus-assign.md)(key: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
| [remove](remove.md)| [jvm]
Brief description
This method removes the given key from the NBTTagCompound. Its value will be lost.
Content
fun [remove](remove.md)(key: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html))
| [serialize](serialize.md)| [jvm]
Content
fun [serialize](serialize.md)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
| [set](set.md)| [jvm]
Brief description
This method sets some value at the position of the given key. The dataType of the given value must be specified.
Content
operator fun <[T](set.md)> [set](set.md)(key: [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html), dataType: [NBTDataType](../-n-b-t-data-type/index.md)<[T](set.md)>, value: [T](set.md))
| [toString](../../net.axay.kspigot.utils/-registerable-command/index.md#kotlin/Any/toString/#/PointingToDeclaration/)| [jvm]
Content
open override fun [toString](../../net.axay.kspigot.utils/-registerable-command/index.md#kotlin/Any/toString/#/PointingToDeclaration/)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
## Properties
| Name| Summary|
|---|---|
| [nbtTagCompound](index.md#net.axay.kspigot.data/NBTData/nbtTagCompound/#/PointingToDeclaration/)| [jvm] val [nbtTagCompound](index.md#net.axay.kspigot.data/NBTData/nbtTagCompound/#/PointingToDeclaration/): NBTTagCompound