SerenityJS
    Preparing search index...

    Class ItemTypeComponentCollection

    Hierarchy

    • CompoundTag
      • ItemTypeComponentCollection
    Index

    Constructors

    Properties

    "[toStringTag]": string
    components: Map<string, ItemTypeComponent> = ...

    The component definitions of the item type.

    item: ItemType

    The type of item that the components are for.

    name: null | string

    The name of the nbt tag.

    size: number

    the number of elements in the Map.

    type: Compound = TagType.Compound

    The nbt tag type of the data type.

    "[species]": MapConstructor

    Methods

    • Returns an iterable of entries in the map.

      Returns MapIterator<[string, BaseTag]>

    • Add a single tag to the compound tag.

      Type Parameters

      • T extends BaseTag

      Parameters

      • tag: T

        The tag to add to the compound tag.

      Returns T

      The tag that was added.

    • Returns void

    • Parameters

      • key: string

      Returns boolean

      true if an element in the Map existed and has been removed, or false if the element does not exist.

    • Returns an iterable of key, value pairs for every entry in the map.

      Returns MapIterator<[string, BaseTag]>

    • Executes a provided function once per each key/value pair in the Map, in insertion order.

      Parameters

      • callbackfn: (value: BaseTag, key: string, map: Map<string, BaseTag>) => void
      • OptionalthisArg: any

      Returns void

    • Get a nbt tag by its key.

      Type Parameters

      • T extends BaseTag

      Parameters

      • key: string

        The key of the tag to retrieve.

      Returns undefined | T

      The tag associated with the key, or undefined if not found.

    • Parameters

      • key: string

      Returns boolean

      boolean indicating whether an element with the specified key exists or not.

    • Returns an iterable of keys in the map

      Returns MapIterator<string>

    • Add multiple tags to the compound tag.

      Type Parameters

      • T extends BaseTag

      Parameters

      • ...tags: T[]

        An array of tags to add.

      Returns this

      The current instance for method chaining.

    • Set a nbt tag with a specific key.

      Type Parameters

      • T extends BaseTag

      Parameters

      • key: string

        The key to associate with the tag.

      • value: T

        The tag to set.

      Returns this

      The current instance for method chaining.

    • Convert the tag to a JSON object.

      Returns Record<string, unknown>

    • Returns an iterable of values in the map

      Returns MapIterator<BaseTag>

    • Groups members of an iterable according to the return value of the passed callback.

      Type Parameters

      • K
      • T

      Parameters

      • items: Iterable<T>

        An iterable.

      • keySelector: (item: T, index: number) => K

        A callback which will be invoked for each item in items.

      Returns Map<K, T[]>

    • Read the nbt tag from the stream.

      Parameters

      • stream: BinaryStream

        The binary stream to read from.

      • Optionaloptions: ReadWriteOptions

        The options for reading the tag.

      Returns CompoundTag

    • Write the nbt tag to the stream.

      Parameters

      • stream: BinaryStream

        The binary stream to write to.

      • value: CompoundTag

        The value of the tag to write.

      • Optionaloptions: ReadWriteOptions

        The options for writing the tag.

      Returns void