Applying some schemas fixes

This commit is contained in:
DaanV2
2024-02-17 12:32:54 +01:00
parent b84a0b530b
commit 98fc2bb2c3
10 changed files with 119 additions and 52 deletions

View File

@@ -10,7 +10,7 @@
"duration": { "duration": {
"title": "Duration", "title": "Duration",
"description": "Random range in seconds after which the croaking stops. Can also be a constant.", "description": "Random range in seconds after which the croaking stops. Can also be a constant.",
"$ref": "../../../../general/vectors/integer2OrValue.json" "$ref": "../../../../general/vectors/number2OrValue.json"
}, },
"filters": { "filters": {
"title": "Filters", "title": "Filters",

View File

@@ -76,6 +76,11 @@
"$ref": "../types/trigger.json", "$ref": "../types/trigger.json",
"description": "Defines the event to trigger when this entity successfully attacks." "description": "Defines the event to trigger when this entity successfully attacks."
}, },
"on_kill": {
"title": "On Kill",
"$ref": "../types/trigger.json",
"description": "[UNDOCUMENTED] Defines the event to trigger when this entity successfully kills a target."
},
"outer_boundary_time_increase": { "outer_boundary_time_increase": {
"title": "Outer Boundary Time Increase", "title": "Outer Boundary Time Increase",
"type": "number", "type": "number",

View File

@@ -6,6 +6,20 @@
"title": "Entity Sensor", "title": "Entity Sensor",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"cooldown": {
"title": "Cooldown",
"description": "How many seconds should elapse before the subsensor can once again sense for entities. The cooldown is applied on top of the base 1 tick (0.05 seconds) delay. Negative values will result in no cooldown being used.",
"type": "number",
"default": -1
},
"event_filters": {
"$ref": "../../filters/filters.json"
},
"event": {
"title": "Event",
"description": "event.",
"type": "string"
},
"maximum_count": { "maximum_count": {
"type": "integer", "type": "integer",
"default": -1, "default": -1,
@@ -18,6 +32,12 @@
"description": "The minimum number of entities that must pass the filter conditions for the event to send.", "description": "The minimum number of entities that must pass the filter conditions for the event to send.",
"title": "Minimum Count" "title": "Minimum Count"
}, },
"range": {
"type": "number",
"default": 10,
"description": "[UNDOCUMENTED] The maximum distance another entity can be from this and have the filters checked against it.",
"title": "Range"
},
"require_all": { "require_all": {
"type": "boolean", "type": "boolean",
"default": false, "default": false,
@@ -29,20 +49,6 @@
"default": 10, "default": 10,
"description": "The maximum distance another entity can be from this and have the filters checked against it.", "description": "The maximum distance another entity can be from this and have the filters checked against it.",
"title": "Sensor Range" "title": "Sensor Range"
},
"event_filters": {
"$ref": "../../filters/filters.json"
},
"event": {
"title": "Event",
"description": "event.",
"type": "string"
},
"cooldown": {
"title": "Cooldown",
"description": "How many seconds should elapse before the subsensor can once again sense for entities. The cooldown is applied on top of the base 1 tick (0.05 seconds) delay. Negative values will result in no cooldown being used.",
"type": "number",
"default": -1
} }
}, },
"examples": [ "examples": [

View File

@@ -10,7 +10,6 @@
"type": "array", "type": "array",
"description": "List of items that the entity should not equip.", "description": "List of items that the entity should not equip.",
"items": { "items": {
"type": "string",
"$ref": "../../../../general/item/descriptor.json", "$ref": "../../../../general/item/descriptor.json",
"description": "Item that the entity should not equip.", "description": "Item that the entity should not equip.",
"title": "Excluded Items" "title": "Excluded Items"

View File

@@ -297,9 +297,17 @@
}, },
"damage": { "damage": {
"title": "Damage", "title": "Damage",
"type": "number", "description": "The damage dealt on impact.",
"default": 1, "oneOf": [
"description": "The damage dealt on impact." { "type": "number", "default": 1 },
{
"type": "array",
"items": [
{ "type": "number", "title": "Min" },
{ "type": "number", "title": "Max" }
]
}
]
}, },
"destroy_on_hit": { "destroy_on_hit": {
"title": "Destroy On Hit", "title": "Destroy On Hit",

View File

@@ -37,7 +37,7 @@
"title": "Priority" "title": "Priority"
}, },
"check_if_outnumbered": { "check_if_outnumbered": {
"type": "number", "type": "boolean",
"description": "UNDOCUMENTED.", "description": "UNDOCUMENTED.",
"title": "Check If Outnumbered" "title": "Check If Outnumbered"
}, },

View File

@@ -20,10 +20,10 @@
"body": { "event": "$1", "target": "self", "filters": [{ "test": "$2", "value": "$3" }] } "body": { "event": "$1", "target": "self", "filters": [{ "test": "$2", "value": "$3" }] }
} }
], ],
"oneOf": [ "definitions": {
{ "type": "string" }, "trigger": {
{
"type": "object", "type": "object",
"title": "Trigger",
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"event": { "type": "string", "description": "The event to run when the conditions for this trigger are met.", "title": "Event" }, "event": { "type": "string", "description": "The event to run when the conditions for this trigger are met.", "title": "Event" },
@@ -34,5 +34,18 @@
"target": { "$ref": "../../filters/filters/types/subject.json", "description": "The target of the event.", "title": "Target" } "target": { "$ref": "../../filters/filters/types/subject.json", "description": "The target of the event.", "title": "Target" }
} }
} }
},
"oneOf": [
{ "type": "string" },
{
"type": "object",
"$ref": "#/definitions/trigger"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/trigger"
}
}
] ]
} }

