Update loot table schemas (#391)

* update loot table schemas

* remove entity_properties and use new int_or_range definition

* remove entity_properties from conditions.json as well
This commit is contained in:
Piotr Brzozowski
2025-10-15 19:48:05 +02:00
committed by GitHub
parent 1f04c737cd
commit cbd0262612
19 changed files with 255 additions and 106 deletions

View File

@@ -4,8 +4,36 @@
"title": "Condition",
"allOf": [
{
"if": { "properties": { "condition": { "type": "string", "const": "entity_properties" } } },
"then": { "$ref": "./conditions/entity_properties.json" }
"if": { "properties": { "condition": { "const": "has_mark_variant" } } },
"then": { "$ref": "./conditions/has_mark_variant.json" }
},
{
"if": { "properties": { "condition": { "const": "has_variant" } } },
"then": { "$ref": "./conditions/has_variant.json" }
},
{
"if": { "properties": { "condition": { "const": "has_property" } } },
"then": { "$ref": "./conditions/has_property.json" }
},
{
"if": { "properties": { "condition": { "const": "bool_property" } } },
"then": { "$ref": "./conditions/bool_property.json" }
},
{
"if": { "properties": { "condition": { "const": "int_property" } } },
"then": { "$ref": "./conditions/int_property.json" }
},
{
"if": { "properties": { "condition": { "const": "float_property" } } },
"then": { "$ref": "./conditions/float_property.json" }
},
{
"if": { "properties": { "condition": { "const": "enum_property" } } },
"then": { "$ref": "./conditions/enum_property.json" }
},
{
"if": { "properties": { "condition": { "const": "match_tool" } } },
"then": { "$ref": "./conditions/match_tool.json" }
},
{
"if": { "properties": { "condition": { "type": "string", "const": "has_mark_variant" } } },
@@ -31,6 +59,10 @@
"if": { "properties": { "condition": { "type": "string", "const": "damaged_by_entity" } } },
"then": { "$ref": "./conditions/damaged_by_entity.json" }
},
{
"if": { "properties": { "condition": { "type": "string", "const": "entity_killed" } } },
"then": { "$ref": "./conditions/entity_killed.json" }
},
{
"if": { "properties": { "condition": { "type": "string", "const": "random_chance" } } },
"then": { "$ref": "./conditions/random_chance.json" }

View File

@@ -0,0 +1,19 @@
{
"$id": "blockception.minecraft.behavior.condition.bool_property",
"type": "object",
"title": "Bool Property",
"description": "Checks whether a boolean property matches the requested value.",
"additionalProperties": false,
"required": ["condition", "domain", "value"],
"properties": {
"condition": { "const": "bool_property" },
"domain": {
"type": "string",
"description": "Property domain identifier."
},
"value": {
"type": "boolean",
"description": "Expected boolean value."
}
}
}

View File

@@ -0,0 +1,15 @@
{
"$id": "blockception.minecraft.behavior.condition.entity_killed",
"type": "object",
"title": "Entity Killed",
"description": "Checks whether the source entity matches the supplied identifier.",
"additionalProperties": false,
"required": ["condition", "entity_type"],
"properties": {
"condition": { "const": "entity_killed" },
"entity_type": {
"type": "string",
"description": "Entity identifier expected for the killer/victim."
}
}
}

View File

@@ -1,32 +0,0 @@
{
"$id": "blockception.minecraft.behavior.condition.entity_properties",
"type": "object",
"additionalProperties": false,
"description": "Returns true if the actor properties defined were executed.",
"title": "Entity Properties",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "Returns true if the actor properties defined were executed.", "$comment": "UNDOCUMENTED" },
"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": "Checks if the entity is on fire or not.",
"$comment": "UNDOCUMENTED",
"type": "boolean"
},
"on_ground": {
"title": "On Ground",
"description": "Checks if the entity is on the ground or not.",
"$comment": "UNDOCUMENTED",
"type": "boolean"
}
}
}
}
}

View File

@@ -0,0 +1,19 @@
{
"$id": "blockception.minecraft.behavior.condition.enum_property",
"type": "object",
"title": "Enum Property",
"description": "Checks whether an enum property matches the requested value.",
"additionalProperties": false,
"required": ["condition", "domain", "value"],
"properties": {
"condition": { "const": "enum_property" },
"domain": {
"type": "string",
"description": "Property domain identifier."
},
"value": {
"type": "string",
"description": "Expected enumeration value."
}
}
}

View File

@@ -0,0 +1,19 @@
{
"$id": "blockception.minecraft.behavior.condition.float_property",
"type": "object",
"title": "Float Property",
"description": "Checks whether a float property matches the requested value.",
"additionalProperties": false,
"required": ["condition", "domain", "value"],
"properties": {
"condition": { "const": "float_property" },
"domain": {
"type": "string",
"description": "Property domain identifier."
},
"value": {
"description": "Expected float value.",
"type": "number"
}
}
}

