#I want the entity to take freeze damage if it takes freezing damage,but this is not working
1 messages · Page 1 of 1 (latest)
"minecraft:hurt_on_condition": {
"damage_conditions": [
{
"on_damage": {
"filters": {
"all_of": [
{
"test": "has_damage",
"target": "self",
"value": "freezing"
}
]
},
"cause": "freezing",
"damage_per_tick": 100
}
}
]
}
😭
no worked
hello
Patience. I don't know how "has_damage" filter works. But it does not work the way you think.
help me?
Hello
Hello?
Hello?
Hello
.
Alternatively you could use a damage sensor that multiplies/adds damage to freezing dmge cause.
If you want to stick to the has_damage filter, I suggest you first experiment with it. I couldn't get reliable results once in a similar case.
That's now how has_damage works, try something like this:
"damage_conditions": [
{
"filters": {
"test": "in_block",
"subject": "self",
"operator": "==",
"value": "powder_snow"
},
"cause": "freezing",
"damage_per_tick": 4
}
]
},```
It won't be perfect so you may want to use an animation instead to add damage after a certain amount of time in the block.
I want to test the damage type
fire, void...
you are testing the block that the entity is
yes, that's why I said underneath that you should use an animation or a controller to add time delay before adding damage. I suggested it as your example did not work.
I don't understand
You asked a question about adding freezing damage, I assumed that your example failed and like lava, freezing damage may not be automatically added. I sent you this hurt_on_condition component as a mediocre work around and suggested that you instead using an environmental sensor to check for in block and check for a dummy component/property in an animation controller with a timer variable condition to add the damage instead, this can be done with a hurt_on_condition, or an animation with the /damage command.
help me
?
hello
Hello
Hello
What specifically are you confused about?
@radiant tusk
no worked
Use this env sensor to add a dummy component or property:
"minecraft:environment_sensor": {
"triggers": [
{
"filters": {
"test": "in_block",
"value": "powder_snow",
"subject": "self",
"operator": "=="
},
"target": "self",
"event": "powdered_snow"
},
{
"filters": {
"test": "in_block",
"value": "powder_snow",
"subject": "self",
"operator": "!="
},
"target": "self",
"event": "not_powdered_snow"
}
]
}
Dummy Components: https://wiki.bedrock.dev/entities/dummy-components.html#top
Properties: https://wiki.bedrock.dev/entities/entity-properties.html#top
Then create a behaviour side animation controller
Modify this code:
{
"format_version": "1.19.50",
"animation_controllers": {
"controller.animation.entity_name.freezing_dmg": {
"initial_state": "default",
"states": {
"default": {
"transitions": [
{
"powdered_snow": "v.delay = q.life_time; return query.property('namespace:name') == true;"
}
]
},
"powdered_snow": {
"transitions": [
{
"default": "query.property('namespace:name') == false"
},
{
"damage_animation": "(q.life_time - v.delay) > 2"
}
]
},
"damage_animation": {
"transitions": [
{
"default": "query.property('namespace:name') == false"
}
],
"animations": [
"freezing_damage"
]
}
}
}
}
}
Add an animation with this code:
{
"format_version": "1.19.50",
"animations": {
"animation.entity_name.freezing_dmg": {
"loop": true,
"animation_length": 2,
"timeline": {
"0.0": [
"/damage @s 2 freezing"
]
}
}
}
}