{
	"format_version": "1.18.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:teleport_pad",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"duplication_check": "animation.teleport_pad.duplication_check",
				"effects_clear_clock": "animation.inanimate_entity.effect_clear_clock",
				//"ctrl.detect_player_test": "controller.animation.teleport_pad.detect_player_test",
				"ctrl.detect_player": "controller.animation.teleport_pad.detect_player"
			},
			"scripts": {
				"animate": [
					{ "duplication_check": "q.is_tamed" },
					"effects_clear_clock",
					//"ctrl.detect_player_test"
					{ "ctrl.detect_player": "q.property('ldz:in_range')" }
				]
			},
			"properties": {
				"ldz:in_range": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"ldz:powered": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"ldz:trigger": {
					"type": "int",
					"default": 0,
					"range": [ 0, 2 ],
					"client_sync": true
				}
			}
		},
		"component_groups": {
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			},
			"duplication_check_toggle": {
				"minecraft:is_tamed": {}
			},
			"beast_hub": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "beast_pad", "beast_pad_hub" ]
				},
				"minecraft:skin_id": {
					"value": 0
				}
			},
			"beast_dungeon": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "beast_pad", "beast_pad_dungeon" ]
				},
				"minecraft:skin_id": {
					"value": 0
				}
			},
			"mystic_hub": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "mystic_pad", "mystic_pad_hub" ]
				},
				"minecraft:skin_id": {
					"value": 1
				}
			},
			"mystic_dungeon": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "mystic_pad", "mystic_pad_dungeon" ]
				},
				"minecraft:skin_id": {
					"value": 1
				}
			},
			"scourge_hub": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "scourge_pad", "scourge_pad_hub" ]
				},
				"minecraft:skin_id": {
					"value": 2
				}
			},
			"scourge_dungeon": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "scourge_pad", "scourge_pad_dungeon" ]
				},
				"minecraft:skin_id": {
					"value": 2
				}
			},
			"wraith_hub": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "wraith_pad", "wraith_pad_hub" ]
				},
				"minecraft:skin_id": {
					"value": 3
				}
			},
			"wraith_dungeon": {
				"minecraft:type_family": {
					"family": [ "ldz", "teleport_pad", "wraith_pad", "wraith_pad_dungeon" ]
				},
				"minecraft:skin_id": {
					"value": 3
				}
			},
			"deactivated": {
				"minecraft:mark_variant": {
					"value": 0
				}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [ "ldz", "teleport_pad" ]
			},
			"minecraft:collision_box": {
				"height": 0,
				"width": 0
			},
			"minecraft:fire_immune": {},
			"minecraft:knockback_resistance": {
				"value": 100,
				"maximum": 100
			},
			"minecraft:environment_sensor": {
				"triggers": [
					{
						"filters": {
							"all_of": [
								{ "test": "distance_to_nearest_player", "operator": "<", "value": 16 },
								{ "test": "bool_property", "domain": "ldz:in_range", "value": false }
							]
						},
						"event": "set_in_range_to_true"
					},
					{
						"filters": {
							"all_of": [
								{ "test": "distance_to_nearest_player", "operator": ">=", "value": 16 },
								{ "test": "bool_property", "domain": "ldz:in_range", "value": true }
							]
						},
						"event": "set_in_range_to_false"
					}
				]
			},
			"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"
					]
				}
			},
			"beast_hub": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"beast_hub"
					]
				}
			},
			"beast_dungeon": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"beast_dungeon"
					]
				}
			},
			"mystic_hub": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"mystic_hub"
					]
				}
			},
			"mystic_dungeon": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"mystic_dungeon"
					]
				}
			},
			"scourge_hub": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"scourge_hub"
					]
				}
			},
			"scourge_dungeon": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"scourge_dungeon"
					]
				}
			},
			"wraith_hub": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"wraith_hub"
					]
				}
			},
			"wraith_dungeon": {
				"add": {
					"component_groups": [
						"duplication_check_toggle",
						"wraith_dungeon"
					]
				}
			},
			"set_in_range_to_true": {
				"set_property": {
					"ldz:in_range": true
				}
			},
			"set_in_range_to_false": {
				"set_property": {
					"ldz:in_range": false
				}
			},
			"set_powered_to_true": {
				"set_property": {
					"ldz:powered": true
				}
			},
			"set_powered_to_false": {
				"set_property": {
					"ldz:powered": false
				}
			},
			"set_trigger_to_0": {
				"set_property": {
					"ldz:trigger": 0
				}
			},
			"set_trigger_to_1": {
				"set_property": {
					"ldz:trigger": 1
				}
			},
			"set_trigger_to_2": {
				"set_property": {
					"ldz:trigger": 2
				}
			},
			"remove_duplication_check_toggle": {
				"remove": {
					"component_groups": [
						"duplication_check_toggle"
					]
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			}
		}
	}
}