Added dialogue schemas

This commit is contained in:
DaanV2
2021-06-15 19:12:47 +02:00
parent 2c6af7ef19
commit c5c135252a
5 changed files with 258 additions and 0 deletions

View File

@@ -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"
}
}
}
}
}
}
}
}

View File

@@ -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" } } }
]
}

View File

@@ -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" },

View File

@@ -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"
}
}
}

View File

@@ -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",