Add item_descriptor and use it in acceptable places (#115)

* Add item_descriptor and use it in acceptable places

* Rename descriptor

* Fix refs

* Fix refs

* Add descriptor to 3 more components
This commit is contained in:
Piotr Brzozowski
2022-10-01 19:34:08 +02:00
committed by GitHub
parent 393e7191dd
commit dcd9877aa7
15 changed files with 74 additions and 30 deletions

View File

@@ -37,7 +37,7 @@
"type": "array", "type": "array",
"title": "Target Blocks", "title": "Target Blocks",
"description": "List of block types this mob avoids.", "description": "List of block types this mob avoids.",
"items": { "title": "Block ID", "$ref": "../../../../general/block/identifier.json" } "items": { "title": "Block ID", "$ref": "../../../../general/item/descriptor.json" }
}, },
"avoid_block_sound": { "avoid_block_sound": {
"type": "string", "type": "string",

View File

@@ -16,7 +16,7 @@
"type": "string", "type": "string",
"description": "List of items that this mob likes.", "description": "List of items that this mob likes.",
"title": "Properties", "title": "Properties",
"$ref": "../../../../general/item/identifier.json" "$ref": "../../../../general/item/descriptor.json"
}, },
"title": "Properties" "title": "Properties"
}, },

View File

@@ -14,7 +14,7 @@
"title": "Items", "title": "Items",
"description": "The list of items that can be used to charge the held item. This list is required and must have at least one item in it.", "description": "The list of items that can be used to charge the held item. This list is required and must have at least one item in it.",
"items": { "items": {
"type": "string", "$ref": "../../../../general/item/descriptor.json",
"description": "Items names to be used.", "description": "Items names to be used.",
"title": "Item ID" "title": "Item ID"
} }

View File

@@ -20,7 +20,7 @@
"type": "array", "type": "array",
"description": "Blocks that the mob can't jump to.", "description": "Blocks that the mob can't jump to.",
"items": { "items": {
"$ref": "../../../../general/block/identifier.json" "$ref": "../../../../general/item/descriptor.json"
} }
}, },
"max_velocity": { "max_velocity": {
@@ -46,7 +46,7 @@
"type": "array", "type": "array",
"description": "Blocks that the mob prefers jumping to.", "description": "Blocks that the mob prefers jumping to.",
"items": { "items": {
"$ref": "../../../../general/block/identifier.json" "$ref": "../../../../general/item/descriptor.json"
} }
}, },
"preferred_blocks_chance": { "preferred_blocks_chance": {

View File

@@ -17,7 +17,7 @@
}, },
"egg_type": { "egg_type": {
"title": "Egg Type", "title": "Egg Type",
"type": "string", "$ref": "../../../../general/item/descriptor.json",
"default": "minecraft:turtle_egg", "default": "minecraft:turtle_egg",
"description": "[EXPERIMENTAL] Block type for the egg to lay. If this is a turtle egg, the number of eggs in the block is randomly set." "description": "[EXPERIMENTAL] Block type for the egg to lay. If this is a turtle egg, the number of eggs in the block is randomly set."
}, },
@@ -60,6 +60,7 @@
"title": "Target Blocks", "title": "Target Blocks",
"type": "array", "type": "array",
"default": ["minecraft:sand"], "default": ["minecraft:sand"],
"items": { "title": "Block ID", "$ref": "../../../../general/item/descriptor.json" },
"description": "[EXPERIMENTAL] Blocks that the mob can lay its eggs on top of." "description": "[EXPERIMENTAL] Blocks that the mob can lay its eggs on top of."
}, },
"target_materials_above_block": { "target_materials_above_block": {

View File

@@ -71,8 +71,7 @@
"title": "Target Blocks", "title": "Target Blocks",
"description": "Block types to move to.", "description": "Block types to move to.",
"items": { "items": {
"$ref": "../../../../general/block/identifier.json", "$ref": "../../../../general/item/descriptor.json"
"type": "string"
} }
}, },
"target_block_filters": { "target_block_filters": {

View File

@@ -31,7 +31,7 @@
"type": "array", "type": "array",
"items": { "items": {
"title": "Excluded Item", "title": "Excluded Item",
"$ref": "../../../../general/item/identifier.json" "$ref": "../../../../general/item/descriptor.json"
} }
}, },
"goal_radius": { "goal_radius": {

View File

@@ -16,7 +16,7 @@
"type": "string", "type": "string",
"title": "Block Id", "title": "Block Id",
"description": "A block identifier.", "description": "A block identifier.",
"$ref": "../../../../general/block/identifier.json" "$ref": "../../../../general/item/descriptor.json"
} }
}, },
"eat_delay": { "eat_delay": {

View File

@@ -16,12 +16,12 @@
{ {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "../../../../general/item/identifier.json", "$ref": "../../../../general/item/descriptor.json",
"title": "Item" "title": "Item"
} }
}, },
{ {
"$ref": "../../../../general/item/identifier.json" "$ref": "../../../../general/item/descriptor.json"
} }
] ]
}, },