View File

@@ -4,39 +4,58 @@
"description": "Unlock achievement", "description": "Unlock achievement",
"type": "object", "type": "object",
"required": ["context"], "required": ["context"],
"definitions": {
"item": {
"oneOf": [
{
"required": ["context"],
"properties": {
"context": {
"type": "string",
"title": "Context",
"description": "The context of the achievement to unlock"
}
}
},
{
"required": ["item"],
"properties": {
"item": {
"type": "string",
"title": "Item",
"examples": ["minecraft:stick"],
"description": "The item to unlock"
},
"data": {
"type": "integer",
"title": "Data",
"description": "The data of the item to unlock"
}
}
},
{
"required": ["tag"],
"properties": {
"tag": {
"type": "string",
"title": "Item Tag",
"description": "The item to unlock",
"examples": ["minecraft:planks", "minecraft:wooden_slabs"]
}
}
}
]
}
},
"oneOf": [ "oneOf": [
{ {
"properties": { "type": "object",
"context": { "$ref": "#/definitions/item"
"type": "string",
"title": "Context",
"description": "The context of the achievement to unlock"
}
}
}, },
{ {
"properties": { "type": "array",
"item": { "items": {
"type": "string", "$ref": "#/definitions/item"
"title": "Item",
"examples": ["minecraft:stick"],
"description": "The item to unlock"
},
"data": {
"type": "integer",
"title": "Data",
"description": "The data of the item to unlock"
}
}
},
{
"properties": {
"tag": {
"type": "string",
"title": "Item Tag",
"description": "The item to unlock",
"examples": ["minecraft:planks", "minecraft:wooden_slabs"]
}
} }
} }
] ]

View File

@@ -5,6 +5,7 @@
"description": "UNDOCUMENTED.", "description": "UNDOCUMENTED.",
"$comment": "UNDOCUMENTED", "$comment": "UNDOCUMENTED",
"enum": [ "enum": [
"",
"add.chest", "add.chest",
"admire", "admire",
"agitated", "agitated",
@@ -293,8 +294,10 @@
"milk.screamer", "milk.screamer",
"milk", "milk",
"mob.armor_stand.place", "mob.armor_stand.place",
"mob.hoglin.converted_to_zombified",
"mob.husk.convert_to_drowned", "mob.husk.convert_to_drowned",
"mob.husk.convert_to_frog", "mob.husk.convert_to_frog",
"mob.pig.death",
"mob.husk.convert_to_stray", "mob.husk.convert_to_stray",
"mob.husk.convert_to_zombie", "mob.husk.convert_to_zombie",
"mob.player.hurt_drown", "mob.player.hurt_drown",

View File

@@ -0,0 +1,14 @@
{
"oneOf": [
{
"type": "array",
"$ref": "./number2.json"
},
{
"title": "Value",
"type": "number"
}
],
"examples": [0, [0, 10]],
"defaultSnippets": [{ "label": "New Array 2", "body": ["^$1", "^$2"] }]
}