#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)

hidden shale
#
     "minecraft:hurt_on_condition": {
      "damage_conditions": [
        {
          "filters": { "test": "has_damage", "value": "freezing" },
          "cause": "freezing",
          "damage_per_tick": 100
        }
      ]
     }
#
     "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

hidden shale
#

hello

trail matrix
#

Patience. I don't know how "has_damage" filter works. But it does not work the way you think.

hidden shale
#

Hello

hidden shale
#

Hello?

hidden shale
#

Hello?

trail matrix
#

Hello

trail matrix
#

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.

radiant tusk
# hidden shale ``` "minecraft:hurt_on_condition": { "damage_conditions": [ {...

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.
hidden shale
#

fire, void...

#

you are testing the block that the entity is

radiant tusk
radiant tusk
# hidden shale 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.

radiant tusk
#

?

hidden shale
#

;-;

#

I do not know how to do

hidden shale
#

hello

hidden shale
#

Hello

hidden shale
#

Hello

radiant tusk
#

What specifically are you confused about?

hidden shale
#

no worked

radiant tusk
#

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"
                ]
            }
        }
    }
}