Support single values for item components (#268)

This commit is contained in:
QuazChick
2024-05-11 10:24:22 +01:00
committed by GitHub
parent ffdf30a42d
commit 0ed8493085
12 changed files with 225 additions and 100 deletions

View File

@@ -1,12 +1,25 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:allow_off_hand", "$id": "blockception.minecraft.behavior.items.minecraft:allow_off_hand",
"additionalProperties": false,
"type": "object",
"title": "Allow Off Hand", "title": "Allow Off Hand",
"description": "The allow off hand component determines whether the item can be placed in the off hand slot of the inventory.", "description": "The allow off hand component determines whether the item can be placed in the off hand slot of the inventory.",
"default": false,
"examples": [true, { "value": true }],
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "Whether the item can be placed in the off hand slot" } }, "properties": {
"examples": [ "value": {
{ "value": true } "title": "Value",
"description": "Whether the item can be placed in the off hand slot",
"type": "boolean",
"default": false
}
}
}
] ]
} }

View File

@@ -1,12 +1,25 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:can_destroy_in_creative", "$id": "blockception.minecraft.behavior.items.minecraft:can_destroy_in_creative",
"additionalProperties": false,
"type": "object",
"title": "Can Destroy In Creative", "title": "Can Destroy In Creative",
"description": "The can destroy in creative component determines if the item will break blocks in creative when swinging.", "description": "The can destroy in creative component determines if the item will break blocks in creative when swinging.",
"default": true,
"examples": [false, { "value": false }],
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "Whether the item can destroy blocks while in creative" } }, "properties": {
"examples": [ "value": {
{ "value": false } "title": "Value",
"description": "Whether the item can destroy blocks while in creative",
"type": "boolean",
"default": true
}
}
}
] ]
} }

View File

@@ -2,11 +2,10 @@
"$id": "blockception.minecraft.behavior.items.minecraft:display_name", "$id": "blockception.minecraft.behavior.items.minecraft:display_name",
"title": "Display Name", "title": "Display Name",
"description": "Display Name item component. Display Names display the name of an item.", "description": "Display Name item component. Display Names display the name of an item.",
"$comment": "Does not currently support single value parsing.",
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "string", "title": "Value", "description": "Set the display name for an item." } }, "properties": { "value": { "type": "string", "title": "Value", "description": "Set the display name for an item." } },
"examples": [ "examples": [{ "value": "secret_weapon" }]
{ "value": "secret_weapon"}
]
} }

View File

@@ -1,12 +1,25 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:foil", "$id": "blockception.minecraft.behavior.items.minecraft:foil",
"additionalProperties": false,
"type": "object",
"title": "Glint", "title": "Glint",
"description": "The glint component determines whether the item has the enchanted glint render effect on it", "description": "The glint component determines whether the item has the enchanted glint render effect on it",
"default": false,
"examples": [true, { "value": true }],
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "Whether the item has the glint effect." } }, "properties": {
"examples": [ "value": {
{ "value": true } "title": "Value",
"description": "Whether the item has the glint effect.",
"type": "boolean",
"default": false
}
}
}
] ]
} }

View File

@@ -1,12 +1,25 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:hand_equipped", "$id": "blockception.minecraft.behavior.items.minecraft:hand_equipped",
"additionalProperties": false,
"type": "object",
"title": "Hand Equipped", "title": "Hand Equipped",
"description": "This component determines if an item is rendered like a tool while in hand.", "description": "This component determines if an item is rendered like a tool while in hand.",
"default": false,
"examples": [true, { "value": true }],
"oneOf": [
{
"type": "boolean"
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "If the item is rendered like a tool while in hand." } }, "properties": {
"examples": [ "value": {
{ "value": true } "title": "Value",
"description": "If the item is rendered like a tool while in hand.",
"type": "boolean",
"default": false
}
}
}
] ]
} }

View File

@@ -1,19 +1,28 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:hover_text_color", "$id": "blockception.minecraft.behavior.items.minecraft:hover_text_color",
"additionalProperties": false,
"type": "object",
"title": "Hover Text Color", "title": "Hover Text Color",
"description": "The hover text color component determines the color of the item name when hovering over it.", "description": "The hover text color component determines the color of the item name when hovering over it.",
"examples": ["light_blue", { "value": "light_blue" }],
"definitions": {
"color": {
"enum": ["black", "blue", "brown", "cyan", "gray", "green", "light_blue", "light_green", "magenta", "orange", "pink", "purple", "red", "silver", "white", "yellow"]
}
},
"oneOf": [
{
"$ref": "#/definitions/color"
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "properties": {
"value": { "value": {
"title": "Value",
"description": "The color of the item's hover text.", "description": "The color of the item's hover text.",
"type": "string", "$ref": "#/definitions/color"
"enum": ["black", "blue", "brown", "cyan", "gray", "green", "light_blue", "light_green", "magenta", "orange", "pink", "purple", "red", "silver", "white", "yellow"], }
"title": "Value" }
} }
},
"examples": [
{ "value": "light_blue" }
] ]
} }

View File

