diff --git a/source/behavior/dialogue/1.14.0/dialogue.json b/source/behavior/dialogue/1.14.0/dialogue.json new file mode 100644 index 00000000..e488f450 --- /dev/null +++ b/source/behavior/dialogue/1.14.0/dialogue.json @@ -0,0 +1,93 @@ +{ + "$id": "blockception.minecraft.behavior.dialogue.1.14.0", + "type": "object", + "title": "NPC Dialogue", + "description": "UNDOCUMENTATED", + "additionalProperties": false, + "required": ["format_version", "minecraft:npc_dialogue"], + "properties": { + "format_version": { + "const": "1.14.0", + "description": "Specifies the version of the game this entity was made in. Minimum supported version is 1.14.0. Current supported version is 1.14.0.", + "title": "Format Version" + }, + "minecraft:npc_dialogue": { + "title": "NPC Dialogue", + "description": "", + "type": "object", + "additionalProperties": false, + "properties": { + "scenes": { + "title": "Scenes", + "description": "", + "type": "array", + "minItems": 1, + "items": { + "title": "Scene", + "description": "", + "type": "object", + "additionalProperties": false, + "properties": { + "buttons": { + "title": "Buttons", + "description": "", + "type": "array", + "maxItems": 6, + "items": { + "title": "Button", + "description": "", + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "title": "Name", + "description": "", + "$ref": "../../../general/rawtext/rawtext.json" + }, + "commands": { + "type": "array", + "description": "", + "title": "Commands", + "items": { + "title": "Minecraft Command", + "description": "", + "type": "string", + "pattern": "^/[a-z].*$" + } + } + } + } + }, + "npc_name": { + "title": "NPC Name", + "description": "", + "$ref": "../../../general/rawtext/rawtext.json" + }, + "on_close_commands": { + "type": "array", + "description": "", + "title": "On Close Commands", + "items": { + "title": "Minecraft Command", + "description": "", + "type": "string", + "pattern": "^/[a-z].*$" + } + }, + "scene_tag": { + "title": "Scene tag", + "description": "", + "type": "string" + }, + "text": { + "title": "Text", + "description": "", + "$ref": "../../../general/rawtext/rawtext.json" + } + } + } + } + } + } + } +} diff --git a/source/behavior/dialogue/dialogue.json b/source/behavior/dialogue/dialogue.json new file mode 100644 index 00000000..1fc6fea6 --- /dev/null +++ b/source/behavior/dialogue/dialogue.json @@ -0,0 +1,23 @@ +{ + "$id": "blockception.minecraft.behavior.feature_rules", + "examples": [ + { + "format_version": "1.14.0", + "minecraft:npc_dialogue": { + "scenes": [ + { + "scene_tag": "fast_travel", + "npc_name": { "rawtext": [{ "translate": "dialogue.guide.name" }] }, + "text": { "rawtext": [{ "translate": "dialogue.fast_travel.body", "with": ["\n"] }] }, + "buttons": [] + } + ] + } + } + ], + "allOf": [ + { "if": { "properties": { "format_version": { "type": "string", "const": "1.14.0" } } }, "then": { "$ref": "./1.14.0/dialogue.json" } }, + { "if": { "properties": { "format_version": { "type": "string", "const": "1.14" } } }, "then": { "$ref": "./1.14.0/dialogue.json" } }, + { "properties": { "format_version": { "$ref": "../../general/format_version.json" } } } + ] +} diff --git a/source/compress_specification.json b/source/compress_specification.json index 992fbb11..3fbdcfeb 100644 --- a/source/compress_specification.json +++ b/source/compress_specification.json @@ -34,6 +34,7 @@ }, { "Source": "./behavior/animations/animations.json", "Destination": "../behavior/animations/animations.json" }, { "Source": "./behavior/biomes/biomes.json", "Destination": "../behavior/biomes/biomes.json" }, + { "Source": "./behavior/dialogue/dialogue.json", "Destination": "../behavior/dialogue/dialogue.json" }, { "Source": "./behavior/loot_tables/loot_tables.json", "Destination": "../behavior/loot_tables/loot_tables.json" }, { "Source": "./behavior/blocks/blocks.json", "Destination": "../behavior/blocks/blocks.json" }, { "Source": "./behavior/entities/entities.json", "Destination": "../behavior/entities/entities.json" }, diff --git a/source/general/rawtext/rawtext.json b/source/general/rawtext/rawtext.json new file mode 100644 index 00000000..4278cf78 --- /dev/null +++ b/source/general/rawtext/rawtext.json @@ -0,0 +1,125 @@ +{ + "title": "RawText", + "description": "", + "type": "object", + "additionalProperties": false, + "required": ["rawtext"], + "definitions": { + "rawtext": { + "title": "Rawtext", + "description": "", + "type": "array", + "items": { + "oneOf": [ + { "type": "string" }, + { "$ref": "#/definitions/translate" }, + { "$ref": "#/definitions/text" }, + { "$ref": "#/definitions/selector" }, + { "$ref": "#/definitions/score" } + ] + } + }, + "selector": { + "title": "Selector", + "description": "", + "type": "object", + "additionalProperties": false, + "required": ["selector"], + "properties": { + "selector": { + "title": "Selector", + "description": "", + "type": "string", + "examples": ["@a", "@s", "@r", "@p", "@e", "@initiator"], + "pattern": "^@.*$" + } + } + }, + "score": { + "title": "Score", + "description": "", + "type": "object", + "additionalProperties": false, + "required": ["score"], + "properties": { + "score": { + "title": "Score", + "description": "", + "type": "object", + "additionalProperties": false, + "required": ["name", "objective"], + "properties": { + "name": { + "title": "Selector", + "description": "A selector, player name (can be fake), or *", + "type": "string", + "examples": ["@a", "@s", "@r", "@p", "@e", "@initiator", "*"] + }, + "objective": { + "title": "Objective", + "description": "", + "type": "string" + } + } + } + } + }, + "text": { + "title": "Text", + "description": "", + "type": "object", + "additionalProperties": false, + "required": ["text"], + "properties": { + "text": { + "title": "Text", + "description": "", + "type": "string" + } + } + }, + "translate": { + "title": "Translate", + "description": "", + "type": "object", + "additionalProperties": false, + "required": ["translate"], + "properties": { + "translate": { + "title": "Translate", + "description": "", + "type": "string" + }, + "with": { + "$ref": "#/definitions/with" + } + } + }, + "with": { + "title": "With", + "description": "", + "examples": ["\n", { "rawtext": [] }], + "items": { + "oneOf": [ + { "type": "string" }, + { + "title": "Rawtext", + "description": "", + "type": "object", + "additionalProperties": false, + "properties": { + "rawtext": { + "$ref": "#/definitions/rawtext" + } + } + } + ] + } + } + }, + "properties": { + "rawtext": { + "$ref": "#/definitions/rawtext" + } + } +} diff --git a/vscode-settings.json b/vscode-settings.json index 9f76b18f..4a6e1e6c 100644 --- a/vscode-settings.json +++ b/vscode-settings.json @@ -175,6 +175,22 @@ ], "url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/behavior/biomes/biomes.json" }, + { + "fileMatch": [ + "behavior_packs/*/dialogue/*.json", + "*behavior*pack*/dialogue/*.json", + "*Behavior*Pack*/dialogue/*.json", + "*BP*/dialogue/*.json", + "*bp*/dialogue/*.json", + "behavior_packs/*/dialogue/**/*.json", + "*behavior*pack*/dialogue/**/*.json", + "*Behavior*Pack*/dialogue/**/*.json", + "*BP*/dialogue/**/*.json", + "*bp*/dialogue/**/*.json", + "*.diag.json" + ], + "url": "https://raw.githubusercontent.com/Blockception/Minecraft-bedrock-json-schemas/main/behavior/dialogue/dialogue.json" + }, { "fileMatch": [ "behavior_packs/*/loot_tables/*.json",