{
	"format_version": "1.18.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:dungeon_spawner",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"delay": "animation.dungeon_spawner.delay",
				"ctrl.detect": "controller.animation.dungeon_spawner.detect"
			},
			"scripts": {
				"animate": [
					"ctrl.detect"
				]
			},
			"properties": {
				"ldz:allow_spawning": {
					"default": false,
					"type": "bool",
					"client_sync": true
				}
			}
		},
		"component_groups": {
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			},
			"main_island": {
				"minecraft:type_family": {
					"family": [ "ldz", "dungeon_spawner", "main_island_spawner" ]
				}
			},
			"beast": {
				"minecraft:type_family": {
					"family": [ "ldz", "dungeon_spawner", "beast_spawner" ]
				}
			},
			"mystic": {
				"minecraft:type_family": {
					"family": [ "ldz", "dungeon_spawner", "mystic_spawner" ]
				}
			},
			"scourge": {
				"minecraft:type_family": {
					"family": [ "ldz", "dungeon_spawner", "scourge_spawner" ]
				}
			},
			"wraith": {
				"minecraft:type_family": {
					"family": [ "ldz", "dungeon_spawner", "wraith_spawner" ]
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [ "ldz", "dungeon_spawner" ]
			},
			"minecraft:collision_box": {
				"height": 0,
				"width": 0
			},
			"minecraft:knockback_resistance": {
				"value": 100,
				"maximum": 100
			},
			"minecraft:fire_immune": {},
			"minecraft:timer": {
				"time": 0.5,
				"looping": true,
				"time_down_event": {
					"event": "despawn"
				}
			},
			"minecraft:environment_sensor": {
				"triggers": [
					{
						"filters": {
							"all_of": [
								{ "test": "bool_property", "domain": "ldz:allow_spawning", "value": false },
								{ "test": "is_difficulty", "operator": "!=", "value": "peaceful" },
								{ "test": "distance_to_nearest_player", "operator": ">", "value": 16 }
							]
						},
						"event": "set_allow_spawning_to_true"
					}
				]
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"on_damage": {
							"filters": {
								"test": "has_damage",
								"value": "void"
							},
							"event": "despawn"
						},
						"deals_damage": false
					},
					{
						"cause": "all",
						"deals_damage": false
					}
				]
			},
			"minecraft:physics": {
				"has_collision": false,
				"has_gravity": false
			},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			},
			"set_allow_spawning_to_true": {
				"set_property": {
					"ldz:allow_spawning": true
				}
			},
			"main_island": {
				"add": {
					"component_groups": [
						"main_island"
					]
				}
			},
			"beast": {
				"add": {
					"component_groups": [
						"beast"
					]
				}
			},
			"mystic": {
				"add": {
					"component_groups": [
						"mystic"
					]
				}
			},
			"scourge": {
				"add": {
					"component_groups": [
						"scourge"
					]
				}
			},
			"wraith": {
				"add": {
					"component_groups": [
						"wraith"
					]
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			}
		}
	}
}