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:
@@ -16,7 +16,7 @@
|
|||||||
"title": "Baby Type"
|
"title": "Baby Type"
|
||||||
},
|
},
|
||||||
"breed_event": {
|
"breed_event": {
|
||||||
"$ref": "../types/event_object_filters.json",
|
"$ref": "../types/event_object.json",
|
||||||
"description": "Event to run when this entity breeds.",
|
"description": "Event to run when this entity breeds.",
|
||||||
"title": "Breed Event"
|
"title": "Breed Event"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,11 +10,11 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"oneOf": [
|
"oneOf": [
|
||||||
{ "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire." },
|
{ "type": "string", "description": "The event to fire." },
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" },
|
"event": { "type": "string", "description": "The event to fire.", "title": "Event" },
|
||||||
"target": {
|
"target": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The target of the event.",
|
"description": "The target of the event.",
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
"filters": {
|
"filters": {
|
||||||
"$ref": "../../filters/filters.json"
|
"$ref": "../../filters/filters.json"
|
||||||
},
|
},
|
||||||
"event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" },
|
"event": { "type": "string", "description": "The event to fire.", "title": "Event" },
|
||||||
"target": {
|
"target": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "The target of the event.",
|
"description": "The target of the event.",
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"$id": "blockception.minecraft.entities.event_object",
|
|
||||||
"title": "Event",
|
|
||||||
"description": "Minecraft behavior event.",
|
|
||||||
"examples": [{ "event": "example:foo", "target": "self" }],
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"properties": {
|
|
||||||
"event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" },
|
|
||||||
"target": {
|
|
||||||
"type": "string",
|
|
||||||
"description": "The target of the event.",
|
|
||||||
"title": "Target",
|
|
||||||
"enum": ["baby", "block", "damager", "other", "parent", "player", "self", "target"]
|
|
||||||
},
|
|
||||||
"filters": {
|
|
||||||
"$ref": "../../filters/filters.json"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,12 +1,25 @@
|
|||||||
{
|
{
|
||||||
"$id": "blockception.minecraft.behavior.items.minecraft:damage",
|
"$id": "blockception.minecraft.behavior.items.minecraft:damage",
|
||||||
"additionalProperties": false,
|
|
||||||
"type": "object",
|
|
||||||
"title": "Damage",
|
"title": "Damage",
|
||||||
"description": "The damage component determines how much extra damage the item does on attack.",
|
"description": "The damage component determines how much extra damage the item does on attack.",
|
||||||
"required": ["value"],
|
"oneOf": [
|
||||||
"properties": { "value": { "type": "number", "title": "Value", "description": "How much extra damage the item does, must be a positive number.", "minimum": 1 } },
|
{
|
||||||
"examples": [
|
"type": "number",
|
||||||
{ "value": 7 }
|
"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 }]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user