{
	"format_version": "1.19.40",
	"minecraft:entity": {
		"description": {
			"identifier": "agp:decoy_radar",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"scripts": {
				"animate": [
					"Radar_Indicators",
					"RadarAllow",
					"RadarAllow2",
					"RadarAllow3",
					"GF_Radar",
					"FormBoard"
				]
			},
			"animations": {
				"Radar_Indicators": "animation.Radar_Indicators",
				"RadarAllow": "animation.RadarAllow",
				"RadarAllow2": "animation.RadarAllow2",
				"RadarAllow3": "animation.RadarAllow3",
				"GF_Radar": "animation.GF_Radar",
				"FormBoard": "animation.FormBoard"
			}
		},
		"component_groups": {
			"Despawn": {
				"minecraft:instant_despawn": {}
			},
			"GetFam": {
				"minecraft:type_family": {
					"family": [
						"Radar",
						"RadarAble"
					]
				}
			},
			"DespawnTime": {
				"minecraft:timer": {
					"looping": false,
					"time": [
						0.5,
						0.5
					],
					"time_down_event": {
						"filters": {
							"test": "has_tag",
							"value": "Despawning"
						},
						"event": "Despawn"
					}
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [
					"Radar"
				]
			},
			"minecraft:tick_world": {
				"never_despawn": true
			},
			"minecraft:nameable": {
				"always_show": true,
				"allow_name_tag_renaming": true
			},
			"minecraft:collision_box": {
				"width": 0.0001,
				"height": 0.0001
			},
			"minecraft:health": {
				"min": 1000000,
				"max": 1000000
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "all",
						"deals_damage": false
					}
				]
			},
			"minecraft:environment_sensor": {
				"triggers": [
					{
						"filters": {
							"all_of": [
								{
									"test": "in_block",
									"operator": "!=",
									"value": "bridge:tornado_radar_block"
								},
								{
									"test": "has_tag",
									"operator": "!=",
									"value": "Despawning"
								}
							]
						},
						"event": "AllowDespawn",
						"target": "self"
					},
					{
						"filters": {
							"test": "distance_to_nearest_player",
							"subject": "self",
							"operator": "<=",
							"value": 30
						},
						"event": "AllowRadar",
						"target": "self"
					},
					{
						"filters": {
							"test": "distance_to_nearest_player",
							"subject": "self",
							"operator": ">",
							"value": 30
						},
						"event": "NoRadar",
						"target": "self"
					},
					{
						"filters": {
							"test": "has_tag",
							"subject": "self",
							"operator": "!=",
							"value": "AR"
						},
						"event": "RemoveNoAccess",
						"target": "self"
					},
					{
						"filters": {
							"test": "has_mob_effect",
							"operator": "=="
						},
						"event": "clearEffect",
						"target": "self"
					}
				]
			},
			"minecraft:physics": {
				"has_gravity": false,
				"has_collision": false
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": true
			}
		},
		"events": {
			"AllowDespawn": {
				"sequence": [
					{
						"filters": {
							"test": "in_block",
							"operator": "!=",
							"value": "bridge:tornado_radar_block"
						},
						"run_command": {
							"command": [
								"function ResetRadar",
								"tag @s add Despawning"
							]
						},
						"add": {
							"component_groups": [
								"DespawnTime"
							]
						}
					},
					{
						"filters": {
							"test": "in_block",
							"operator": "==",
							"value": "bridge:tornado_radar_block"
						},
						"run_command": {
							"command": [
								"function ResetRadar",
								"execute as @s at @s if block ~~~ bridge:tornado_radar_block run setblock ~~~ air",
								"tag @s add Despawning"
							]
						},
						"add": {
							"component_groups": [
								"Despawn"
							]
						}
					}
				]
			},
			"Despawn": {
				"add": {
					"component_groups": [
						"Despawn"
					]
				}
			},
			"RW": {
				"add": {
					"component_groups": [
						"GetFam"
					]
				}
			},
			"AllowRadar": {
				"run_command": {
					"command": [
						"tag @s add AR"
					]
				}
			},
			"NoRadar": {
				"run_command": {
					"command": [
						"tag @s remove AR"
					]
				}
			},
			"RemoveNoAccess": {
				"run_command": {
					"command": [
						"tag @s remove NoRadar"
					]
				}
			},
			"clearEffect": {
				"run_command": {
					"command": [
						"effect @s clear"
					]
				}
			}
		}
	}
}