Skip to content

Class NbtTag

Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll

public abstract record NbtTag : IEquatable<NbtTag>

Inheritance

objectNbtTag

Derived

NbtByte, NbtByteArray, NbtCompound, NbtDouble, NbtEnd, NbtFloat, NbtInt, NbtIntArray, NbtList, NbtLong, NbtLongArray, NbtShort, NbtString, NbtTag<T>

Implements

IEquatable<NbtTag>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

Name

public string? Name { get; set; }

Property Value

string?

Type

public NbtTagType Type { get; }

Property Value

NbtTagType

Methods

AsJsonNode()

public JsonNode AsJsonNode()

Returns

JsonNode

AsStream(NbtFormatOptions, bool)

public MemoryStream AsStream(NbtFormatOptions formatOptions = NbtFormatOptions.BigEndian, bool writeName = true)

Parameters

formatOptions NbtFormatOptions

writeName bool

Returns

MemoryStream

Parse(string)

public static NbtTag Parse(string data)

Parameters

data string

Returns

NbtTag

Parse(ReadOnlyMemory<byte>, out NbtTag, bool, NbtFormatOptions)

public static long Parse(ReadOnlyMemory<byte> data, out NbtTag result, bool readName = true, NbtFormatOptions formatOptions = NbtFormatOptions.BigEndian)

Parameters

data ReadOnlyMemory<byte>

result NbtTag

readName bool

formatOptions NbtFormatOptions

Returns

long

Parse<T>(ReadOnlyMemory<byte>, out T, bool, NbtFormatOptions)

public static long Parse<T>(ReadOnlyMemory<byte> data, out T result, bool readName = true, NbtFormatOptions formatOptions = NbtFormatOptions.BigEndian) where T : NbtTag

Parameters

data ReadOnlyMemory<byte>

result T

readName bool

formatOptions NbtFormatOptions

Returns

long

Type Parameters

T

ReadFrom<TBuffer>(ref TBuffer, bool)

public static NbtTag ReadFrom<TBuffer>(ref TBuffer buffer, bool readName = true) where TBuffer : struct, IMinecraftBuffer<TBuffer>, allows ref struct

Parameters

buffer TBuffer

readName bool

Returns

NbtTag

Type Parameters

TBuffer

ToSnbt()

protected string ToSnbt()

Returns

string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

implicit operator NbtTag(Tag)

public static implicit operator NbtTag(Tag tag)

Parameters

tag Tag

Returns

NbtTag

implicit operator Tag(NbtTag)

public static implicit operator Tag(NbtTag tag)

Parameters

tag NbtTag

Returns

Tag