Fix item damage component and event object schema (#316)

* Fix item damage component
* Remove duplicate event schema and unnecessary pattern match
This commit is contained in:
Beltsazar
2024-10-08 18:37:06 +07:00
committed by GitHub
parent 8473646f8c
commit fa09417d60
5 changed files with 24 additions and 31 deletions

View File

@@ -1,12 +1,25 @@
{
"$id": "blockception.minecraft.behavior.items.minecraft:damage",
"additionalProperties": false,
"type": "object",
"title": "Damage",
"description": "The damage component determines how much extra damage the item does on attack.",
"required": ["value"],
"properties": { "value": { "type": "number", "title": "Value", "description": "How much extra damage the item does, must be a positive number.", "minimum": 1 } },
"examples": [
{ "value": 7 }
]
"oneOf": [
{
"type": "number",
"minimum": 1
},
{
"type": "object",
"additionalProperties": false,
"required": ["value"],
"properties": {
"value": {
"type": "number",
"title": "Value",
"description": "How much extra damage the item does, must be a positive number.",
"minimum": 1
}
}
}
],
"examples": [{ "value": 7 }]
}