{
	"format_version": "1.18.2",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:ender_scorcher_projectile",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"properties": {
				"ldz:player_spawned": {
					"type": "bool",
					"default": false
				},
				"ldz:extinguish": {
					"type": "bool",
					"default": false
				}
			},
			"animations": {
				"enderman_attack": "animation.ender_scorcher_projectile.enderman_attack",
				"player_attack": "animation.ender_scorcher_projectile.player_attack",
				"movement": "animation.ender_scorcher_projectile.movement",
				"extinguish": "animation.ender_scorcher_projectile.extinguish"
			},
			"scripts": {
				"animate": [
					{
						"enderman_attack": "!q.property('ldz:player_spawned')"
					},
					{
						"player_attack": "q.property('ldz:player_spawned')"
					},
					{
						"movement": "!query.has_target"
					},
					{
						"extinguish": "q.property('ldz:extinguish')"
					}
				]
			}
		},
		"component_groups": {
			"despawn": {
				"minecraft:instant_despawn": {}
			},
			"player_spawned": {
				"minecraft:movement": {
					"value": 0.3
				},
				"minecraft:timer": {
					"time": 5,
					"looping": true,
					"time_down_event": {
						"event": "despawn",
						"target": "self"
					}
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"ldz",
					"ender_scorcher_projectile"
				]
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:navigation.walk": {
				"avoid_damage_blocks": true,
				"avoid_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:collision_box": {
				"width": 0,
				"height": 0
			},
			"minecraft:custom_hit_test": {
				"hitboxes": [
					{
						"width": 3,
						"height": 3,
						"pivot": [
							0,
							1.5,
							0
						]
					}
				]
			},
			"minecraft:physics": {},
			"minecraft:attack": {
				"damage": 1
			},
			"minecraft:behavior.nearest_prioritized_attackable_target": {
				"priority": 0,
				"entity_types": [
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"value": "player",
									"subject": "other"
								},
								{
									"test": "bool_property",
									"domain": "ldz:player_spawned",
									"value": false
								}
							]
						}
					},
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"value": "monster",
									"subject": "other"
								},
								{
									"test": "bool_property",
									"domain": "ldz:player_spawned",
									"value": true
								}
							]
						}
					}
				]
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "entity_attack",
						"on_damage": {
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "player"
							},
							"event": "set_extinguish_to_true"
						},
						"deals_damage": false
					},
					{
						"cause": "all",
						"deals_damage": false
					}
				]
			},
			"minecraft:behavior.melee_attack": {
				"priority": 1,
				"speed_multiplier": 1.2,
				"reach_multiplier": 0
			},
			"minecraft:timer": {
				"time": 4,
				"looping": true,
				"time_down_event": {
					"event": "despawn",
					"target": "self"
				}
			}
		},
		"events": {
			"despawn": {
				"add": {
					"component_groups": [
						"despawn"
					]
				}
			},
			"set_player_spawned_to_true": {
				"sequence": [
					{
						"set_property": {
							"ldz:player_spawned": true
						}
					},
					{
						"add": {
							"component_groups": [
								"player_spawned"
							]
						}
					}
				]
			},
			"set_player_spawned_to_false": {
				"set_property": {
					"ldz:player_spawned": false
				}
			},
			"set_extinguish_to_true": {
				"set_property": {
					"ldz:extinguish": true
				}
			},
			"set_extinguish_to_false": {
				"set_property": {
					"ldz:extinguish": false
				}
			}
		}
	}
}