Files

112 lines
4.3 KiB
JSON
Raw Permalink Normal View History

2021-10-08 12:59:03 +02:00
{
2021-10-08 13:04:13 +02:00
"$id": "blockception.minecraft.behavior.entities.minecraft.leashable",
2021-10-08 12:59:03 +02:00
"type": "object",
2021-10-08 13:04:13 +02:00
"title": "Leashable",
"description": "Allows this entity to be leashed and defines the conditions and events for this entity when is leashed.",
2021-10-08 12:59:03 +02:00
"additionalProperties": false,
"definitions": {
2021-10-08 12:59:03 +02:00
"hard_distance": {
"type": "number",
"default": 6,
"description": "Distance in blocks at which the leash stiffens, restricting movement.",
"title": "Hard Distance"
},
2021-10-11 18:10:42 +02:00
"max_distance": {
"type": "number",
"default": 10,
"description": "Distance in blocks at which the leash breaks.",
"title": "Maximum Distance"
},
"soft_distance": {
"type": "number",
"default": 4,
"description": "Distance in blocks at which the `spring` effect starts acting to keep this entity close to the entity that leashed it.",
"title": "Soft Distance"
}
},
"properties": {
"can_be_cut": {
"title": "Can Be Cut",
"description": "If true, players can cut both incoming and outgoing leashes by using shears on the entity.",
"type": "boolean",
"default": true
},
"can_be_stolen": {
"type": "boolean",
"default": false,
"description": "If true, players can leash this entity even if it is already leashed to another mob.",
"title": "Can Be Stolen"
},
"on_unleash_interact_only": {
"title": "On Unleash Interact Only",
"description": "When set to true, \"on_unleash\" does not trigger when the entity gets unleashed for other reasons such as being stolen or the leash breaking.",
"type": "boolean",
"default": false
},
"hard_distance": {
"$ref": "#/definitions/hard_distance"
},
"max_distance": {
"$ref": "#/definitions/max_distance"
},
2021-10-11 18:10:42 +02:00
"on_leash": {
"$ref": "../types/event_object.json",
2021-10-11 18:10:42 +02:00
"description": "Event to call when this entity is leashed.",
"title": "On Leash"
},
"on_unleash": {
"$ref": "../types/event_object.json",
2021-10-11 18:10:42 +02:00
"description": "Event to call when this entity is unleashed.",
"title": "On Unleash"
},
2021-10-08 12:59:03 +02:00
"soft_distance": {
"$ref": "#/definitions/soft_distance"
},
"presets": {
"title": "Presets",
"description": "Defines how this entity behaves when leashed to another entity. A preset is selected upon leashing and remains until the entity is leashed to something else. The first preset whose \"filter\" conditions are met will be applied; if none match, a default configuration is used instead.",
"type": "array",
"items": {
"title": "Preset",
"type": "object",
"additionalProperties": false,
"properties": {
"filter": {
"$ref": "../../filters/filters.json"
},
"hard_distance": {
"$ref": "#/definitions/hard_distance"
},
"max_distance": {
"$ref": "#/definitions/max_distance"
},
"soft_distance": {
"$ref": "#/definitions/soft_distance"
},
"rotation_adjustment": {
"title": "Rotation Adjustment",
"description": "Adjusts the rotation at which the entity reaches equilibrium, when \"spring_type\" is set to \"dampened\" or \"quad_dampened\"",
"type": "number",
"default": 0
},
"spring_type": {
"title": "Spring Type",
"description": "Defines the type of spring-like force that pulls the entity towards its leash holder:\n- \"bouncy\": Simulates a highly elastic spring that never reaches an equilibrium if the leashed entity is suspended mid-air.\n- \"dampened\": Simulates a dampened spring attached to the front of the leashed entity's collision. It reaches an equilibrium if the entity is suspended mid-air and aligns with the movement direction.\n- \"quad_dampened\": Simulates four dampened springs connected to the center of each side of the entities' collisions. It reaches an equilibrium if the entity is suspended mid-air and gradually aligns with the leash holder over time.",
"default": "dampened",
"type": "string",
"enum": ["bouncy", "dampened", "quad_dampened"]
}
}
}
2021-10-08 12:59:03 +02:00
}
2021-10-11 18:10:42 +02:00
},
"examples": [
{
"can_be_stolen": false,
"hard_distance": 6,
"max_distance": 10,
"soft_distance": 4
}
]
2021-10-08 12:59:03 +02:00
}