Files
minecraft-bedrock-json-schemas/source/behavior/entities/format/events.json
Xterionix ec99529c64 Updated to 1.21.50 (#330)
* - Add new client biome components
* - Added built-in block tags
* - Add liquid detection block component
* - Add item visual component
* - Allow ambient_occlusion to use floats
* - Added cannot_be_attacked and ignore component
* - Added play_sound event response
* - Added summon_event property to summon_entity behavior
* - Updated home and looked_at components
* - Added compostable item component
* - Added jigsaws
* - Added processor_lists
* - Made identifier required in jigsaws
* - Added structure sets
* - Remove compressed volume file
* - Add template pools
* - Setup jigsaw schemas
* - Added broadcast_when_dying
* - Update interact.vibration
* - Fix format_version ref in jigsaw schemas
2024-12-05 16:54:27 +01:00

355 lines
12 KiB
JSON

{
"$id": "blockception.minecraft.behavior.entities.events",
"type": "object",
"title": "Events",
"description": "Events for entities.",
"additionalProperties": { "$ref": "#/definitions/event_base" },
"definitions": {
"addremove": {
"additionalProperties": false,
"title": "Add Or Remove",
"description": "The components groups to add or remove.",
"type": "object",
"examples": [ { "component_groups": [ "self:variant1" ] } ],
"properties": {
"component_groups": {
"title": "Component Groups",
"description": "The components groups to add or remove.",
"type": "array",
"items": { "type": "string", "description": "A reference to a component group.", "title": "Component Groups" }
}
}
},
"event_base": {
"additionalProperties": false,
"type": "object",
"examples": [ { }, { "add": { "component_groups": [ ] } }, { "remove": { "component_groups": [ ] } } ],
"defaultSnippets": [
{ "label": "New Add Event", "body": { "add": { "component_groups": [ "$1" ] } } },
{ "label": "New Remove Event", "body": { "remove": { "component_groups": [ "$1" ] } } },
{
"label": "New Random Event",
"body": {
"randomize": [
{ "add": { "component_groups": [ "$1" ] }, "weight": 1 },
{ "add": { "component_groups": [ "$2" ] }, "weight": 1 }
]
}
},
{
"label": "New Sequence Events",
"body": {
"sequence": [ { "add": { "component_groups": [ "$1" ] } }, { "add": { "component_groups": [ "$2" ] } } ]
}
}
],
"properties": {
"filters": { "$ref": "./../filters/filters.json" },
"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"
},
"randomize": {
"type": "array",
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
"title": "Randomize",
"items": {
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
"title": "Randomize",
"examples": [ { "add": { "component_groups": [ "foo:example" ] }, "weight": 1 } ],
"$ref": "#/definitions/weighted_event_base"
}
},
"sequence": {
"type": "array",
"description": "A series of filters and components to be added.",
"title": "Sequences",
"items": {
"description": "Filters and components to be added.",
"title": "Sequence",
"type": "object",
"$ref": "#/definitions/event_base"
}
},
"execute_event_on_home_block": {
"title": "Execute Event On Home Block",
"description": "Allows the entity to execute an event on the block at its home position",
"type": "object",
"additionalProperties": false,
"properties": {
"event": {
"title": "Event",
"description": "The event to execute",
"type": "string"
}
}
},
"reset_target": {
"title": "Reset Target",
"description": "Allows an entity to reset its target.",
"type": "object",
"additionalProperties": false,
"properties": { }
},
"emit_vibration": {
"title": "Emit Vibration",
"description": "UNDOCUMENTED",
"type": "object",
"properties": {
"vibration": {
"enum": [
"shear",
"entity_act",
"entity_interact"
]
}
},
"examples": [
{ "vibration": "shear" },
{ "vibration": "entity_act" },
{ "vibration": "entity_interact" }
]
},
"set_property": {
"title": "Set Property",
"description": "Sets a property on the entity.",
"type": "object",
"additionalProperties": {
"title": "Property",
"type": [ "string", "number", "integer", "boolean" ],
"description": "The value to set the property to.",
"examples": [ false, 0, 0.0, "math.random(0, 10)" ]
},
"examples": [
{ "example:property": false },
{ "example:property": 0 },
{ "example:property": 0.0 },
{ "example:property": "one" },
{ "example:property": "math.random(0, 10)" }
]
},
"queue_command": {
"description": "Queues a command to be executed.",
"properties": {
"command": {
"title": "Command",
"description": "The command to execute.",
"oneOf": [
{
"type": "string",
"pattern": "^[^/].*$",
"examples": [ "say Hello World" ]
},
{
"type": "array",
"items": {
"type": "string",
"description": "The command to execute.",
"examples": [ "say Hello World" ],
"pattern": "^[^/].*$"
}
}
]
}
}
},
"play_sound": {
"title": "Play Sound",
"description": "Allows the owner entity to emit sounds",
"type": "object",
"additionalProperties": false,
"properties": {
"sound": {
"title": "Sound",
"description": "Specifies the sound event to play",
"type": "string"
}
}
},
"emit_particle": {
"title": "Emit Particle",
"description": "Allowing particles to be emitted at the center of the entity's bounding box",
"type": "object",
"additionalProperties": false,
"properties": {
"particle": {
"title": "Particle",
"description": "Specifies the type of particle to emit",
"type": "string"
}
}
}
}
},
"weighted_event_base": {
"additionalProperties": false,
"type": "object",
"examples": [ { }, { "add": { "component_groups": [ ] } }, { "remove": { "component_groups": [ ] } } ],
"defaultSnippets": [
{ "label": "New Add Event", "body": { "add": { "component_groups": [ "$1" ] } } },
{ "label": "New Remove Event", "body": { "remove": { "component_groups": [ "$1" ] } } },
{
"label": "New Random Event",
"body": {
"randomize": [
{ "add": { "component_groups": [ "$1" ] }, "weight": 1 },
{ "add": { "component_groups": [ "$2" ] }, "weight": 1 }
]
}
},
{
"label": "New Sequence Events",
"body": {
"sequence": [ { "add": { "component_groups": [ "$1" ] } }, { "add": { "component_groups": [ "$2" ] } } ]
}
}
],
"properties": {
"filters": { "$ref": "./../filters/filters.json" },
"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"
},
"randomize": {
"type": "array",
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
"title": "Randomize",
"items": {
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
"title": "Randomize",
"examples": [ { "add": { "component_groups": [ "foo:example" ] }, "weight": 1 } ],
"$ref": "#/definitions/weighted_event_base"
}
},
"sequence": {
"type": "array",
"description": "A series of filters and components to be added.",
"title": "Sequences",
"items": {
"description": "Filters and components to be added.",
"title": "Sequence",
"type": "object",
"$ref": "#/definitions/event_base"
}
},
"emit_vibration": {
"title": "Emit Vibration",
"description": "UNDOCUMENTED",
"type": "object",
"properties": {
"vibration": {
"enum": [
"shear",
"entity_act",
"entity_interact"
]
}
},
"examples": [
{ "vibration": "shear" },
{ "vibration": "entity_act" },
{ "vibration": "entity_interact" }
]
},
"set_property": {
"title": "Set Property",
"description": "Sets a property on the entity.",
"type": "object",
"additionalProperties": {
"title": "Property",
"type": [ "string", "number", "integer", "boolean" ],
"description": "The value to set the property to.",
"examples": [ false, 0, 0.0, "math.random(0, 10)" ]
},
"examples": [
{ "example:property": false },
{ "example:property": 0 },
{ "example:property": 0.0 },
{ "example:property": "one" },
{ "example:property": "math.random(0, 10)" }
]
},
"queue_command": {
"description": "Queues a command to be executed.",
"properties": {
"command": {
"title": "Command",
"description": "The command to execute.",
"oneOf": [
{
"type": "string",
"pattern": "^[^/].*$",
"examples": [ "say Hello World" ]
},
{
"type": "array",
"items": {
"type": "string",
"description": "The command to execute.",
"examples": [ "say Hello World" ],
"pattern": "^[^/].*$"
}
}
]
}
}
},
"weight": {
"type": "number",
"default": 1,
"minimum": 1,
"description": "The weight on how likely this section is to trigger.",
"$comment": "UNDOCUMENTED",
"title": "Weight"
}
}
}
},
"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"
}
}
}