From 87a9df91eec6a4805d55d8c099dc79a2ab56747d Mon Sep 17 00:00:00 2001 From: DaanV2 Date: Mon, 11 Oct 2021 19:10:26 +0200 Subject: [PATCH] Added --- .../entities/format/components/attack.json | 15 +++------------ .../entities/format/components/variant.json | 15 +++++++++------ .../format/components/water_movement.json | 6 +----- .../entities/format/types/range_number_type.json | 2 +- 4 files changed, 14 insertions(+), 24 deletions(-) diff --git a/source/behavior/entities/format/components/attack.json b/source/behavior/entities/format/components/attack.json index 57a27918..3f0fcae6 100644 --- a/source/behavior/entities/format/components/attack.json +++ b/source/behavior/entities/format/components/attack.json @@ -8,17 +8,8 @@ "properties": { "damage": { "title": "Damage", - "oneOf": [ - { - "type": "integer", - "default": 1, - "description": "Amount of damage the melee attack deals. A negative value can heal the entity instead of hurting it." - }, - { - "$ref": "../types/range_number_type.json", - "description": "Range of the random amount of damage the melee attack deals. A negative value can heal the entity instead of hurting it." - } - ] + "$ref": "../types/range_number_type.json", + "description": "Range of the random amount of damage the melee attack deals. A negative value can heal the entity instead of hurting it." }, "effect_name": { "type": "string", @@ -33,5 +24,5 @@ "title": "Effect Duration" } }, - "examples": [{ "damage": 0 }, { "damage": 0, "effect_name": "example", "effect_duration": 1 }] + "examples": [{ "damage": 1 }, { "damage": 1, "effect_name": "example", "effect_duration": 1 }] } diff --git a/source/behavior/entities/format/components/variant.json b/source/behavior/entities/format/components/variant.json index c9be88af..bb8c74f7 100644 --- a/source/behavior/entities/format/components/variant.json +++ b/source/behavior/entities/format/components/variant.json @@ -4,7 +4,14 @@ "type": "object", "title": "Variant", "description": "Used to differentiate the component group of a variant of an entity from others (e.g. ocelot, villager) Parameters", - "required": [], + "required": ["value"], + "defaultSnippets": [ + { + "label": "Variant", + "description": "New variant", + "body": { "value": "$1" } + } + ], "properties": { "value": { "type": "integer", @@ -13,9 +20,5 @@ "title": "Value" } }, - "examples": [ - { - "value": 0 - } - ] + "examples": [{ "value": 0 }, { "value": 1 }, { "value": 2 }, { "value": 3 }, { "value": 4 }, { "value": 5 }, { "value": 6 }, { "value": 7 }, { "value": 8 }, { "value": 9 }] } diff --git a/source/behavior/entities/format/components/water_movement.json b/source/behavior/entities/format/components/water_movement.json index b13887a6..3c798a01 100644 --- a/source/behavior/entities/format/components/water_movement.json +++ b/source/behavior/entities/format/components/water_movement.json @@ -13,9 +13,5 @@ "title": "Drag Factor" } }, - "examples": [ - { - "drag_factor": 0.8 - } - ] + "examples": [{ "drag_factor": 0.8 }] } diff --git a/source/behavior/entities/format/types/range_number_type.json b/source/behavior/entities/format/types/range_number_type.json index fb88c9ca..5e84c1d5 100644 --- a/source/behavior/entities/format/types/range_number_type.json +++ b/source/behavior/entities/format/types/range_number_type.json @@ -2,7 +2,7 @@ "$id": "blockception.minecraft.behavior.entities.type.range_number_type", "title": "Range [A, B]", "description": "A described range", - "examples": [[0.0, 1.0]], + "examples": [1, 2, 3, [0.0, 1.0]], "items": [ { "type": "number", "title": "A", "description": "The first value of the range" }, { "type": "number", "title": "B", "description": "The second value of the range" }