fix: damage_sensor | triggers | deals_damage accept string only (#328)

* damage_sensor.triggers.deals_damage accept string only
* fixing the damage_sensor json

---------

Co-authored-by: Daan Verstraten <daanverstraten@hotmail.com>
This commit is contained in:
Nguyễn Văn Đức
2024-12-03 15:24:35 +07:00
committed by GitHub
parent dc8c1c3f69
commit 160f09a092

View File

@@ -9,7 +9,7 @@
"triggers": [ "triggers": [
{ {
"cause": "all", "cause": "all",
"deals_damage": false "deals_damage": "no"
} }
] ]
}, },
@@ -17,7 +17,7 @@
"triggers": [ "triggers": [
{ {
"on_damage": { "filters": { "test": "has_damage", "subject": "self", "value": "fatal" } }, "on_damage": { "filters": { "test": "has_damage", "subject": "self", "value": "fatal" } },
"deals_damage": false "deals_damage": "no"
} }
] ]
} }
@@ -49,20 +49,10 @@
"title": "Damage Multiplier" "title": "Damage Multiplier"
}, },
"deals_damage": { "deals_damage": {
"anyOf": [ "title": "Deals Damage",
{ "description": "Defines how received damage affects the entity:\n- 'yes', received damage is applied to the entity.\n- 'no', received damage is not applied to the entity.\n- 'no_but_side_effects_apply', received damage is not applied to the entity, but the side effects of the attack are. This means that the attacker's weapon loses durability, enchantment side effects are applied, and so on.",
"type": "boolean", "enum": [ "yes", "no", "no_but_side_effects_apply" ],
"default": true, "default": "yes",
"description": "If true, the damage dealt to the entity will take away health from it, set to false to make the entity ignore that damage.",
"title": "Deals Damage"
},
{
"default": "yes",
"title": "Deals Damage",
"enum": [ "yes", "no", "no_but_side_effects_apply" ],
"description": "Defines how received damage affects the entity:\n- 'yes', received damage is applied to the entity.\n- 'no', received damage is not applied to the entity.\n- 'no_but_side_effects_apply', received damage is not applied to the entity, but the side effects of the attack are. This means that the attacker's weapon loses durability, enchantment side effects are applied, and so on."
}
]
}, },
"on_damage": { "on_damage": {
"type": "object", "type": "object",
@@ -86,7 +76,7 @@
[ [
{ {
"cause": "all", "cause": "all",
"deals_damage": false "deals_damage": "no"
} }
] ]
], ],