{
	"format_version": "1.19.40",
	"minecraft:entity": {
		"description": {
			"identifier": "agp:decoy_siren",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"scripts": {
				"animate": [
					"sirenLoop",
					"sirenLoopStop",
					"SirenAllow",
					"SirenAllow2",
					"SirenStay",
					"GF_Siren"
				]
			},
			"animations": {
				"sirenLoop": "animation.sirenLoop",
				"sirenLoopStop": "animation.sirenLoopStop",
				"SirenAllow": "animation.SirenAllow",
				"SirenAllow2": "animation.SirenAllow2",
				"SirenStay": "animation.SirenStay",
				"GF_Siren": "animation.GF_Siren"
			}
		},
		"component_groups": {
			"Despawn": {
				"minecraft:instant_despawn": {}
			},
			"GetFam": {
				"minecraft:type_family": {
					"family": [
						"Siren",
						"SirenAble"
					]
				}
			},
			"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": [
					"Siren"
				]
			},
			"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_siren_block"
								},
								{
									"test": "has_tag",
									"operator": "!=",
									"value": "Despawning"
								}
							]
						},
						"event": "AllowDespawn",
						"target": "self"
					},
					{
						"filters": {
							"test": "distance_to_nearest_player",
							"subject": "self",
							"operator": "<=",
							"value": 30
						},
						"event": "AllowBlair",
						"target": "self"
					},
					{
						"filters": {
							"test": "distance_to_nearest_player",
							"subject": "self",
							"operator": ">",
							"value": 30
						},
						"event": "NoBlair",
						"target": "self"
					},
					{
						"filters": {
							"test": "has_tag",
							"subject": "self",
							"operator": "!=",
							"value": "AS"
						},
						"event": "RemoveNoAccess",
						"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_siren_block"
						},
						"randomize": [
							{
								"weight": 0.98,
								"run_command": {
									"command": [
										"function ResetSiren",
										"execute as @s[scores={SirenFunc=1}] run stopsound @a[r=30] MainSirens1",
										"tag @s add Despawning"
									]
								},
								"add": {
									"component_groups": [
										"DespawnTime"
									]
								}
							},
							{
								"weight": 0.02,
								"run_command": {
									"command": [
										"function ResetSiren",
										"execute as @s[scores={SirenFunc=1}] run stopsound @a[r=30] MainSirens1",
										"playsound MainSirensFade1 @a[r=30]",
										"tag @s add Despawning"
									]
								},
								"add": {
									"component_groups": [
										"DespawnTime"
									]
								}
							}
						]
					},
					{
						"filters": {
							"test": "in_block",
							"operator": "==",
							"value": "bridge:tornado_siren_block"
						},
						"randomize": [
							{
								"weight": 0.98,
								"run_command": {
									"command": [
										"function ResetSiren",
										"execute as @s[scores={SirenFunc=1}] run stopsound @a[r=30] MainSirens1",
										"execute as @s if block ~~~ bridge:tornado_siren_block run setblock ~~~ air",
										"tag @s add Despawning"
									]
								},
								"add": {
									"component_groups": [
										"Despawn"
									]
								}
							},
							{
								"weight": 0.02,
								"run_command": {
									"command": [
										"function ResetSiren",
										"execute as @s[scores={SirenFunc=1}] run stopsound @a[r=30] MainSirens1",
										"playsound MainSirensFade1 @a[r=30]",
										"execute as @s if block ~~~ bridge:tornado_siren_block run setblock ~~~ air",
										"tag @s add Despawning"
									]
								},
								"add": {
									"component_groups": [
										"Despawn"
									]
								}
							}
						]
					}
				]
			},
			"Despawn": {
				"add": {
					"component_groups": [
						"Despawn"
					]
				}
			},
			"RW": {
				"add": {
					"component_groups": [
						"GetFam"
					]
				}
			},
			"AllowBlair": {
				"run_command": {
					"command": [
						"tag @s add AS"
					]
				}
			},
			"NoBlair": {
				"run_command": {
					"command": [
						"tag @s remove AS"
					]
				}
			},
			"RemoveNoAccess": {
				"run_command": {
					"command": [
						"tag @s remove NoSiren"
					]
				}
			}
		}
	}
}