View File

@@ -0,0 +1,15 @@
{
"$id": "blockception.minecraft.behavior.condition.has_property",
"type": "object",
"title": "Has Property",
"description": "Checks whether the current actor exposes a property in the given domain.",
"additionalProperties": false,
"required": ["condition", "domain"],
"properties": {
"condition": { "const": "has_property" },
"domain": {
"type": "string",
"description": "Property domain identifier."
}
}
}

View File

@@ -0,0 +1,15 @@
{
"$id": "blockception.minecraft.behavior.condition.has_variant",
"type": "object",
"title": "Has Variant",
"description": "Checks the variant value of the current actor.",
"additionalProperties": false,
"required": ["condition", "variant"],
"properties": {
"condition": { "const": "has_variant" },
"value": {
"type": "integer",
"description": "Expected variant identifier."
}
}
}

View File

@@ -0,0 +1,19 @@
{
"$id": "blockception.minecraft.behavior.condition.int_property",
"type": "object",
"title": "Int Property",
"description": "Checks whether an integer property matches the requested value.",
"additionalProperties": false,
"required": ["condition", "domain", "value"],
"properties": {
"condition": { "const": "int_property" },
"domain": {
"type": "string",
"description": "Property domain identifier."
},
"value": {
"description": "Expected integer value.",
"type": "integer"
}
}
}

View File

@@ -8,15 +8,18 @@
"properties": {
"condition": { "type": "string", "const": "match_tool", "title": "Condition", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"item": {
"title": "Item",
"description": "The item to match",
"type": "string"
"$ref": "../../../general/item/identifier.json"
},
"count": {
"title": "Count",
"description": "Minimum count to match of the given item",
"type": "integer",
"minimum": 0
"$ref": "../../../general/int_or_range.json"
},
"durability": {
"title": "Durability",
"description": "Minimum durability to match of the given item",
"$ref": "../../../general/int_or_range.json"
},
"enchantments": {
"title": "Enchantments",

View File

@@ -2,40 +2,17 @@
"$id": "blockception.minecraft.behavior.condition.random_regional_difficulty_chance",
"type": "object",
"additionalProperties": false,
"description": "Sets a Maximum regional difficulty random chance of the specified value.",
"description": "Passes with a probability scaled by the world's regional difficulty multiplier. The regional difficulty is based on dimension, world difficulty and moon brightness.",
"title": "Random Regional Difficulty Chance",
"properties": {
"condition": { "type": "string", "title": "Condition", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"default_chance": {
"condition": { "const": "random_regional_difficulty_chance" },
"max_chance": {
"type": "number",
"default": 0,
"description": "The default random chance if the level difficulty is not assigned.",
"title": "Default Chance"
},
"max_chance": { "title": "Maximum Chance", "type": "number", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"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"
"description": "Base probability (0-1) before scaling by the regional difficulty multiplier.",
"minimum": 0,
"maximum": 1,
"default": 0
}
}
},
"required": ["condition"]
}

View File

@@ -26,9 +26,11 @@
"set_damage",
"set_data_from_color_index",
"set_data",
"set_ominous_bottle_amplifier",
"set_lore",
"set_name",
"set_potion",
"set_stew_effect",
"specific_enchants",
"trader_material_type",
"minecraft:enchant_book_for_trading",
@@ -50,9 +52,11 @@
"minecraft:set_damage",
"minecraft:set_data_from_color_index",
"minecraft:set_data",
"minecraft:set_ominous_bottle_amplifier",
"minecraft:set_lore",
"minecraft:set_name",
"minecraft:set_potion",
"minecraft:set_stew_effect",
"minecraft:specific_enchants",
"minecraft:trader_material_type"
]
@@ -66,7 +70,10 @@
},
"allOf": [
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*enchant_random_gear$" } } }, "then": { "$ref": "./functions/enchant_random_gear.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*enchant_book_for_trading$" } } }, "then": { "$ref": "./functions/enchant_book_for_trading.json" } },
{
"if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*enchant_book_for_trading$" } } },
"then": { "$ref": "./functions/enchant_book_for_trading.json" }
},
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*enchant_randomly$" } } }, "then": { "$ref": "./functions/enchant_randomly.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*enchant_with_levels$" } } }, "then": { "$ref": "./functions/enchant_with_levels.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*exploration_map$" } } }, "then": { "$ref": "./functions/exploration_map.json" } },
@@ -82,7 +89,15 @@
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_count$" } } }, "then": { "$ref": "./functions/set_count.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_damage$" } } }, "then": { "$ref": "./functions/set_damage.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_data$" } } }, "then": { "$ref": "./functions/set_data.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_data_from_color_index$" } } }, "then": { "$ref": "./functions/set_data_from_color_index.json" } },
{
"if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_data_from_color_index$" } } },
"then": { "$ref": "./functions/set_data_from_color_index.json" }
},
{
"if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_ominous_bottle_amplifier$" } } },
"then": { "$ref": "./functions/set_ominous_bottle_amplifier.json" }
},
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_stew_effect$" } } }, "then": { "$ref": "./functions/set_stew_effect.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*trader_material_type$" } } }, "then": { "$ref": "./functions/trader_material_type.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*random_dye$" } } }, "then": { "$ref": "./functions/random_dye.json" } },
{ "if": { "properties": { "function": { "type": "string", "pattern": "^(minecraft:)*set_lore$" } } }, "then": { "$ref": "./functions/set_lore.json" } },

