Class TagBuilder
Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll
Provides a mechanism for easily building a tree of NBT objects by handling the intermediate step of creating tags, allowing the direct adding of their equivalent values.
All methods return the
public class TagBuilderInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
TagBuilder(string?)
Creates a new instance of the name to assign the top-level
public TagBuilder(string? name = null)Parameters
name string?
Properties
Depth
Gets the zero-based depth of the current node, indicating how deeply nested it is within other tags.
public int Depth { get; }Property Value
Remarks
The implicit top-level
Methods
AddBool(string?, bool)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddBool(string? name, bool value)Parameters
name string?
The name of the node to add.
value bool
The value of the tag.
Returns
Returns this
AddBool(bool)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddBool(bool value)Parameters
value bool
The value of the tag.
Returns
Returns this
AddByte(string?, byte)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddByte(string? name, byte value)Parameters
name string?
The name of the node to add.
value byte
The value of the tag.
Returns
Returns this
AddByte(string?, int)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddByte(string? name, int value)Parameters
name string?
The name of the node to add.
value int
The value of the tag.
Returns
Returns this
AddByte(string?, sbyte)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddByte(string? name, sbyte value)Parameters
name string?
The name of the node to add.
value sbyte
The value of the tag.
Returns
Returns this
AddByte(byte)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddByte(byte value)Parameters
value byte
The value of the tag.
Returns
Returns this
AddByte(int)
public TagBuilder AddByte(int value)Parameters
value int
Returns
AddByte(sbyte)
public TagBuilder AddByte(sbyte value)Parameters
value sbyte
Returns
AddByteArray(string?, params byte[])
Adds a new values to the tree at the current depth.
public TagBuilder AddByteArray(string? name, params byte[] values)Parameters
name string?
The name of the node to add.
values byte[]
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(string?, IEnumerable<byte>)
Adds a new values to the tree at the current depth.
public TagBuilder AddByteArray(string? name, IEnumerable<byte> values)Parameters
name string?
The name of the node to add.
values IEnumerable<byte>
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(params byte[])
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddByteArray(params byte[] values)Parameters
values byte[]
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(IEnumerable<byte>)
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddByteArray(IEnumerable<byte> values)Parameters
values IEnumerable<byte>
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(string?, params sbyte[])
Adds a new values to the tree at the current depth.
public TagBuilder AddByteArray(string? name, params sbyte[] values)Parameters
name string?
The name of the node to add.
values sbyte[]
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(string?, IEnumerable<sbyte>)
Adds a new values to the tree at the current depth.
public TagBuilder AddByteArray(string? name, IEnumerable<sbyte> values)Parameters
name string?
The name of the node to add.
values IEnumerable<sbyte>
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(params sbyte[])
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddByteArray(params sbyte[] values)Parameters
values sbyte[]
The value(s) that will be included in the tag.
Returns
Returns this
AddByteArray(IEnumerable<sbyte>)
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddByteArray(IEnumerable<sbyte> values)Parameters
values IEnumerable<sbyte>
The value(s) that will be included in the tag.
Returns
Returns this
AddDouble(string?, double)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddDouble(string? name, double value)Parameters
name string?
The name of the node to add.
value double
The value of the tag.
Returns
Returns this
AddDouble(double)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddDouble(double value)Parameters
value double
The value of the tag.
Returns
Returns this
AddFloat(string?, float)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddFloat(string? name, float value)Parameters
name string?
The name of the node to add.
value float
The value of the tag.
Returns
Returns this
AddFloat(float)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddFloat(float value)Parameters
value float
The value of the tag.
Returns
Returns this
AddInt(string?, int)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddInt(string? name, int value)Parameters
name string?
The name of the node to add.
value int
The value of the tag.
Returns
Returns this
AddInt(string?, uint)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddInt(string? name, uint value)Parameters
name string?
The name of the node to add.
value uint
The value of the tag.
Returns
Returns this
AddInt(int)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddInt(int value)Parameters
value int
The value of the tag.
Returns
Returns this
AddInt(uint)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddInt(uint value)Parameters
value uint
The value of the tag.
Returns
Returns this
AddIntArray(string?, params int[])
Adds a new values to the tree at the current depth.
public TagBuilder AddIntArray(string? name, params int[] values)Parameters
name string?
The name of the node to add.
values int[]
The value(s) that will be included in the tag.
Returns
Returns this
AddIntArray(string?, IEnumerable<int>)
Adds a new values to the tree at the current depth.
public TagBuilder AddIntArray(string? name, IEnumerable<int> values)Parameters
name string?
The name of the node to add.
values IEnumerable<int>
The value(s) that will be included in the tag.
Returns
Returns this
AddIntArray(params int[])
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddIntArray(params int[] values)Parameters
values int[]
The value(s) that will be included in the tag.
Returns
Returns this
AddIntArray(IEnumerable<int>)
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddIntArray(IEnumerable<int> values)Parameters
values IEnumerable<int>
The value(s) that will be included in the tag.
Returns
Returns this
AddLong(string?, long)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddLong(string? name, long value)Parameters
name string?
The name of the node to add.
value long
The value of the tag.
Returns
Returns this
AddLong(string?, ulong)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddLong(string? name, ulong value)Parameters
name string?
The name of the node to add.
value ulong
The value of the tag.
Returns
Returns this
AddLong(long)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddLong(long value)Parameters
value long
The value of the tag.
Returns
Returns this
AddLong(ulong)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddLong(ulong value)Parameters
value ulong
The value of the tag.
Returns
Returns this
AddLongArray(string?, params long[])
Adds a new values to the tree at the current depth.
public TagBuilder AddLongArray(string? name, params long[] values)Parameters
name string?
The name of the node to add.
values long[]
The value(s) that will be included in the tag.
Returns
Returns this
AddLongArray(string?, IEnumerable<long>)
Adds a new values to the tree at the current depth.
public TagBuilder AddLongArray(string? name, IEnumerable<long> values)Parameters
name string?
The name of the node to add.
values IEnumerable<long>
The value(s) that will be included in the tag.
Returns
Returns this
AddLongArray(params long[])
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddLongArray(params long[] values)Parameters
values long[]
The value(s) that will be included in the tag.
Returns
Returns this
AddLongArray(IEnumerable<long>)
Adds a new unnamed values to the tree at the current depth.
public TagBuilder AddLongArray(IEnumerable<long> values)Parameters
values IEnumerable<long>
The value(s) that will be included in the tag.
Returns
Returns this
AddShort(string?, short)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddShort(string? name, short value)Parameters
name string?
The name of the node to add.
value short
The value of the tag.
Returns
Returns this
AddShort(string?, int)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddShort(string? name, int value)Parameters
name string?
The name of the node to add.
value int
The value of the tag.
Returns
Returns this
AddShort(string?, ushort)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddShort(string? name, ushort value)Parameters
name string?
The name of the node to add.
value ushort
The value of the tag.
Returns
Returns this
AddShort(short)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddShort(short value)Parameters
value short
The value of the tag.
Returns
Returns this
AddShort(int)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddShort(int value)Parameters
value int
The value of the tag.
Returns
Returns this
AddShort(ushort)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddShort(ushort value)Parameters
value ushort
The value of the tag.
Returns
Returns this
AddString(string?, string?)
Adds a new name and value to the tree at the current depth.
public TagBuilder AddString(string? name, string? value)Parameters
name string?
The name of the node to add.
value string?
The value of the tag.
Returns
AddString(string?)
Adds a new unnamed value to the tree at the current depth.
public TagBuilder AddString(string? value)Parameters
value string?
The value of the tag.
Returns
Returns this
AddTag(Tag)
Adds an existing
public TagBuilder AddTag(Tag tag)Parameters
tag Tag
The
Returns
Returns this
Exceptions
Thrown if adding to a
Thrown when tag is null.
BeginCompound(string?)
Opens a new
public TagBuilder BeginCompound(string? name = null)Parameters
name string?
The name to apply to the
Returns
Returns this
See Also
BeginList(TagType, string?)
Opens a new
public TagBuilder BeginList(TagType childType, string? name = null)Parameters
childType TagType
The
name string?
The name to apply to the
Returns
Returns this
See Also
Create()
Closes any open compound/list sections, and returns the result as a
public CompoundTag Create()Returns
A
Remarks
Invoking this method moves the current
End()
Closes the current
public TagBuilder End()Returns
Returns this
Remarks
This method does nothing if the current location is already at the top-level.
EndCompound()
Closes the current
public TagBuilder EndCompound()Returns
Returns this
See Also
TagBuilder.BeginCompound(string?)
EndList()
Closes the current
public TagBuilder EndList()Returns
Returns this
See Also
TagBuilder.BeginList(TagType, string?)
NewCompound(string?)
Creates a new
public TagBuilder.Context NewCompound(string? name)Parameters
name string?
The name to apply to the
Returns
A
Remarks
This is essentially no different than using blocks to distinguish scope.
NewList(TagType, string?)
Creates a new
public TagBuilder.Context NewList(TagType childType, string? name)Parameters
childType TagType
The
name string?
The name to apply to the
Returns
A
Remarks
This is essentially no different than using blocks to distinguish scope.