{
    "format_version": "1.19.0",
        "minecraft:entity": {
        "description": {
            "identifier": "your_namespace:huggy_entity",
                "is_spawnable": true,
                    "is_summonable": true
        },
        "components": {
            "minecraft:health": {
                "value": 20
            },
            "minecraft:can_fly": false
        },
        "events": {
            "check_block_above": {
                "sequence": [
                    {
                        "condition": "entity.get_tag",
                        "tag": "block_above"
                    },
                    {
                        "run_command": "execute @e[name=pc:inj_huggywuggy,tag=!checked] ~ ~ ~ detect ~ ~1 ~ minecraft:stone 0 run data merge entity @s {Animation: \"animation.huggy.vent\"}",
                        "before": {
                            "add": ["checked"]
                        }
                    },
                    {
                        "condition": "entity.has_tag",
                        "tag": "checked",
                        "then": {
                            "run_command": "execute @e[name=pc:inj_huggywuggy,tag=checked] ~ ~ ~ detect ~ ~1 ~ minecraft:air 0 run data merge entity @s {Animation: \"\"}",
                            "remove": ["checked"]
                        }
                    }
                ]
            }
        }
    }
}