Skip to content

Class StringNbt

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

Provides static methods for parsing string-NBT (SNBT) source text into a complete .

public static class StringNbt

Inheritance

objectStringNbt

Inherited Members

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

Methods

Parse(string)

Parse the given source text into a .

public static CompoundTag Parse(string source)

Parameters

source string

A string containing the SNBT code to parse.

Returns

CompoundTag

The instance described in the source text.

Exceptions

ArgumentNullException

When source is null.

SyntaxErrorException

When source is invalid SNBT code.

Parse(ReadOnlySpan<byte>, Encoding?)

Parse the given source text into a .

public static CompoundTag Parse(ReadOnlySpan<byte> source, Encoding? encoding = null)

Parameters

source ReadOnlySpan<byte>

A string containing the SNBT code to parse.

encoding Encoding?

Encoding of the source.

Returns

CompoundTag

The instance described in the source text.

Exceptions

ArgumentNullException

When source is null.

SyntaxErrorException

When source is invalid SNBT code.

ParseList(string)

Parse the given source text into a .

public static ListTag ParseList(string source)

Parameters

source string

A string containing the SNBT code to parse.

Returns

ListTag

The instance described in the source text.

Exceptions

ArgumentNullException

When source is null.

SyntaxErrorException

When source is invalid SNBT code.

ParseList(ReadOnlySpan<byte>, Encoding?)

Parse the given source text into a .

public static ListTag ParseList(ReadOnlySpan<byte> source, Encoding? encoding = null)

Parameters

source ReadOnlySpan<byte>

A string containing the SNBT code to parse.

encoding Encoding?

Encoding of the source.

Returns

ListTag

The instance described in the source text.

Exceptions

ArgumentNullException

When source is null.

SyntaxErrorException

When source is invalid SNBT code.