Files
minecraft-bedrock-json-schemas/behaviour/trading/trading.json
2021-02-10 02:07:15 +01:00

724 lines
30 KiB
JSON

{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "blockception.minecraft.behaviour.trading",
"type": "object",
"additionalProperties": false,
"examples": [
{
"tiers": [
{
"trades": [{ "wants": [{ "item": "minecraft:coal:0", "quantity": { "min": 16, "max": 24 } }], "gives": [{ "item": "minecraft:emerald" }] }]
}
]
}
],
"definitions": {
"Item": {
"title": "Item",
"oneOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": false,
"properties": {
"item": { "type": "string", "title": "Item identifier" },
"price_multiplier": { "type": "number", "title": "Price multiplier" },
"quantity": {
"title": "Quantity",
"oneOf": [
{ "type": "integer", "minimum": 1, "title": "Amount" },
{
"type": "object",
"additionalProperties": false,
"required": ["min", "max"],
"properties": {
"min": { "type": "integer", "minimum": 1, "title": "Minimum" },
"max": { "type": "integer", "minimum": 1, "title": "Maximum" }
}
}
]
},
"functions": { "$ref": "#/definitions/Functions" }
}
}
]
},
"Functions": { "title": "Functions", "type": "array", "items": { "type": "object", "required": ["function"], "$ref": "#/definitions/A" } },
"TradeArray": {
"type": "array",
"title": "Trades",
"items": {
"additionalProperties": false,
"type": "object",
"title": "Trade",
"required": ["wants", "gives"],
"properties": {
"gives": {
"type": "array",
"title": "Gives",
"items": {
"title": "Give",
"oneOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": false,
"properties": {
"item": { "type": "string", "title": "Item identifier" },
"quantity": {
"title": "Quantity",
"oneOf": [
{ "type": "integer", "minimum": 1, "title": "Amount" },
{
"type": "object",
"additionalProperties": false,
"required": ["min", "max"],
"properties": {
"min": { "type": "integer", "minimum": 1, "title": "Minimum" },
"max": { "type": "integer", "minimum": 1, "title": "Maximum" }
}
}
]
},
"functions": { "$ref": "#/definitions/Functions" },
"choice": { "title": "Choice", "description": "TODO", "type": "array", "items": { "$ref": "#/definitions/Item" } }
}
}
]
}
},
"wants": {
"type": "array",
"title": "Wants",
"items": {
"title": "Want",
"oneOf": [
{ "type": "string" },
{
"type": "object",
"additionalProperties": false,
"properties": {
"item": { "type": "string", "title": "Item identifier" },
"quantity": {
"title": "Quantity",
"oneOf": [
{ "type": "integer", "minimum": 1, "title": "Amount" },
{
"type": "object",
"additionalProperties": false,
"required": ["min", "max"],
"properties": {
"min": { "type": "integer", "minimum": 1, "title": "Minimum" },
"max": { "type": "integer", "minimum": 1, "title": "Maximum" }
}
}
]
},
"price_multiplier": { "title": "Price multiplier", "description": "TODO", "type": "number" },
"functions": { "$ref": "#/definitions/Functions" },
"choice": { "title": "Choice", "description": "TODO", "type": "array", "items": { "$ref": "#/definitions/Item" } }
}
}
]
}
},
"trader_exp": { "type": "integer", "title": "Trader experience" },
"max_uses": { "type": "integer", "title": "Maximum uses" },
"reward_exp": { "type": "boolean", "title": "Reward experience" }
}
}
},
"B": {
"additionalProperties": false,
"description": "The function enchant_random_gear",
"title": "Enchant random gear",
"properties": {
"function": { "type": "string", "const": "enchant_random_gear", "title": "Function", "description": "TODO description" },
"chance": {
"type": "number",
"description": "Takes a chance modifier to manipulate the algorithm. Note that a chance modifier of 1.0 doesn't mean a 100% chance that gear will become enchanted.",
"title": "Chance"
}
}
},
"C": {
"additionalProperties": false,
"description": "The function enchant_book_for_trading",
"title": "Enchant book for trading",
"required": ["function", "base_cost", "base_random_cost", "per_level_random_cost", "per_level_cost"],
"properties": {
"function": { "type": "string", "const": "enchant_book_for_trading", "title": "Function", "description": "TODO description" },
"base_cost": { "type": "integer", "title": "Base cost", "description": "TODO description" },
"base_random_cost": { "type": "integer", "title": "Base cost", "description": "TODO description" },
"per_level_random_cost": { "type": "integer", "title": "Base cost", "description": "TODO description" },
"per_level_cost": { "type": "integer", "title": "Base cost", "description": "TODO description" }
}
},
"D": {
"additionalProperties": false,
"description": "The function enchant_randomly",
"title": "Enchant randomly",
"properties": {
"function": { "type": "string", "const": "enchant_randomly", "title": "Function", "description": "TODO description" },
"treasure": {
"type": "boolean",
"description": "Supports the optional treasure boolean (true/false) to allow treasure enchantments to be toggled on and off.",
"title": "Treasure"
}
}
},
"E": {
"additionalProperties": false,
"description": "The function enchant_with_levels",
"title": "Enchant with levels",
"properties": {
"function": { "type": "string", "const": "enchant_with_levels", "description": "TODO description", "title": "TODO title" },
"levels": {
"title": "Levels",
"oneOf": [
{ "type": "integer" },
{
"type": "object",
"additionalProperties": false,
"required": ["min", "max"],
"properties": { "min": { "type": "integer", "title": "Minimum" }, "max": { "type": "integer", "title": "Maximum" } }
}
],
"description": "TODO description"
},
"treasure": { "type": "boolean", "title": "Treasure", "description": "TODO description" }
}
},
"F": {
"additionalProperties": false,
"description": "The function exploration_map",
"title": "Exploration map",
"properties": {
"function": { "type": "string", "const": "exploration_map", "description": "TODO description", "title": "TODO title" },
"destination": {
"type": "string",
"description": "The destination value defines what type of treasure map they receive.",
"enum": [
"endcity",
"fortress",
"mineshaft",
"monument",
"ruins",
"stronghold",
"temple",
"village",
"mansion",
"shipwreck",
"buriedtreasure",
"pillageroutpost"
],
"title": "TODO title"
}
}
},
"G": {
"additionalProperties": false,
"description": "The function fill_container",
"title": "Fill container",
"properties": {
"function": { "type": "string", "const": "fill_container", "title": "Function", "description": "TODO description" },
"loot_table": { "type": "string", "title": "Loot table", "pattern": "^loot_tables/.*\\.json$", "description": "TODO description" }
}
},
"J": {
"type": "object",
"additionalProperties": false,
"description": "Returns true if the actor properties defined were executed.",
"title": "Entity properties",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "TODO" },
"entity": { "type": "string", "default": "this", "description": "The entity to test. The value must be only \"this\".", "title": "Entity" },
"properties": {
"type": "object",
"default": {},
"description": "The entity's properties. \"on_fire\", \"on_ground\" is used for now.",
"title": "Properties",
"additionalProperties": false,
"properties": {
"on_fire": { "title": "On fire", "description": "TODO", "type": "boolean" },
"on_ground": { "title": "On fire", "description": "TODO", "type": "boolean" }
}
}
}
},
"BA": {
"type": "object",
"additionalProperties": false,
"description": "Returns the condition true if the actor's mark variant is matched to the value.",
"title": "Has mark variant",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "TODO" },
"value": { "type": "integer", "default": "0", "description": "Tests for the actor's mark variant (if it has one)", "title": "Value" }
}
},
"BB": {
"type": "object",
"additionalProperties": false,
"description": "Returns the condition true if the actor of the loot table is killed by player or entities that has owner.",
"title": "Killed by player",
"properties": { "condition": { "type": "string", "title": "Condition", "description": "TODO" } }
},
"BC": {
"type": "object",
"additionalProperties": false,
"description": "Returns the condition true if the actor of the loot table is killed by player or entities that has owner.",
"title": "Killed by player or pets or pets",
"properties": { "condition": { "type": "string", "title": "Condition", "description": "TODO" } }
},
"BD": {
"type": "object",
"additionalProperties": false,
"description": "Sets a random chance of the specified value.",
"title": "Random chance",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "TODO" },
"chance": { "type": "number", "default": 0, "description": "TODO", "title": "Chance" },
"max_chance": { "type": "number", "default": 0, "description": "The maximum random chance value allowed.", "title": "Max chance" }
}
},
"BE": {
"type": "object",
"additionalProperties": false,
"description": "Sets a random chance of the specified value. Looting enchantment increase the random chance multiplier.",
"title": "Random chance with looting",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "TODO" },
"chance": { "type": "number", "default": 0, "description": "The random chance of the value.", "title": "Chance" },
"looting_multiplier": {
"type": "number",
"default": 0,
"description": "The multiplier for the chance if the target entity has the looting enchant that affects the actor.",
"title": "Looting multiplier"
}
}
},
"BF": {
"type": "object",
"additionalProperties": false,
"description": "Sets a random chance of the specified value based on the level difficulty.",
"title": "Random difficulty chance",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "TODO" },
"default_chance": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is not assigned.",
"title": "Default chance"
},
"easy": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in easy. Omitting this field will set the value to \"default_chance\" field.",
"title": "Easy"
},
"hard": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in hard. Omitting this field will set the value to \"default_chance\" field.",
"title": "Hard"
},
"normal": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in normal. Omitting this field will set the value to \"default_chance\" field.",
"title": "Normal"
},
"peaceful": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in peaceful. Omitting this field will set the value to \"default_chance\" field.",
"title": "Peaceful"
}
}
},
"BG": {
"type": "object",
"additionalProperties": false,
"description": "Sets a max regional difficulty random chance of the specified value.",
"title": "Random regional difficulty chance",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "TODO" },
"default_chance": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is not assigned.",
"title": "Default chance"
},
"max_chance": { "title": "Max chance", "type": "number", "description": "UNDOCUMENATED" },
"easy": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in easy. Omitting this field will set the value to \"default_chance\" field.",
"title": "Easy"
},
"hard": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in hard. Omitting this field will set the value to \"default_chance\" field.",
"title": "Hard"
},
"normal": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in normal. Omitting this field will set the value to \"default_chance\" field.",
"title": "Normal"
},
"peaceful": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is in peaceful. Omitting this field will set the value to \"default_chance\" field.",
"title": "Peaceful"
}
}
},
"I": {
"description": "A minecraft loot table condition",
"title": "Condition",
"allOf": [
{ "if": { "properties": { "condition": { "type": "string", "const": "entity_properties" } } }, "then": { "$ref": "#/definitions/J" } },
{ "if": { "properties": { "condition": { "type": "string", "const": "has_mark_variant" } } }, "then": { "$ref": "#/definitions/BA" } },
{ "if": { "properties": { "condition": { "type": "string", "const": "killed_by_player" } } }, "then": { "$ref": "#/definitions/BB" } },
{
"if": { "properties": { "condition": { "type": "string", "const": "killed_by_player_or_pets" } } },
"then": { "$ref": "#/definitions/BC" }
},
{ "if": { "properties": { "condition": { "type": "string", "const": "random_chance" } } }, "then": { "$ref": "#/definitions/BD" } },
{
"if": { "properties": { "condition": { "type": "string", "const": "random_chance_with_looting" } } },
"then": { "$ref": "#/definitions/BE" }
},
{
"if": { "properties": { "condition": { "type": "string", "const": "random_difficulty_chance" } } },
"then": { "$ref": "#/definitions/BF" }
},
{
"if": { "properties": { "condition": { "type": "string", "const": "random_regional_difficulty_chance" } } },
"then": { "$ref": "#/definitions/BG" }
}
]
},
"H": {
"additionalProperties": false,
"description": "The function furnace_smelt",
"title": "Furnace smelt",
"properties": {
"function": { "type": "string", "const": "furnace_smelt", "description": "TODO description", "title": "TODO title" },
"conditions": { "title": "Conditions", "description": "TODO", "type": "array", "items": { "$ref": "#/definitions/I" } }
}
},
"BH": {
"additionalProperties": false,
"description": "The function looting_enchant",
"title": "Looting enchant",
"properties": {
"function": { "type": "string", "const": "looting_enchant", "description": "TODO description", "title": "TODO title" },
"count": {
"type": "object",
"properties": { "min": { "type": "integer" }, "max": { "type": "integer" } },
"description": "TODO description",
"title": "TODO title",
"additionalProperties": false
}
}
},
"BI": {
"additionalProperties": false,
"description": "The function random_aux_value",
"title": "Random aux value",
"properties": {
"function": { "type": "string", "const": "random_aux_value", "description": "TODO description", "title": "TODO title" },
"values": {
"type": "object",
"properties": { "min": { "type": "integer" }, "max": { "type": "integer" } },
"description": "TODO description",
"title": "TODO title",
"additionalProperties": false
}
}
},
"BJ": {
"additionalProperties": false,
"description": "The function random_block_state",
"title": "Random block state",
"properties": {
"function": { "type": "string", "const": "random_block_state", "description": "TODO description", "title": "TODO title" },
"block_state": { "type": "string", "description": "TODO description", "title": "TODO title" },
"values": {
"type": "object",
"properties": { "min": { "title": "Min", "type": "integer" }, "max": { "title": "Max", "type": "integer" } },
"description": "TODO description",
"title": "TODO title",
"additionalProperties": false
}
}
},
"CA": {
"additionalProperties": false,
"description": "The function set_actor_id",
"title": "Set actor id",
"properties": {
"function": { "type": "string", "const": "set_actor_id", "description": "TODO description", "title": "TODO title" },
"id": { "type": "string", "description": "TODO description", "title": "TODO title" }
}
},
"CB": {
"additionalProperties": false,
"description": "The function set_banner_details",
"title": "Set banner details",
"properties": {
"function": { "type": "string", "const": "set_banner_details", "description": "TODO description", "title": "TODO title" },
"type": { "type": "integer", "description": "TODO description", "title": "TODO title" }
}
},
"CC": {
"additionalProperties": false,
"description": "The function set_book_contents",
"title": "Set book contents",
"required": ["function", "author", "title", "pages"],
"properties": {
"function": { "type": "string", "const": "set_book_contents", "description": "TODO description", "title": "TODO title" },
"author": { "type": "string", "description": "TODO description", "title": "TODO title" },
"title": { "type": "string", "description": "TODO description", "title": "TODO title" },
"pages": {
"type": "array",
"items": { "type": "string", "examples": ["Some text", "{\"rawtext\":[ {\"translate\":\"some.text\"}]}"] },
"description": "TODO description",
"title": "TODO title"
}
}
},
"CD": {
"additionalProperties": false,
"description": "The function set_count",
"title": "Set count",
"properties": {
"function": { "type": "string", "const": "set_count", "title": "Function", "description": "TODO description" },
"count": {
"title": "Count",
"oneOf": [
{ "type": "integer" },
{ "type": "object", "properties": { "min": { "type": "integer", "title": "Minimum" }, "max": { "type": "integer", "title": "Maximum" } } }
],
"description": "TODO description"
}
}
},
"CE": {
"additionalProperties": false,
"description": "The function set_damage",
"title": "Set damage",
"properties": {
"function": { "type": "string", "const": "set_damage", "description": "TODO description", "title": "TODO title" },
"damage": {
"oneOf": [
{ "type": "integer" },
{ "type": "object", "properties": { "min": { "type": "integer" }, "max": { "type": "integer" } } },
{ "type": "object", "properties": { "min": { "type": "number" }, "max": { "type": "number" } } }
],
"description": "TODO description",
"title": "TODO title"
}
}
},
"CF": {
"additionalProperties": false,
"description": "The function set_data",
"title": "Set data",
"properties": {
"function": { "type": "string", "const": "set_data", "description": "TODO description", "title": "TODO title" },
"data": {
"title": "Data",
"oneOf": [
{ "type": "integer" },
{ "type": "object", "properties": { "min": { "type": "integer", "title": "Minimum" }, "max": { "type": "integer", "title": "Maximum" } } }
],
"description": "TODO description"
}
}
},
"CG": {
"additionalProperties": false,
"description": "The function set_data_from_color_index",
"title": "Set data from color index",
"properties": {
"function": { "type": "string", "const": "set_data_from_color_index", "description": "TODO description", "title": "TODO title" }
}
},
"CH": {
"additionalProperties": false,
"description": "The function trader_material_type",
"title": "Trader material type",
"properties": { "function": { "type": "string", "const": "trader_material_type", "description": "TODO description", "title": "TODO title" } }
},
"CI": {
"additionalProperties": false,
"description": "The function random_dye",
"title": "Trader material type",
"properties": { "function": { "type": "string", "const": "random_dye", "description": "TODO description", "title": "TODO title" } }
},
"CJ": {
"additionalProperties": false,
"description": "The function set_lore",
"title": "Set lore",
"properties": {
"function": { "type": "string", "const": "set_lore", "description": "TODO description", "title": "TODO title" },
"lore": { "type": "array", "items": { "type": "string" }, "description": "TODO description", "title": "TODO title" }
}
},
"DA": {
"additionalProperties": false,
"description": "The function set_name",
"title": "Set name",
"properties": {
"function": { "type": "string", "const": "set_name", "description": "TODO description", "title": "TODO title" },
"name": { "type": "string", "description": "TODO description", "title": "TODO title" }
}
},
"DB_IDEnchant": {
"type": "string",
"title": "ID enchantment",
"enum": [
"aqua_affinity",
"bane_of_arthropods",
"blast_protection",
"channeling",
"curse_of_binding",
"curse_of_vanishing",
"depth_strider",
"efficiency",
"feather_falling",
"fire_aspect",
"fire_protection",
"flame",
"fortune",
"frost_walker",
"impaling",
"infinity",
"knockback",
"looting",
"loyalty",
"luck_of_the_sea",
"lure",
"mending",
"multishot",
"piercing",
"projectile_protection",
"protection",
"punch",
"quick_charge",
"respiration",
"riptide",
"sharpness",
"silk_touch",
"smite",
"soul_speed",
"thorns",
"unbreaking"
]
},
"DB_Enchant": {
"type": "object",
"title": "Enchantment",
"additionalProperties": false,
"properties": {
"id": { "$ref": "#/definitions/DB_IDEnchant" },
"level": {
"title": "Level",
"oneOf": [
{ "type": "integer", "title": "Level" },
{
"type": "array",
"items": [
{ "type": "integer", "title": "Min" },
{ "type": "integer", "title": "Max" }
]
}
]
}
}
},
"DB": {
"additionalProperties": false,
"description": "The function specific_enchants",
"title": "Specific enchants",
"properties": {
"function": { "type": "string", "const": "specific_enchants", "description": "Specific enchants", "title": "Specific enchants" },
"enchants": {
"title": "Enchants",
"description": "A enchanting specification",
"oneOf": [
{ "type": "string", "$ref": "#/definitions/DB_IDEnchant" },
{ "type": "object", "$ref": "#/definitions/DB_Enchant" },
{ "type": "array", "items": { "$ref": "#/definitions/DB_Enchant" } }
]
}
}
},
"A": {
"description": "A minecraft loot table condition",
"title": "Functions",
"allOf": [
{ "if": { "properties": { "function": { "type": "string", "const": "enchant_random_gear" } } }, "then": { "$ref": "#/definitions/B" } },
{ "if": { "properties": { "function": { "type": "string", "const": "enchant_book_for_trading" } } }, "then": { "$ref": "#/definitions/C" } },
{ "if": { "properties": { "function": { "type": "string", "const": "enchant_randomly" } } }, "then": { "$ref": "#/definitions/D" } },
{ "if": { "properties": { "function": { "type": "string", "const": "enchant_with_levels" } } }, "then": { "$ref": "#/definitions/E" } },
{ "if": { "properties": { "function": { "type": "string", "const": "exploration_map" } } }, "then": { "$ref": "#/definitions/F" } },
{ "if": { "properties": { "function": { "type": "string", "const": "fill_container" } } }, "then": { "$ref": "#/definitions/G" } },
{ "if": { "properties": { "function": { "type": "string", "const": "furnace_smelt" } } }, "then": { "$ref": "#/definitions/H" } },
{ "if": { "properties": { "function": { "type": "string", "const": "looting_enchant" } } }, "then": { "$ref": "#/definitions/BH" } },
{ "if": { "properties": { "function": { "type": "string", "const": "random_aux_value" } } }, "then": { "$ref": "#/definitions/BI" } },
{ "if": { "properties": { "function": { "type": "string", "const": "random_block_state" } } }, "then": { "$ref": "#/definitions/BJ" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_actor_id" } } }, "then": { "$ref": "#/definitions/CA" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_banner_details" } } }, "then": { "$ref": "#/definitions/CB" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_book_contents" } } }, "then": { "$ref": "#/definitions/CC" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_count" } } }, "then": { "$ref": "#/definitions/CD" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_damage" } } }, "then": { "$ref": "#/definitions/CE" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_data" } } }, "then": { "$ref": "#/definitions/CF" } },
{
"if": { "properties": { "function": { "type": "string", "const": "set_data_from_color_index" } } },
"then": { "$ref": "#/definitions/CG" }
},
{ "if": { "properties": { "function": { "type": "string", "const": "trader_material_type" } } }, "then": { "$ref": "#/definitions/CH" } },
{ "if": { "properties": { "function": { "type": "string", "const": "random_dye" } } }, "then": { "$ref": "#/definitions/CI" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_lore" } } }, "then": { "$ref": "#/definitions/CJ" } },
{ "if": { "properties": { "function": { "type": "string", "const": "set_name" } } }, "then": { "$ref": "#/definitions/DA" } },
{ "if": { "properties": { "function": { "type": "string", "const": "specific_enchants" } } }, "then": { "$ref": "#/definitions/DB" } }
]
}
},
"properties": {
"tiers": {
"type": "array",
"title": "Tiers",
"description": "A collection of tiers",
"items": {
"additionalProperties": false,
"type": "object",
"title": "Tier",
"properties": {
"trades": { "$ref": "#/definitions/TradeArray" },
"total_exp_required": { "title": "Total experience required", "type": "integer" },
"groups": {
"type": "array",
"title": "Groups",
"description": "A collection of groups",
"items": {
"type": "object",
"title": "Group",
"additionalProperties": false,
"properties": { "num_to_select": { "title": "Number to select", "type": "integer" }, "trades": { "$ref": "#/definitions/TradeArray" } }
}
}
}
}
}
},
"description": "TODO description",
"title": "TODO title"
}