Nbt

sealed class Nbt(source)

Instances of this class can encode values to Tags and decode Tags to values.

Inheritors

Types

Link copied to clipboard
object Default : Nbt

Properties

Link copied to clipboard
Link copied to clipboard
val serializersModule: SerializersModule

Functions

Link copied to clipboard
fun <T> decodeFromNbtElement(deserializer: DeserializationStrategy<T>, element: Tag): T
Link copied to clipboard
inline fun <T> Nbt.decodeFromNbtElement(element: Tag): T

Encodes the given element to an instance of the class T.

Link copied to clipboard
fun <T> encodeToNbtElement(serializer: SerializationStrategy<T>, value: T): Tag
Link copied to clipboard
inline fun <T> Nbt.encodeToNbtElement(value: T): Tag

Encodes the given value to an Tag. If the given value of the type T can be represented by a primitive NbtElement, such an element will be the result of this function. Otherwise, an net.minecraft.nbt.CompoundTag will be created.