{
	"format_version": "1.18.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:troll_knockback",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"properties": {
				
				"ldz:ice_overlay": {
					"type": "bool",
					"client_sync": true,
					"default": false
				}
			}
		},
		"component_groups": {
			
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			},
			"player_spawned_delay": {
				"minecraft:type_family": {
					"family": [
						"ldz",
						"troll_knockback",
						"player_morph_attack"
					]
				},
				"minecraft:timer": {
					"time": 1,
					"looping": true,
					"time_down_event": {
						"event": "add_player_attack",
						"target": "self"
					}
				}
			},
			"troll_spawned_delay": {
				"minecraft:type_family": {
					"family": [
						"ldz",
						"troll_knockback",
						"ender_troll_attack"
					]
				},
				"minecraft:timer": {
					"time": 1,
					"looping": true,
					"time_down_event": {
						"event": "add_troll_attack",
						"target": "self"
					}
				}
			},
			//summoned by player using ender_troll morph attack
			"player_attack": {
				"minecraft:behavior.knockback_roar": {
					"attack_time": 0.05,
					"cooldown_time": 0,
					"duration": 0,
					"knockback_damage": 9,
					"damage_filters": [
						{
							"test": "is_family",
							"subject": "other",
							"operator": "!=",
							"value": "player"
						}
					],
					"knockback_filters": [
						{
							"test": "is_family",
							"subject": "other",
							"operator": "!=",
							"value": "player"
						}
					],
					"knockback_horizontal_strength": 0,
					"knockback_range": 5,
					"knockback_vertical_strength": 3,
					"knockback_height_cap": 1,
					"priority": 0,
					"on_roar_end": {
						"event": "despawn"
					}
				}
			},
			//summoned by ldz:ender_troll attack
			"troll_attack": {
				"minecraft:behavior.knockback_roar": {
					"attack_time": 0.05,
					"cooldown_time": 0,
					"duration": 0,
					"knockback_damage": 1,
					"damage_filters": [
						{
							"all_of": [
								{
									"test": "has_tag",
									"operator": "!=",
									"value": "benign"
								},
								{
									"test": "is_family",
									"subject": "other",
									"operator": "!=",
									"value": "ender_troll"
								}
							]
							
						}
					],
					"knockback_filters": [
						{
							"all_of": [
								{
									"test": "has_tag",
									"operator": "!=",
									"value": "benign"
								},
								{
									"test": "is_family",
									"subject": "other",
									"operator": "!=",
									"value": "ender_troll"
								}
							]
							
						}
					],
					"knockback_horizontal_strength": 0,
					"knockback_range": 4,
					"knockback_vertical_strength": 2,
					"knockback_height_cap": 1,
					"priority": 0,
					"on_roar_end": {
						"event": "despawn"
					}
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"ldz",
					"troll_knockback"
				]
			},
			"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_spawned": {
				"add": {
					"component_groups": [
						"player_spawned_delay"
					]
				}
			},
			"add_troll_spawned": {
				"add": {
					"component_groups": [
						"troll_spawned_delay"
					]
				}
			},
			"add_player_attack": {
				"add": {
					"component_groups": [
						"player_attack"
					]
				}
			},
			"add_troll_attack": {
				"add": {
					"component_groups": [
						"troll_attack"
					]
				}
			},
			"set_ice_overlay_to_true": {
				"set_property": {
					"ldz:ice_overlay": true
				}
			},
			"set_ice_overlay_to_false": {
				"set_property": {
					"ldz:ice_overlay": false
				}
			}
		}
	}
}