NbtTag class abstract

Represents the base of any NBT Tag.

Implementers

Constructors

NbtTag(String name, NbtTagType _nbtTagType)
Create a basic NbtTag with given nbtTagType. This shouldn't be used directly and please refer to implementations for all other nbt tags.

Properties

hashCode → int
The hash code for this object.
no setteroverride
hasLength → bool
If the tag is a List and has a length
no setter
hasValue → bool
If this tag directly has a value.
no setter
name ↔ String
The name of this tag. Inside of Lists or Arrays, this is 'None'.
getter/setter pair
nbtTagType → NbtTagType
The type of this tag.
no setter
parent ↔ NbtTag?
The parent of this tag. Can only be null for the root NbtCompound.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → dynamic
The value of this tag. Can vary depending on tag type, obtainable from nbtTagType.
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readTag(NbtReader nbtReader, {bool withName = true}) → NbtTag
Reads a NbtTag from fileReader. If the parent is a NbtList or NbtArray, withName should be set to false to avoid reading the name of this Tag.
toString() → String
A string representation of this object.
override
writeTag(NbtWriter nbtWriter, {bool withName = true, bool withType = true}) → void
Writes a NbtTag from fileReader. If the parent is a NbtList or NbtArray, withName should be set to false to avoid writing any names of this Tag.

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

readNewTag(NbtReader fileReader, NbtTag? parent, {bool withName = true}) → NbtTag?
Reads the next byte from the file and returns the parsed NbtTag corresponding to the read tag type.
readTagForType(NbtReader nbtReader, int tagType, {NbtTag? parent, bool withName = true}) → NbtTag?
Reads the Tag with type tagType. If inside a NbtList or NbtArray, withName should be set to false to avoid reading the name of this Tag.