Files
minecraft-bedrock-json-schemas/source/behavior/entities/format/events.json

116 lines
5.1 KiB
JSON
Raw Normal View History

2021-10-08 12:59:03 +02:00
{
2021-10-08 13:04:13 +02:00
"$id": "blockception.minecraft.behavior.entities.events",
2021-10-08 12:59:03 +02:00
"type": "object",
2021-10-08 13:04:13 +02:00
"title": "Events",
2022-07-22 19:41:04 +02:00
"description": "Events for entities.",
2021-10-08 12:59:03 +02:00
"additionalProperties": { "$ref": "#/definitions/event_base" },
"definitions": {
"addremove": {
"additionalProperties": false,
"title": "Add Or Remove",
2022-07-22 19:41:04 +02:00
"description": "The components groups to add or remove.",
2021-10-08 12:59:03 +02:00
"type": "object",
2021-11-28 12:50:09 +01:00
"examples": [{ "component_groups": ["self:variant1"] }],
2021-10-08 12:59:03 +02:00
"properties": {
"component_groups": {
"title": "Component Groups",
2022-07-22 19:41:04 +02:00
"description": "The components groups to add or remove.",
2021-10-08 12:59:03 +02:00
"type": "array",
2022-07-22 19:41:04 +02:00
"items": { "type": "string", "description": "A reference to a component group.", "title": "Component Groups" }
2021-10-08 12:59:03 +02:00
}
}
},
"event_base": {
"additionalProperties": false,
"type": "object",
2021-10-13 10:42:29 +02:00
"examples": [{}, { "add": { "component_groups": [] } }, { "remove": { "component_groups": [] } }],
2021-11-05 11:06:55 +01:00
"defaultSnippets": [
2021-11-28 12:57:57 +01:00
{ "label": "New Add Event", "body": { "add": { "component_groups": ["$1"] } } },
{ "label": "New Remove Event", "body": { "remove": { "component_groups": ["$1"] } } },
2021-11-05 11:06:55 +01:00
{
2021-11-28 12:57:57 +01:00
"label": "New Random Event",
2021-11-05 11:06:55 +01:00
"body": {
"randomize": [
{ "add": { "component_groups": ["$1"] }, "weight": 1 },
{ "add": { "component_groups": ["$2"] }, "weight": 1 }
]
}
},
{
2021-11-28 12:57:57 +01:00
"label": "New Sequence Events",
2021-11-05 11:06:55 +01:00
"body": {
"sequence": [{ "add": { "component_groups": ["$1"] } }, { "add": { "component_groups": ["$2"] } }]
}
}
],
2021-10-08 12:59:03 +02:00
"properties": {
"filters": { "$ref": "./../filters/filters.json" },
2022-07-22 19:41:04 +02:00
"trigger": { "description": "Triggers additional events.", "$comment": "UNDOCUMENTED", "title": "Trigger", "$ref": "./types/trigger.json" },
"add": { "$ref": "#/definitions/addremove", "description": "What gets added when the event gets triggered.", "title": "Add" },
"remove": { "$ref": "#/definitions/addremove", "description": "What gets removed when the event gets triggered.", "title": "Remove" },
2021-10-08 12:59:03 +02:00
"randomize": {
"type": "array",
2022-07-22 19:41:04 +02:00
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
2021-10-08 12:59:03 +02:00
"title": "Randomize",
"items": {
2022-07-22 19:41:04 +02:00
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
2021-10-08 12:59:03 +02:00
"title": "Randomize",
2022-02-28 14:37:18 +01:00
"examples": [{ "add": { "component_groups": ["foo:example"] }, "weight": 1 }],
2021-10-08 12:59:03 +02:00
"properties": {
2022-07-22 19:41:04 +02:00
"add": { "$ref": "#/definitions/addremove", "description": "What gets added when the event gets triggered.", "title": "Add" },
"remove": { "$ref": "#/definitions/addremove", "description": "What gets removed when the event gets triggered.", "title": "Remove" },
"trigger": { "description": "Triggers additional events.", "$comment": "UNDOCUMENTED", "title": "Trigger", "$ref": "./types/trigger.json" },
2021-10-08 12:59:03 +02:00
"weight": {
"type": "number",
2021-11-05 11:06:55 +01:00
"default": 1,
"minimum": 1,
2022-07-22 19:41:04 +02:00
"description": "The weight on how likely this section is to trigger.",
2021-10-08 12:59:03 +02:00
"$comment": "UNDOCUMENTED",
"title": "Weight"
}
}
}
},
"sequence": {
"type": "array",
2022-07-22 19:41:04 +02:00
"description": "A series of filters and components to be added.",
2021-10-08 12:59:03 +02:00
"title": "Sequences",
"items": {
2022-07-22 19:41:04 +02:00
"description": "Filters and components to be added.",
2021-10-08 12:59:03 +02:00
"title": "Sequence",
"type": "object",
"properties": {
2022-07-22 19:41:04 +02:00
"add": { "$ref": "#/definitions/addremove", "description": "What gets added when the event gets triggered.", "title": "Add" },
"remove": { "$ref": "#/definitions/addremove", "description": "What gets removed when the event gets triggered.", "title": "Remove" },
"trigger": { "description": "Triggers additional events.", "$comment": "UNDOCUMENTED", "title": "Trigger", "$ref": "./types/trigger.json" },
2021-10-08 12:59:03 +02:00
"filters": { "$ref": "./../filters/filters.json" }
}
}
}
}
}
},
"properties": {
"minecraft:entity_transformed": {
"description": "Event called on an entity that transforms into another entity.",
"$ref": "#/definitions/event_base",
"title": "Entity Transformed"
},
"minecraft:entity_born": {
"description": "Event called on an entity that is spawned through two entities breeding.",
"$ref": "#/definitions/event_base",
"title": "Entity Born"
},
"minecraft:entity_spawned": {
"description": "Event called on an entity that is placed in the level.",
"$ref": "#/definitions/event_base",
"title": "Entity Spawned"
},
"minecraft:on_prime": {
"description": "Event called on an entity whose fuse is lit and is ready to explode.",
"$ref": "#/definitions/event_base",
"title": "On Prime"
}
}
}