View File

@@ -30,7 +30,7 @@
"title": "Items", "title": "Items",
"description": "List of items this mob is tempted by.", "description": "List of items this mob is tempted by.",
"items": { "items": {
"$ref": "../../../../general/item/identifier.json" "$ref": "../../../../general/item/descriptor.json"
} }
}, },
"sound_interval": { "sound_interval": {

View File

@@ -33,12 +33,11 @@
{ {
"type": "array", "type": "array",
"items": { "items": {
"oneOf": [
{
"$ref": "../../../../general/item/identifier.json" "$ref": "../../../../general/item/identifier.json"
}
}, },
{ {
"type": "array",
"items": {
"type": "object", "type": "object",
"properties": { "properties": {
"growth": { "growth": {
@@ -49,6 +48,8 @@
} }
} }
} }
]
}
}, },
{ {
"type": "string", "type": "string",

View File

@@ -17,7 +17,7 @@
"description": "The list of items that can be used to bribe the entity.", "description": "The list of items that can be used to bribe the entity.",
"items": { "items": {
"description": "An item that can be used to bribe the entity.", "description": "An item that can be used to bribe the entity.",
"$ref": "../../../../general/item/identifier.json", "$ref": "../../../../general/item/descriptor.json",
"title": "Bribe Items" "title": "Bribe Items"
}, },
"title": "Bribe Items" "title": "Bribe Items"

View File

@@ -27,7 +27,7 @@
"items": { "items": {
"type": "string", "type": "string",
"description": "A item name.", "description": "A item name.",
"$ref": "../../../../general/item/identifier.json", "$ref": "../../../../general/item/descriptor.json",
"title": "Accepted Items" "title": "Accepted Items"
} }
}, },

View File

@@ -23,7 +23,7 @@
"description": "The list of items that can be given to the entity to place in their inventory.", "description": "The list of items that can be given to the entity to place in their inventory.",
"items": { "items": {
"description": "An items that can be given to the entity to place in their inventory.", "description": "An items that can be given to the entity to place in their inventory.",
"$ref": "../../../../general/item/identifier.json", "$ref": "../../../../general/item/descriptor.json",
"title": "Properties" "title": "Properties"
} }
}, },

View File

@@ -0,0 +1,43 @@
{
"$id": "blockception.minecraft.item.descriptor",
"oneOf": [
{
"$ref": "./identifier.json"
},
{
"$ref": "#/definitions/object_item_descriptor"
},
{
"type": "object",
"properties": {
"item": {
"oneOf": [
{
"$ref": "./identifier.json"
},
{
"$ref": "#/definitions/object_item_descriptor"
}
]
}
}
}
],
"definitions": {
"object_item_descriptor": {
"type": "object",
"properties": {
"tags": {
"type": "string",
"description": "[UNDOCUMENTED] A Molang expression ran against item or block to match.",
"examples": ["query.any_tag('minecraft:is_tool')"]
},
"item_tag": {
"type": "string",
"description": "[UNDOCUMENTED] A tag to lookup item or block by.",
"examples": ["minecraft:is_tool"]
}
}
}
}
}