A top-level NBT schema.

interface NBTSchema {
    $comment?: string;
    $fragment?: false;
    $id?: string;
    $ref?: string;
    $schema?: string;
    additionalItems?: NBTSubSchemaRef;
    additionalProperties?: NBTSubSchemaRef;
    allOf?: NBTSubSchemaRef[];
    allowComments?: boolean;
    allowTrailingCommas?: boolean;
    anyOf?: NBTSubSchemaRef[];
    const?: any;
    contains?: NBTSubSchemaRef;
    default?: {
        type:
            | "string"
            | "byte"
            | "short"
            | "int"
            | "float"
            | "double"
            | "long"
            | "list"
            | "compound"
            | "byteArray"
            | "shortArray"
            | "intArray"
            | "longArray";
        value: any;
    };
    defaultSnippets?: {
        body?: any;
        bodyText?: string;
        description?: string;
        label?: string;
        markdownDescription?: string;
    }[];
    definitions?: { [name: string]: NBTSchema };
    dependencies?: NBTSchemaMap | { [prop: string]: string[] };
    deprecationMessage?: string;
    description?: string;
    doNotSuggest?: boolean;
    else?: NBTSubSchemaRef;
    enum?: (
        | Byte
        | Short
        | Int
        | Long
        | Float
        | Double
        | String
        | List<TagType>
        | Compound
        | ByteArray
        | ShortArray
        | IntArray
        | LongArray
    )[];
    enumDescriptions?: string[];
    errorMessage?: string;
    examples?: (
        | Byte
        | Short
        | Int
        | Long
        | Float
        | Double
        | String
        | List<TagType>
        | Compound
        | ByteArray
        | ShortArray
        | IntArray
        | LongArray
    )[];
    exclusiveMaximum?: number | boolean;
    exclusiveMinimum?: number | boolean;
    format?: string;
    id: string;
    if?: NBTSubSchemaRef;
    items?: NBTSubSchemaRef | NBTSubSchemaRef[];
    markdownDescription?: string;
    markdownEnumDescriptions?: string[];
    maximum?: number;
    maxItems?: number;
    maxLength?: number;
    maxProperties?: number;
    minimum?: number;
    minItems?: number;
    minLength?: number;
    minProperties?: number;
    multipleOf?: number;
    not?: NBTSubSchemaRef;
    oneOf?: NBTSubSchemaRef[];
    pattern?: string;
    patternErrorMessage?: string;
    patternProperties?: NBTSchemaMap;
    patternPropertiesTS?: NBTSchemaMap;
    properties?: NBTSchemaMap;
    propertyNames?: NBTSubSchemaRef;
    required?: string[];
    suggestSortText?: string;
    then?: NBTSubSchemaRef;
    title?: string;
    type: "compound";
    uniqueItems?: boolean;
}

Hierarchy (View Summary)

Properties

$comment?: string
$fragment?: false

If this is a schema fragment.

A schema fragment is a top-level schema that is able to have types other than compound, but is only meant to be used inside of other schemas.

false
$id?: string

The ID of this schema.

$ref?: string

The ID of another schema to reference.

$schema?: string

The schema that this schema is based on.

additionalItems?: NBTSubSchemaRef
additionalProperties?: NBTSubSchemaRef

Whether additional properties are allowed, or a schema to use for them.

allOf?: NBTSubSchemaRef[]
allowComments?: boolean
allowTrailingCommas?: boolean
anyOf?: NBTSubSchemaRef[]
const?: any
contains?: NBTSubSchemaRef
default?: {
    type:
        | "string"
        | "byte"
        | "short"
        | "int"
        | "float"
        | "double"
        | "long"
        | "list"
        | "compound"
        | "byteArray"
        | "shortArray"
        | "intArray"
        | "longArray";
    value: any;
}

The default value for this schema.

defaultSnippets?: {
    body?: any;
    bodyText?: string;
    description?: string;
    label?: string;
    markdownDescription?: string;
}[]

Type declaration

  • Optionalbody?: any

    The body of this snippet.

  • OptionalbodyText?: string

    The body text of this snippet.

  • Optionaldescription?: string

    The description of this snippet.

  • Optionallabel?: string

    The label of this snippet.

  • OptionalmarkdownDescription?: string

    The markdown description of this snippet.

definitions?: { [name: string]: NBTSchema }
dependencies?: NBTSchemaMap | { [prop: string]: string[] }
deprecationMessage?: string
description?: string

The description of this schema.

doNotSuggest?: boolean
enum?: (
    | Byte
    | Short
    | Int
    | Long
    | Float
    | Double
    | String
    | List<TagType>
    | Compound
    | ByteArray
    | ShortArray
    | IntArray
    | LongArray
)[]

The values of this enum.

enumDescriptions?: string[]

Descriptions for each enum value, in the same order as NBTSubSchema.enum.

errorMessage?: string
examples?: (
    | Byte
    | Short
    | Int
    | Long
    | Float
    | Double
    | String
    | List<TagType>
    | Compound
    | ByteArray
    | ShortArray
    | IntArray
    | LongArray
)[]
exclusiveMaximum?: number | boolean
exclusiveMinimum?: number | boolean
format?: string
id: string

The ID of this schema.

markdownDescription?: string
markdownEnumDescriptions?: string[]
maximum?: number
maxItems?: number
maxLength?: number
maxProperties?: number
minimum?: number
minItems?: number
minLength?: number
minProperties?: number
multipleOf?: number
oneOf?: NBTSubSchemaRef[]
pattern?: string
patternErrorMessage?: string
patternProperties?: NBTSchemaMap

A map of RegExp patterns to the NBT schemas for the properties that match.

patternPropertiesTS?: NBTSchemaMap
properties?: NBTSchemaMap

The properties of this compound schema.

propertyNames?: NBTSubSchemaRef
required?: string[]
suggestSortText?: string
title?: string

The title of this schema.

type: "compound"

The type of NBT tag this schema describes.

uniqueItems?: boolean