Feature/actor properties (#138)
* Added actor properties * Adding Set Property in events Co-authored-by: Daan Verstraten <daan@q42.nl>
This commit is contained in:
@@ -1,115 +1,169 @@
|
|||||||
{
|
{
|
||||||
"$id": "blockception.minecraft.behavior.entities.events",
|
"$id": "blockception.minecraft.behavior.entities.events",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"title": "Events",
|
"title": "Events",
|
||||||
"description": "Events for entities.",
|
"description": "Events for entities.",
|
||||||
"additionalProperties": { "$ref": "#/definitions/event_base" },
|
"additionalProperties": { "$ref": "#/definitions/event_base" },
|
||||||
"definitions": {
|
"definitions": {
|
||||||
"addremove": {
|
"addremove": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"title": "Add Or Remove",
|
"title": "Add Or Remove",
|
||||||
"description": "The components groups to add or remove.",
|
"description": "The components groups to add or remove.",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"examples": [{ "component_groups": ["self:variant1"] }],
|
"examples": [{ "component_groups": ["self:variant1"] }],
|
||||||
"properties": {
|
"properties": {
|
||||||
"component_groups": {
|
"component_groups": {
|
||||||
"title": "Component Groups",
|
"title": "Component Groups",
|
||||||
"description": "The components groups to add or remove.",
|
"description": "The components groups to add or remove.",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": { "type": "string", "description": "A reference to a component group.", "title": "Component Groups" }
|
"items": { "type": "string", "description": "A reference to a component group.", "title": "Component Groups" }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"event_base": {
|
"event_base": {
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"examples": [{}, { "add": { "component_groups": [] } }, { "remove": { "component_groups": [] } }],
|
"examples": [{}, { "add": { "component_groups": [] } }, { "remove": { "component_groups": [] } }],
|
||||||
"defaultSnippets": [
|
"defaultSnippets": [
|
||||||
{ "label": "New Add Event", "body": { "add": { "component_groups": ["$1"] } } },
|
{ "label": "New Add Event", "body": { "add": { "component_groups": ["$1"] } } },
|
||||||
{ "label": "New Remove Event", "body": { "remove": { "component_groups": ["$1"] } } },
|
{ "label": "New Remove Event", "body": { "remove": { "component_groups": ["$1"] } } },
|
||||||
{
|
{
|
||||||
"label": "New Random Event",
|
"label": "New Random Event",
|
||||||
"body": {
|
"body": {
|
||||||
"randomize": [
|
"randomize": [
|
||||||
{ "add": { "component_groups": ["$1"] }, "weight": 1 },
|
{ "add": { "component_groups": ["$1"] }, "weight": 1 },
|
||||||
{ "add": { "component_groups": ["$2"] }, "weight": 1 }
|
{ "add": { "component_groups": ["$2"] }, "weight": 1 }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "New Sequence Events",
|
"label": "New Sequence Events",
|
||||||
"body": {
|
"body": {
|
||||||
"sequence": [{ "add": { "component_groups": ["$1"] } }, { "add": { "component_groups": ["$2"] } }]
|
"sequence": [{ "add": { "component_groups": ["$1"] } }, { "add": { "component_groups": ["$2"] } }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"properties": {
|
"properties": {
|
||||||
"filters": { "$ref": "./../filters/filters.json" },
|
"filters": { "$ref": "./../filters/filters.json" },
|
||||||
"trigger": { "description": "Triggers additional events.", "$comment": "UNDOCUMENTED", "title": "Trigger", "$ref": "./types/trigger.json" },
|
"trigger": {
|
||||||
"add": { "$ref": "#/definitions/addremove", "description": "What gets added when the event gets triggered.", "title": "Add" },
|
"description": "Triggers additional events.",
|
||||||
"remove": { "$ref": "#/definitions/addremove", "description": "What gets removed when the event gets triggered.", "title": "Remove" },
|
"$comment": "UNDOCUMENTED",
|
||||||
"randomize": {
|
"title": "Trigger",
|
||||||
"type": "array",
|
"$ref": "./types/trigger.json"
|
||||||
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
|
},
|
||||||
"title": "Randomize",
|
"add": {
|
||||||
"items": {
|
"$ref": "#/definitions/addremove",
|
||||||
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
|
"description": "What gets added when the event gets triggered.",
|
||||||
"title": "Randomize",
|
"title": "Add"
|
||||||
"examples": [{ "add": { "component_groups": ["foo:example"] }, "weight": 1 }],
|
},
|
||||||
"properties": {
|
"remove": {
|
||||||
"add": { "$ref": "#/definitions/addremove", "description": "What gets added when the event gets triggered.", "title": "Add" },
|
"$ref": "#/definitions/addremove",
|
||||||
"remove": { "$ref": "#/definitions/addremove", "description": "What gets removed when the event gets triggered.", "title": "Remove" },
|
"description": "What gets removed when the event gets triggered.",
|
||||||
"trigger": { "description": "Triggers additional events.", "$comment": "UNDOCUMENTED", "title": "Trigger", "$ref": "./types/trigger.json" },
|
"title": "Remove"
|
||||||
"weight": {
|
},
|
||||||
"type": "number",
|
"randomize": {
|
||||||
"default": 1,
|
"type": "array",
|
||||||
"minimum": 1,
|
"description": "Randomly selects one of the following items based upon their weight and the total weights.",
|
||||||
"description": "The weight on how likely this section is to trigger.",
|
"title": "Randomize",
|
||||||
"$comment": "UNDOCUMENTED",
|
"items": {
|
||||||
"title": "Weight"
|
"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 }],
|
||||||
}
|
"properties": {
|
||||||
},
|
"add": {
|
||||||
"sequence": {
|
"$ref": "#/definitions/addremove",
|
||||||
"type": "array",
|
"description": "What gets added when the event gets triggered.",
|
||||||
"description": "A series of filters and components to be added.",
|
"title": "Add"
|
||||||
"title": "Sequences",
|
},
|
||||||
"items": {
|
"remove": {
|
||||||
"description": "Filters and components to be added.",
|
"$ref": "#/definitions/addremove",
|
||||||
"title": "Sequence",
|
"description": "What gets removed when the event gets triggered.",
|
||||||
"type": "object",
|
"title": "Remove"
|
||||||
"properties": {
|
},
|
||||||
"add": { "$ref": "#/definitions/addremove", "description": "What gets added when the event gets triggered.", "title": "Add" },
|
"trigger": {
|
||||||
"remove": { "$ref": "#/definitions/addremove", "description": "What gets removed when the event gets triggered.", "title": "Remove" },
|
"description": "Triggers additional events.",
|
||||||
"trigger": { "description": "Triggers additional events.", "$comment": "UNDOCUMENTED", "title": "Trigger", "$ref": "./types/trigger.json" },
|
"$comment": "UNDOCUMENTED",
|
||||||
"filters": { "$ref": "./../filters/filters.json" }
|
"title": "Trigger",
|
||||||
}
|
"$ref": "./types/trigger.json"
|
||||||
}
|
},
|
||||||
}
|
"weight": {
|
||||||
}
|
"type": "number",
|
||||||
}
|
"default": 1,
|
||||||
},
|
"minimum": 1,
|
||||||
"properties": {
|
"description": "The weight on how likely this section is to trigger.",
|
||||||
"minecraft:entity_transformed": {
|
"$comment": "UNDOCUMENTED",
|
||||||
"description": "Event called on an entity that transforms into another entity.",
|
"title": "Weight"
|
||||||
"$ref": "#/definitions/event_base",
|
}
|
||||||
"title": "Entity Transformed"
|
}
|
||||||
},
|
}
|
||||||
"minecraft:entity_born": {
|
},
|
||||||
"description": "Event called on an entity that is spawned through two entities breeding.",
|
"sequence": {
|
||||||
"$ref": "#/definitions/event_base",
|
"type": "array",
|
||||||
"title": "Entity Born"
|
"description": "A series of filters and components to be added.",
|
||||||
},
|
"title": "Sequences",
|
||||||
"minecraft:entity_spawned": {
|
"items": {
|
||||||
"description": "Event called on an entity that is placed in the level.",
|
"description": "Filters and components to be added.",
|
||||||
"$ref": "#/definitions/event_base",
|
"title": "Sequence",
|
||||||
"title": "Entity Spawned"
|
"type": "object",
|
||||||
},
|
"properties": {
|
||||||
"minecraft:on_prime": {
|
"add": {
|
||||||
"description": "Event called on an entity whose fuse is lit and is ready to explode.",
|
"$ref": "#/definitions/addremove",
|
||||||
"$ref": "#/definitions/event_base",
|
"description": "What gets added when the event gets triggered.",
|
||||||
"title": "On Prime"
|
"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"
|
||||||
|
},
|
||||||
|
"filters": { "$ref": "./../filters/filters.json" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"set_property": {
|
||||||
|
"title": "Set Property",
|
||||||
|
"description": "Sets a property on the entity.",
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"title": "Property",
|
||||||
|
"type": ["string", "number", "integer", "boolean"]
|
||||||
|
},
|
||||||
|
"examples": [
|
||||||
|
{ "example:property": false },
|
||||||
|
{ "example:property": 0 },
|
||||||
|
{ "example:property": 0.0 },
|
||||||
|
{ "example:property": "one" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,106 +1,211 @@
|
|||||||
{
|
{
|
||||||
"$id": "blockception.minecraft.behavior.entities.minecraft:entity",
|
"$id": "blockception.minecraft.behavior.entities.minecraft:entity",
|
||||||
"title": "Entity",
|
"title": "Entity",
|
||||||
"required": ["description"],
|
"required": ["description"],
|
||||||
"dependencies": { "component_groups": ["events"] },
|
"dependencies": { "component_groups": ["events"] },
|
||||||
"additionalProperties": false,
|
"additionalProperties": false,
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"description": {
|
"description": {
|
||||||
"required": ["identifier"],
|
"required": ["identifier"],
|
||||||
"title": "Description",
|
"title": "Description",
|
||||||
"description": "The description of the this entity.",
|
"description": "The description of the this entity.",
|
||||||
"properties": {
|
"properties": {
|
||||||
"animations": {
|
"animations": {
|
||||||
"title": "Animations",
|
"title": "Animations",
|
||||||
"description": "Sets the mapping of internal animation / animation controllers references to actual animations. This is a JSON Object of name/animation pairs",
|
"description": "Sets the mapping of internal animation / animation controllers references to actual animations. This is a JSON Object of name/animation pairs",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"title": "Animation / Controller",
|
"title": "Animation / Controller",
|
||||||
"description": "The name of the animation controller / animation.",
|
"description": "The name of the animation controller / animation.",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"examples": ["animation.", "controller."]
|
"examples": ["animation.", "controller."]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"identifier": {
|
"identifier": {
|
||||||
"$ref": "../../../general/entity/identifier.json",
|
"$ref": "../../../general/entity/identifier.json",
|
||||||
"description": "Sets the identifier for this entity's description.",
|
"description": "Sets the identifier for this entity's description.",
|
||||||
"title": "Identifier"
|
"title": "Identifier"
|
||||||
},
|
},
|
||||||
"is_spawnable": {
|
"is_spawnable": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"title": "Is Spawnable",
|
"title": "Is Spawnable",
|
||||||
"description": "Sets whether or not this entity has a spawn egg in the creative ui.",
|
"description": "Sets whether or not this entity has a spawn egg in the creative ui.",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"is_summonable": {
|
"is_summonable": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"title": "Is Summonable Property",
|
"title": "Is Summonable Property",
|
||||||
"description": "Sets whether or not we can summon this entity using commands such as /summon.",
|
"description": "Sets whether or not we can summon this entity using commands such as /summon.",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
"is_experimental": {
|
"is_experimental": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"title": "Is Experimental",
|
"title": "Is Experimental",
|
||||||
"description": "Sets whether or not this entity is experimental. Experimental entities are only enabled when the experimental toggle is enabled.",
|
"description": "Sets whether or not this entity is experimental. Experimental entities are only enabled when the experimental toggle is enabled.",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"runtime_identifier": {
|
"properties": {
|
||||||
"type": "string",
|
"title": "Experimental",
|
||||||
"title": "Runtime Identifier",
|
"description": "Experimental",
|
||||||
"description": "Sets the name for the Vanilla Minecraft identifier this entity will use to build itself from.",
|
"type": "object",
|
||||||
"examples": ["minecraft."]
|
"additionalProperties": {
|
||||||
},
|
"type": "object",
|
||||||
"scripts": {
|
"required": ["type"],
|
||||||
"type": "object",
|
"properties": {
|
||||||
"title": "Scripts",
|
"type": {
|
||||||
"description": "Sets the mapping of internal animation controller references to actual animation controller. This is a JSON Array of name/animation-controller pairs",
|
"title": "Type",
|
||||||
"properties": {
|
"description": "The type of the property.",
|
||||||
"animate": {
|
"enum": ["bool", "int", "float", "enum"]
|
||||||
"type": "array",
|
}
|
||||||
"title": "Animate",
|
},
|
||||||
"description": "Tells minecraft to run which animation / animation controllers and under what conditions.",
|
"oneOf": [
|
||||||
"items": {
|
{
|
||||||
"oneOf": [
|
"properties": {
|
||||||
{ "type": "string", "title": "Animation", "description": "The name of an animation controller referenced in animations." },
|
"type": { "const": "bool" },
|
||||||
{
|
"default": {
|
||||||
"type": "object",
|
"title": "Default",
|
||||||
"title": "Conditional Animation",
|
"description": "The default value of the property.",
|
||||||
"description": "A conditional statement to run the animation under a specified condition.",
|
"$ref": "../../../molang/boolean.json"
|
||||||
"$comment": "UNDOCUMENTED",
|
}
|
||||||
"additionalProperties": { "type": "string", "title": "Animation" }
|
}
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
}
|
"properties": {
|
||||||
}
|
"type": { "const": "int" },
|
||||||
}
|
"default": {
|
||||||
}
|
"title": "Default",
|
||||||
}
|
"description": "The default value of the property.",
|
||||||
},
|
"$ref": "../../../molang/number.json"
|
||||||
"component_groups": {
|
},
|
||||||
"title": "Component Groups",
|
"range": {
|
||||||
"description": "Each group when add / remove the default components.",
|
"title": "Range",
|
||||||
"uniqueItems": true,
|
"description": "The range of the property.",
|
||||||
"type": "object",
|
"type": "array",
|
||||||
"propertyNames": { "examples": ["self:"] },
|
"items": [
|
||||||
"additionalProperties": {
|
{
|
||||||
"$ref": "./components.json",
|
"title": "Min",
|
||||||
"uniqueItems": true,
|
"type": "integer",
|
||||||
"description": "The components that are added as the foundation of the entity.",
|
"description": "The minimum value of the property."
|
||||||
"title": "Component"
|
},
|
||||||
}
|
{
|
||||||
},
|
"title": "Max",
|
||||||
"components": {
|
"type": "integer",
|
||||||
"$ref": "./components.json",
|
"description": "The minimum value of the property."
|
||||||
"uniqueItems": true,
|
}
|
||||||
"description": "The components that are added as the foundation of the entity.",
|
]
|
||||||
"title": "Component"
|
}
|
||||||
},
|
}
|
||||||
"events": {
|
},
|
||||||
"$ref": "./events.json",
|
{
|
||||||
"uniqueItems": true,
|
"properties": {
|
||||||
"description": "The events that the entity can run, these add or remove components_groups.",
|
"type": { "const": "float" },
|
||||||
"title": "Events"
|
"default": {
|
||||||
}
|
"title": "Default",
|
||||||
}
|
"description": "The default value of the property.",
|
||||||
}
|
"$ref": "../../../molang/number.json"
|
||||||
|
},
|
||||||
|
"range": {
|
||||||
|
"title": "Range",
|
||||||
|
"description": "The range of the property.",
|
||||||
|
"type": "array",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"title": "Min",
|
||||||
|
"type": "number",
|
||||||
|
"description": "The minimum value of the property."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "Max",
|
||||||
|
"type": "number",
|
||||||
|
"description": "The minimum value of the property."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"properties": {
|
||||||
|
"type": { "const": "enum" },
|
||||||
|
"default": { "type": "string" },
|
||||||
|
"client_sync": {
|
||||||
|
"title": "Client Sync",
|
||||||
|
"description": "Sets whether or not the property is synced to the client.",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"values": {
|
||||||
|
"title": "Values",
|
||||||
|
"description": "The values of the property.",
|
||||||
|
"type": "array",
|
||||||
|
"minItems": 1,
|
||||||
|
"items": { "type": "string" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtime_identifier": {
|
||||||
|
"type": "string",
|
||||||
|
"title": "Runtime Identifier",
|
||||||
|
"description": "Sets the name for the Vanilla Minecraft identifier this entity will use to build itself from.",
|
||||||
|
"examples": ["minecraft."]
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"type": "object",
|
||||||
|
"title": "Scripts",
|
||||||
|
"description": "Sets the mapping of internal animation controller references to actual animation controller. This is a JSON Array of name/animation-controller pairs",
|
||||||
|
"properties": {
|
||||||
|
"animate": {
|
||||||
|
"type": "array",
|
||||||
|
"title": "Animate",
|
||||||
|
"description": "Tells minecraft to run which animation / animation controllers and under what conditions.",
|
||||||
|
"items": {
|
||||||
|
"oneOf": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"title": "Animation",
|
||||||
|
"description": "The name of an animation controller referenced in animations."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"title": "Conditional Animation",
|
||||||
|
"description": "A conditional statement to run the animation under a specified condition.",
|
||||||
|
"$comment": "UNDOCUMENTED",
|
||||||
|
"additionalProperties": { "type": "string", "title": "Animation" }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"component_groups": {
|
||||||
|
"title": "Component Groups",
|
||||||
|
"description": "Each group when add / remove the default components.",
|
||||||
|
"uniqueItems": true,
|
||||||
|
"type": "object",
|
||||||
|
"propertyNames": { "examples": ["self:"] },
|
||||||
|
"additionalProperties": {
|
||||||
|
"$ref": "./components.json",
|
||||||
|
"uniqueItems": true,
|
||||||
|
"description": "The components that are added as the foundation of the entity.",
|
||||||
|
"title": "Component"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"components": {
|
||||||
|
"$ref": "./components.json",
|
||||||
|
"uniqueItems": true,
|
||||||
|
"description": "The components that are added as the foundation of the entity.",
|
||||||
|
"title": "Component"
|
||||||
|
},
|
||||||
|
"events": {
|
||||||
|
"$ref": "./events.json",
|
||||||
|
"uniqueItems": true,
|
||||||
|
"description": "The events that the entity can run, these add or remove components_groups.",
|
||||||
|
"title": "Events"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
8
source/molang/boolean.json
Normal file
8
source/molang/boolean.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"$id": "molang_boolean1.19.0",
|
||||||
|
"title": "Molang Boolean",
|
||||||
|
"description": "The minecraft molang definition that results in a boolean.",
|
||||||
|
"anyOf": [{ "type": "string", "minLength": 0 }, { "type": "boolean" }],
|
||||||
|
"examples": [0, "query.variant", "(1.0)", "query.", "variable.=;"],
|
||||||
|
"defaultSnippets": [{ "label": "New Molang", "body": "$1" }]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user