@@ -2,6 +2,12 @@
"$id": "blockception.minecraft.behavior.items.minecraft:icon", "$id": "blockception.minecraft.behavior.items.minecraft:icon",
"title": "Icon", "title": "Icon",
"description": "The icon item componenent determines the icon to represent the item in the UI and elsewhere.", "description": "The icon item componenent determines the icon to represent the item in the UI and elsewhere.",
"examples": ["stick", { "textures": { "default": "stick" } }],
"oneOf": [
{
"type": "string"
},
{
"type": "object", "type": "object",
"additionalProperties": true, "additionalProperties": true,
"required": ["textures"], "required": ["textures"],
@@ -20,8 +26,7 @@
} }
} }
} }
}, }
"examples": [ }
{"textures": {"default": "stick"}}
] ]
} }

View File

@@ -1,12 +1,25 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:liquid_clipped", "$id": "blockception.minecraft.behavior.items.minecraft:liquid_clipped",
"additionalProperties": false,
"type": "object",
"title": "Liquid Clipped", "title": "Liquid Clipped",
"description": "The liquid clipped component determines whether the item interacts with liquid blocks on use.", "description": "The liquid clipped component determines whether the item interacts with liquid blocks on use.",
"default": false,
"examples": [true, { "value": true }],
"oneOf": [
{
"type": "boolean"
},
{
"additionalProperties": false,
"type": "object",
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "Whether the item interacts with liquid blocks on use." } }, "properties": {
"examples": [ "value": {
{ "value": true } "title": "Value",
"description": "Whether the item interacts with liquid blocks on use.",
"type": "boolean",
"default": false
}
}
}
] ]
} }

View File

@@ -1,12 +1,29 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:max_stack_size", "$id": "blockception.minecraft.behavior.items.minecraft:max_stack_size",
"additionalProperties": false,
"type": "object",
"title": "Max Stack Size", "title": "Max Stack Size",
"description": "The max stack size component determines how many of the item can be stacked together.", "description": "The max stack size component determines how many of the item can be stacked together.",
"default": 64,
"examples": [1, { "value": 1 }],
"oneOf": [
{
"type": "number",
"minimum": 1,
"maximum": 64
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "number", "title": "Value", "description": "How many of the item that can be stacked.", "default": 64, "minimum": 1 } }, "properties": {
"examples": [ "value": {
{ "value": 1 } "title": "Value",
"description": "How many of the item that can be stacked.",
"type": "number",
"default": 64,
"minimum": 1,
"maximum": 64
}
}
}
] ]
} }

View File

@@ -2,11 +2,24 @@
"$id": "blockception.minecraft.behavior.items.minecraft:should_despawn", "$id": "blockception.minecraft.behavior.items.minecraft:should_despawn",
"title": "Should Despawn", "title": "Should Despawn",
"description": "Should despawn component determines if the item should eventually despawn while floating in the world", "description": "Should despawn component determines if the item should eventually despawn while floating in the world",
"additionalProperties": false, "default": true,
"examples": [false, { "value": false }],
"oneOf": [
{
"type": "boolean"
},
{
"type": "object", "type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "Whether the item should eventually despawn while floating in the world" } }, "properties": {
"examples": [ "value": {
{ "value": false } "title": "Value",
"description": "Whether the item should eventually despawn while floating in the world",
"type": "boolean",
"default": true
}
}
}
] ]
} }

View File

@@ -2,11 +2,24 @@
"$id": "blockception.minecraft.behavior.items.minecraft:stacked_by_data", "$id": "blockception.minecraft.behavior.items.minecraft:stacked_by_data",
"title": "Stacked By Data", "title": "Stacked By Data",
"description": "The stacked by data component determines if the same item with different aux values can stack.", "description": "The stacked by data component determines if the same item with different aux values can stack.",
"additionalProperties": false, "default": false,
"examples": [true, { "value": true }],
"oneOf": [
{
"type": "boolean"
},
{
"type": "object", "type": "object",
"additionalProperties": false,
"required": ["value"], "required": ["value"],
"properties": { "value": { "type": "boolean", "title": "Value", "description": "Also defines whether the item actors can merge while floating in the world." } }, "properties": {
"examples": [ "value": {
{ "value": true } "title": "Value",
"description": "Also defines whether the item actors can merge while floating in the world.",
"type": "boolean",
"default": false
}
}
}
] ]
} }

View File

@@ -1,21 +1,25 @@
{ {
"$id": "blockception.minecraft.behavior.items.minecraft:use_animation", "$id": "blockception.minecraft.behavior.items.minecraft:use_animation",
"additionalProperties": false,
"required": [ "value" ],
"type": "object",
"title": "Use Animation", "title": "Use Animation",
"description": "This component determines which animation plays when using the item.", "description": "This component determines which animation plays when using the item.",
"definitions": {
"animation": {
"enum": ["bow", "brush", "camera", "crossbow", "drink", "eat", "none", "spear", "spyglass"]
}
},
"oneOf": [
{ "$ref": "#/definitions/animation" },
{
"type": "object",
"additionalProperties": false,
"required": ["value"],
"properties": { "properties": {
"value": { "value": {
"title": "Value", "title": "Value",
"description": "Which animation to play when using the item.", "description": "Which animation to play when using the item.",
"enum": [ "$ref": "#/definitions/animation"
"bow", }
"eat", }
"crossbow", }
"drink",
"camera"
] ]
} }
}
}