{
	"format_version": "1.19.50",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:ender_scourge_projectile",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"properties": {
				"ldz:player_spawned": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				
				"ldz:ice_overlay": {
					"type": "bool",
					"client_sync": true,
					"default": false
				}
			},
			"animations": {
				"enderman_attack": "animation.ender_scourge_projectile.enderman_attack",
				"player_attack": "animation.ender_scourge_projectile.player_attack"
			},
			"scripts": {
				"animate": [
					{
						"enderman_attack": "!q.property('ldz:player_spawned')"
					},
					{
						"player_attack": "q.property('ldz:player_spawned')"
					}
				]
			}
		},
		"component_groups": {
			"ice_overlay":{
				"minecraft:is_shaking": {}
			},
			
			"enderman_spawned": {
				"minecraft:mob_effect": {
					"effect_range": 1,
					"mob_effect": "poison",
					"effect_time": 4,
					"entity_filter": {
						"any_of": [
							{
								"test": "is_family",
								"subject": "other",
								"value": "player"
							},
							{
								"test": "is_family",
								"subject": "other",
								"value": "snowgolem"
							},
							{
								"test": "is_family",
								"subject": "other",
								"value": "irongolem"
							},
							{
								"test": "is_family",
								"subject": "other",
								"value": "wandering_trader"
							},
							{
								"all_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "villager"
									},
									{
										"test": "has_component",
										"subject": "other",
										"operator": "!=",
										"value": "minecraft:is_baby"
									}
								]
							}
						]
					}
				}
			},
			"player_spawned": {
			},
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"ldz",
					"projectile",
					"ender_scourge_projectile"
				]
			},
			"minecraft:timer": {
				"time": 0.5,
				"looping": true,
				"time_down_event": {
					"event": "despawn"
				}
			},
			"minecraft:environment_sensor": {
				"triggers": [
					{
						"filters": [
							{
								"test": "is_difficulty",
								"value": "peaceful"
							}
						],
						"event": "despawn",
						"target": "self"
					}
				]
			},
			"minecraft:collision_box": {
				"width": 0,
				"height": 0
			},
			"minecraft:health": {
				"value": 999,
				"max": 999
			},
			"minecraft:despawn": {
				"despawn_from_distance": {}
			},
			"minecraft:damage_sensor": {
				"triggers": {
					"cause": "all",
					"deals_damage": false
				}
			},
			"minecraft:physics": {
				"has_collision": false,
				"has_gravity": false
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			}
		},
		"events": {
			"add_enderman_spawned": {
				"set_property": {
					"ldz:player_spawned": false
				},
				"add": {
					"component_groups": [
						"enderman_spawned"
					]
				}
			},
			"add_player_spawned": {
				"set_property": {
					"ldz:player_spawned": true
				},
				"add": {
					"component_groups": [
						"player_spawned"
					]
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			},
			"set_ice_overlay_to_true": {
				"set_property": {
					"ldz:ice_overlay": true
				},
				"add": {
					"component_groups": [
						"ice_overlay"
					]
				}
			},
			"set_ice_overlay_to_false": {
				"set_property": {
					"ldz:ice_overlay": false
				},
				"remove": {
					"component_groups": [
						"ice_overlay"
					]
				}
			}
		}
	}
}