{
    "format_version": "1.18.0",
    "minecraft:entity": {
        "description": {
            "identifier": "ldz:ender_beast_attack",
            "is_spawnable": false,
            "is_summonable": true,
            "is_experimental": false
        },
        "component_groups": {
            "instant_despawn": {
                "minecraft:instant_despawn": {}
            },
			"player_attack":{
				"minecraft:behavior.knockback_roar": {
					"attack_time": 0.05,
					"cooldown_time": 0,
					"duration": 0,
					"knockback_damage": 15,
					"damage_filters": [
						{ "test": "is_family", "subject": "other", "operator": "!=", "value": "player" },
						{ "test": "has_tag", "subject": "other", "operator": "=", "value": "BeastKnockback" }
					],
					"knockback_filters": [
						{ "test": "is_family", "subject": "other", "operator": "!=", "value": "player" },
						{ "test": "has_tag", "subject": "other", "operator": "=", "value": "BeastKnockback" }
					],
					"knockback_horizontal_strength": 7,
					"knockback_range": 5,
					"knockback_vertical_strength": 4,
					"knockback_height_cap": 0.3,
					"priority": 0,
					"on_roar_end": { "event": "despawn" }
				}
			},
			"beast_attack":{
				"minecraft:behavior.knockback_roar": {
					"attack_time": 0.05,
					"cooldown_time": 0,
					"duration": 0,
					"knockback_damage": 2,
					"damage_filters": [
						{ "test": "is_family", "subject": "other", "operator": "=", "value": "player" }							
					],
					"knockback_filters": [
						{ "test": "is_family", "subject": "other", "operator": "=", "value": "player" }
					],
					"knockback_horizontal_strength": 4,
					"knockback_range": 4,
					"knockback_vertical_strength": 1,
					"knockback_height_cap": 0.3,
					"priority": 0,
					"on_roar_end": { "event": "despawn" }
				}
			}
        },
        "components": {
            "minecraft:type_family": {
                "family": [
                    "ldz",
                    "ender_beast_attack"
                ]
            },
            "minecraft:collision_box": {
                "height": 0,
                "width": 0
            },
            "minecraft:physics": {
                "has_collision": false,
                "has_gravity": false
            },
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			},
		    "minecraft:damage_sensor": {
                "triggers": [
                    {
                        "on_damage": {
                            "filters": {
                                "test": "has_damage",
                                "value": "void"
                            },
                            "event": "despawn"
                        },
                        "deals_damage": false
                    },
                    {
                        "cause": "all",
                        "deals_damage": false
                    }
                ]
            }
        },
        "events": {
            "despawn"				: { "add": { "component_groups": [ "instant_despawn"  ] } },
			"add_player_attack"		: { "add": { "component_groups": [ "player_attack" ] } },
			"add_beast_attack"		: { "add": { "component_groups": [ "beast_attack" ] } }
        }
    }
}