UNPKG

minecraft-bedrock-json-types

Version:

Typescript types for Minecraft Bedrock's add-on json configuration files.

166 lines (165 loc) 4.51 kB
/** * This file was automatically generated by json-schema-to-typescript. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run json-schema-to-typescript to regenerate this file. */ /** * A version that tells minecraft what type of data format can be expected when reading this file. */ type FormatVersion = string; /** * The different scenes. * * @minItems 1 */ type Scenes = [Scene, ...(Scene)[]]; /** * This is where you can create buttons for your NPC. * * @maxItems 6 */ type Buttons = [] | [Button] | [Button, Button] | [Button, Button, Button] | [Button, Button, Button, Button] | [Button, Button, Button, Button, Button] | [Button, Button, Button, Button, Button, Button]; /** * Set the text that is going to be displayed on your NPC’s button. */ type Name = (string | RawText); /** * The key to translate. */ type Translate1 = string; /** * Specifies for the translator that additional text component needs to be inserted, this will cause the translator to look for variables in the translation text and replaced them with the corresponding 'With' text component. */ type With = (string | Rawtext1)[]; /** * The text to display. */ type Text1 = string; /** * The selector to target, for dialogue files, you can use @initiator. */ type Selector1 = string; /** * A selector, player name (can be fake), or * to target who is reading the message. */ type Selector2 = string; /** * The scoreboard objective to retrieve the value of. */ type Objective = string; /** * The raw text component, which consists of an array of text components. */ type Rawtext = (string | Translate | Text | Selector | Score)[]; /** * The commands to execute. */ type MinecraftCommand = string; /** * allows you to add commands which will be run in-game when the button is pressed. */ type Commands = MinecraftCommand[]; /** * This is where you can add or change a name for your NPC dialogue box. This is an optional property that is useful for dynamically changing NPC names. */ type NPCName = (string | RawText); /** * A minecraft command to execute. */ type MinecraftCommand1 = string; /** * This is where you can define which commands will fire when the NPC dialogue box closes. */ type OnCloseCommands = MinecraftCommand1[]; /** * A minecraft command to execute. */ type MinecraftCommand2 = string; /** * This is where you can define which commands will fire when the NPC dialogue box opens. */ type OnCloseCommands1 = MinecraftCommand2[]; /** * This is the name you will use to call this scene in-game. This is a required property. */ type SceneTag = string; /** * This is where you enter the dialogue you want your NPC to display in-game for this scene. You can type the dialogue text directly here or use raw text if you are using a language file. This is an optional property, but without it your NPC dialogue box will be empty. */ type Text2 = (string | RawText); /** * Specifies the dialogue scenes. */ export interface Dialogue { format_version: FormatVersion; "minecraft:npc_dialogue": NPCDialogue; } /** * Specifies the dialogue of an npc. */ interface NPCDialogue { scenes?: Scenes; } /** * A single scene specification. */ interface Scene { buttons?: Buttons; npc_name?: NPCName; on_close_commands?: OnCloseCommands; on_open_commands?: OnCloseCommands1; scene_tag: SceneTag; text?: Text2; } /** * This is where you can create buttons for your NPC. */ interface Button { name?: Name; commands?: Commands; } /** * A json structure that allows for translations, or go from scores and selectors to text. */ interface RawText { rawtext: Rawtext; } /** * A text component that will attempt to translate the given key through the languages files. */ interface Translate { translate: Translate1; with?: With; } /** * Specifies that this 'with' component needs to be processed. */ interface Rawtext1 { rawtext?: Rawtext; } /** * A simple text component, will display the text raw (without processing). */ interface Text { text: Text1; } /** * A text component that turns a selector into text, will usually display like: `Player1, Player2 and Player3`. */ interface Selector { selector: Selector1; } /** * A text component that grabs the score from an given target and turns its value of a specified score. */ interface Score { score: Score1; } /** * The score text component. */ interface Score1 { name: Selector2; objective: Objective; } export {};