View File

@@ -20,7 +20,7 @@
},
"count": {
"title": "Count",
"oneOf": [{ "type": "integer" }, { "type": "object", "properties": { "min": { "type": "integer", "title": "Minimum" }, "max": { "type": "integer", "title": "Maximum" } } }],
"$ref": "../../../general/int_or_range.json",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED"
}

View File

@@ -22,16 +22,7 @@
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED",
"title": "Damage",
"oneOf": [
{ "type": "number", "minimum": 0, "maximum": 1 },
{
"type": "object",
"properties": {
"min": { "type": "number", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "title": "Minimum", "minimum": 0, "maximum": 1 },
"max": { "type": "number", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "title": "Maximum", "minimum": 0, "maximum": 1 }
}
}
]
"$ref": "../../../general/int_or_range.json"
}
}
}

View File

@@ -10,16 +10,7 @@
"title": "Data",
"description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED",
"oneOf": [
{ "type": "integer" },
{
"type": "object",
"properties": {
"min": { "type": "integer", "title": "Minimum", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" },
"max": { "type": "integer", "title": "Maximum", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED" }
}
}
]
"$ref": "../../../general/int_or_range.json"
}
}
}

View File

@@ -0,0 +1,15 @@
{
"$id": "blockception.minecraft.behavior.function.set_ominous_bottle_amplifier",
"type": "object",
"title": "Set Ominous Bottle Amplifier",
"description": "Configures the amplifier value applied to the ominous bottle item.",
"additionalProperties": false,
"required": ["function", "amplifier"],
"properties": {
"function": { "const": "set_ominous_bottle_amplifier" },
"amplifier": {
"description": "Amplifier value or range to apply.",
"$ref": "../../../general/int_or_range.json"
}
}
}

View File

@@ -0,0 +1,31 @@
{
"$id": "blockception.minecraft.behavior.function.set_stew_effect",
"type": "object",
"title": "Set Stew Effect",
"description": "Configures suspicious stew status effects.",
"additionalProperties": false,
"required": ["function", "effects"],
"properties": {
"function": { "const": "set_stew_effect" },
"effects": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"required": ["id"],
"properties": {
"id": {
"type": "integer",
"description": "Numeric effect identifier."
},
"duration": {
"type": "integer",
"minimum": 0,
"description": "Optional duration in ticks for the effect."
}
}
}
}
}
}

View File

@@ -21,18 +21,7 @@
"rolls": {
"title": "Rolls",
"description": "Determines how many items, will be selected.",
"$comment": "UNDOCUMENTED",
"oneOf": [
{ "type": "integer", "minimum": 0 },
{
"type": "object",
"required": ["min", "max"],
"properties": {
"min": { "title": "Minimum", "type": "number", "minimum": 0, "description": "The minimum amount." },
"max": { "title": "Maximum", "type": "number", "minimum": 1, "description": "The maximum amount." }
}
}
]
"$ref": "../../general/int_or_range.json"
},
"type": {
"title": "Type",
@@ -73,7 +62,7 @@
"title": "Count",
"description": "The amount of the item."
},
"name": { "title": "Name", "type": "string", "description": "An item or loottable.", "pattern": "^(?:[\\w]+:|loot_tables\/)?[\\w]+(?:\/[\\w]+)*$" },
"name": { "title": "Name", "type": "string", "description": "An item or loottable.", "pattern": "^(?:[\\w]+:|loot_tables/)?[\\w]+(?:/[\\w]+)*$" },
"weight": {
"title": "Weight",
"type": "integer",

View File

@@ -0,0 +1,16 @@
{
"$id": "Integer or Range",
"description": "An integer value or inclusive range.",
"oneOf": [
{ "type": "integer" },
{
"type": "object",
"additionalProperties": false,
"required": ["min", "max"],
"properties": {
"min": { "type": "integer", "description": "Minimum value." },
"max": { "type": "integer", "description": "Maximum value." }
}
}
]
}