Files
minecraft-bedrock-json-schemas/source/resource/animation_controllers/animation_controller.json

210 lines
8.9 KiB
JSON
Raw Normal View History

2021-06-06 10:07:19 +00:00
{
2021-11-20 11:26:35 +01:00
"$schema": "http://json-schema.org/draft-07/schema",
2021-06-06 10:07:19 +00:00
"$id": "blockception.minecraft.resource.animation_controller",
"examples": [
{
"format_version": "1.19.0",
2021-06-06 10:07:19 +00:00
"animation_controllers": {
"controller.animation.example": {
"states": {
"default": { "transitions": [{ "state_1": "query.is_baby" }] },
"state_1": { "animations": ["state_1"], "transitions": [{ "default": "query.all_animations_finished" }] }
}
}
}
}
],
2021-10-11 16:51:59 +02:00
"type": "object",
"title": "Animation Controller",
2022-07-22 19:41:04 +02:00
"description": "UNDOCUMENTED.",
2021-10-11 16:51:59 +02:00
"$comment": "UNDOCUMENTED",
"definitions": {
"animationspec": {
"anyOf": [
2022-07-22 19:41:04 +02:00
{ "title": "Animation Specification", "description": "A single string that specifies which animation there are.", "type": "string" },
2021-10-11 16:51:59 +02:00
{
"type": "object",
"title": "Animation Specification",
2022-07-22 19:41:04 +02:00
"description": "A object specification on how to transition.",
2021-10-11 16:51:59 +02:00
"maxProperties": 1,
"minProperties": 1,
"additionalProperties": {
"oneOf": [
2021-10-11 18:39:23 +02:00
{ "type": "string", "$ref": "../../molang/string.json" },
2022-07-22 19:41:04 +02:00
{ "type": "number", "description": "A blend weight." }
2021-10-11 16:51:59 +02:00
]
}
}
]
},
"particle_effect_spec": {
"additionalProperties": false,
"type": "object",
"required": ["effect"],
"properties": {
"bind_to_actor": {
"type": "boolean",
"title": "Bind To Actor",
"description": "Set to false to have the effect spawned in the world without being bound to an actor (by default an effect is bound to the actor).",
"const": false
},
2022-07-22 19:41:04 +02:00
"effect": { "type": "string", "title": "Effect", "description": "The name of a particle effect that should be played." },
"locator": { "type": "string", "title": "Locator", "description": "The name of a locator on the actor where the effect should be located." },
2021-10-11 16:51:59 +02:00
"pre_effect_script": {
"type": "string",
"title": "Pre Effect Script",
2022-07-22 19:41:04 +02:00
"description": "A molang script that will be run when the particle emitter is initialized.",
2021-10-11 16:51:59 +02:00
"pattern": "^.+;$"
}
}
2021-06-06 10:07:19 +00:00
},
2022-07-22 19:41:04 +02:00
"commands": { "type": "string", "description": "The event or commands to execute.", "pattern": "^(@s .+|/.+)$" }
2021-10-11 16:51:59 +02:00
},
"required": ["format_version", "animation_controllers"],
"additionalProperties": false,
"properties": {
"format_version": { "$ref": "../../general/format_version.json" },
"animation_controllers": {
"type": "object",
"title": "Animation Controllers Schema",
2022-07-22 19:41:04 +02:00
"description": "The animation controllers schema for.",
2021-10-11 16:51:59 +02:00
"propertyNames": {
"pattern": "^controller\\.animation\\.[a-z\\.]+",
"examples": ["controller.animation.example", "controller.animation.example.foo"]
},
"additionalProperties": {
"additionalProperties": false,
"type": "object",
"title": "A Animation Controller",
2022-07-22 19:41:04 +02:00
"description": "A single animation controller.",
2021-10-11 16:51:59 +02:00
"required": ["states"],
"minProperties": 1,
"properties": {
"states": {
"title": "States",
2022-07-22 19:41:04 +02:00
"description": "The states of this animation controller.",
2021-10-11 16:51:59 +02:00
"propertyNames": { "pattern": "[a-z\\.]+", "examples": ["default"] },
"minProperties": 1,
"type": "object",
"additionalProperties": {
"additionalProperties": false,
"title": "Animation State",
2022-07-22 19:41:04 +02:00
"description": "Animation state.",
2021-10-11 16:51:59 +02:00
"type": "object",
2022-02-08 16:19:02 +01:00
"examples": [
{
"animations": ["anim.idle"],
2022-03-24 13:10:07 +01:00
"transitions": [{ "example": "query.is_sheared" }]
2022-02-08 16:19:02 +01:00
}
],
2021-10-11 16:51:59 +02:00
"properties": {
"animations": {
"title": "Animations",
2022-07-22 19:41:04 +02:00
"description": "The animations definition for.",
2021-10-11 16:51:59 +02:00
"type": "array",
"items": { "$ref": "#/definitions/animationspec", "title": "Animations" }
},
"blend_transition": {
"title": "Blend Transition",
"oneOf": [
{
"type": "number",
2021-12-20 21:06:51 +01:00
"default": 0.1,
"minimum": 0,
2022-07-22 19:41:04 +02:00
"description": "A short-hand version of blend_out that simply sets the amount of time to fade out if the animation is interrupted."
2021-10-11 16:51:59 +02:00
},
{
"type": "object",
2022-07-22 19:41:04 +02:00
"description": "Specifies the cross-fade time in seconds when transitioning to another state.",
2021-10-11 16:51:59 +02:00
"additionalProperties": {
"type": "number",
"description": "Mapping of time since the animation was canceled, to the blend value at that time. A default key of time=0 to a blend value of 1.0 is provided if any other key is set and a blend value at time=0 hasn't already been set."
}
}
]
},
"blend_via_shortest_path": {
2022-07-22 19:41:04 +02:00
"description": "When blending a transition to another state, animate each euler axis through the shortest rotation, instead of by value.",
2021-10-11 16:51:59 +02:00
"type": "boolean",
"title": "Blend Via Shortest Path"
},
"particle_effects": {
2022-07-22 19:41:04 +02:00
"description": "The effects to be emitted.",
2021-10-11 16:51:59 +02:00
"type": "array",
"items": {
"$ref": "#/definitions/particle_effect_spec",
2022-07-22 19:41:04 +02:00
"description": "UNDOCUMENTED: particle effects.",
2021-10-11 16:51:59 +02:00
"title": "Particle Effects"
},
"title": "Particle Effects"
},
"sound_effects": {
"type": "array",
"description": "Collection of sounds to trigger on entry to this animation state.",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["effect"],
"properties": {
"effect": {
"description": "Valid sound effect names should be listed in the entity's resource_definition json file.",
"type": "string"
}
}
}
},
"transitions": {
"title": "Transition",
2022-07-22 19:41:04 +02:00
"description": "The transition definition for.",
2021-10-11 16:51:59 +02:00
"minProperties": 1,
"type": "array",
"items": {
"$ref": "#/definitions/animationspec",
2022-07-22 19:41:04 +02:00
"description": "The specification on when to transition to a new state.",
2021-10-11 16:51:59 +02:00
"title": "Transitions"
}
},
"variables": {
"type": "object",
"additionalProperties": {
"additionalProperties": false,
"type": "object",
"required": ["input"],
"properties": {
2021-10-11 18:39:23 +02:00
"input": { "$ref": "../../molang/number.json" },
2021-10-11 16:51:59 +02:00
"remap_curve": {
"title": "Remap Curve",
"type": "object",
"additionalProperties": { "propertyNames": { "pattern": "^([\\-\\+0-9]+|[\\-\\+0-9]+.[0-9]+)$" }, "type": "number" }
}
}
}
},
"on_entry": {
"title": "On Entry",
2022-07-22 19:41:04 +02:00
"description": "Sets molang on data on entry.",
2021-10-11 16:51:59 +02:00
"$comment": "UNDOCUMENTED",
"type": "array",
2022-07-22 19:41:04 +02:00
"items": { "pattern": "^.+=.+;$", "title": "Molang", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "type": "string" }
2021-10-11 16:51:59 +02:00
},
"on_exit": {
"title": "On Exit",
2022-07-22 19:41:04 +02:00
"description": "Sets molang on data on exit.",
2021-10-11 16:51:59 +02:00
"$comment": "UNDOCUMENTED",
"type": "array",
2022-07-22 19:41:04 +02:00
"items": { "pattern": "^.+=.+;$", "title": "Molang", "description": "UNDOCUMENTED.", "$comment": "UNDOCUMENTED", "type": "string" }
2021-10-11 16:51:59 +02:00
}
}
}
},
"initial_state": {
"type": "string",
2022-07-22 19:41:04 +02:00
"description": "The state to start with, if not specified state at position 0 in the array is used.",
2021-10-11 16:51:59 +02:00
"title": "Initial State"
}
}
}
}
}
2021-06-06 10:07:19 +00:00
}