{
	"format_version": "1.18.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:fares_portal",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"delay_1": "animation.fares_portal.delay_1",
				"delay_2": "animation.fares_portal.delay_2",
				"duplication_check": "animation.fares_portal.duplication_check",
				"effects_clear_clock": "animation.inanimate_entity.effect_clear_clock",
				"intro_version_delay": "animation.fares_portal.intro_version_delay",
				"power_down_delay": "animation.fares_portal.power_down_delay",
				"ctrl.morph_check": "controller.animation.fares_portal.morph_check",
				"ctrl.detect_ender_lord": "controller.animation.fares_portal.detect_ender_lord",
				"ctrl.detect_player": "controller.animation.fares_portal.detect_player",

				"open_cells": "animation.fares_portal.open_cells",
				"jail_softlock_check": "animation.fares_portal.jail_softlock_check",

				"teleport_to_overworld": "animation.fares_portal.teleport_to_overworld"
			},
			"scripts": {
				"animate": [
					"effects_clear_clock",
					{ "duplication_check": "q.is_tamed" },
					"ctrl.morph_check",

					"jail_softlock_check",
					{ "open_cells": "q.property('ldz:cell_status') == 'opening'" },
					{ "teleport_to_overworld": "q.property('ldz:hide_pedestals')" }
				]
			},
			"properties": {
				"ldz:intro_version": { "type": "int", "default": 0, "range": [ 0, 3 ], "client_sync": true },

				"ldz:portal_swirl": { "type": "bool", "default": false, "client_sync": true },

				"ldz:beast": { "type": "bool", "default": false, "client_sync": true },
				"ldz:charger": { "type": "bool", "default": false, "client_sync": true },
				"ldz:chef": { "type": "bool", "default": false, "client_sync": true },
				"ldz:chiller": { "type": "bool", "default": false, "client_sync": true },
				"ldz:gardener": { "type": "bool", "default": false, "client_sync": true },
				"ldz:hydro": { "type": "bool", "default": false, "client_sync": true },
				"ldz:mystic": { "type": "bool", "default": false, "client_sync": true },
				"ldz:scorcher": { "type": "bool", "default": false, "client_sync": true },
				"ldz:scourge": { "type": "bool", "default": false, "client_sync": true },
				"ldz:troll": { "type": "bool", "default": false, "client_sync": true },
				"ldz:vanilla": { "type": "bool", "default": false, "client_sync": true },
				"ldz:wraith": { "type": "bool", "default": false, "client_sync": true },

				"ldz:cell_status": { "type": "enum", "values": [ "closed", "opening", "opened" ], "default": "closed", "client_sync": true },

				"ldz:hide_pedestals": { "type": "bool", "default": false, "client_sync": true }
			}
		},
		"component_groups": {
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			},
			"duplication_check_toggle": {
				"minecraft:is_tamed": {}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [ "ldz", "fares_portal" ]
			},
			"minecraft:collision_box": {
				"height": 0,
				"width": 0
			},
			"minecraft:fire_immune": {},
			"minecraft:knockback_resistance": {
				"value": 100,
				"maximum": 100
			},
			"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
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"duplication_check_toggle"
					]
				}
			},
			"set_intro_version_to_0": { "set_property": { "ldz:intro_version": 0 } },
			"set_intro_version_to_1": { "set_property": { "ldz:intro_version": 1 } },
			"set_intro_version_to_2": { "set_property": { "ldz:intro_version": 2 } },
			"set_intro_version_to_3": { "set_property": { "ldz:intro_version": 3 } },

			"set_portal_swirl_to_false": { "set_property": { "ldz:portal_swirl": false } },
			"set_portal_swirl_to_true": { "set_property": { "ldz:portal_swirl": true } },

			"set_beast_to_false": { "set_property": { "ldz:beast": false } },
			"set_beast_to_true": { "set_property": { "ldz:beast": true } },
			"set_charger_to_false": { "set_property": { "ldz:charger": false } },
			"set_charger_to_true": { "set_property": { "ldz:charger": true } },
			"set_chef_to_false": { "set_property": { "ldz:chef": false } },
			"set_chef_to_true": { "set_property": { "ldz:chef": true } },
			"set_chiller_to_false": { "set_property": { "ldz:chiller": false } },
			"set_chiller_to_true": { "set_property": { "ldz:chiller": true } },
			"set_gardener_to_false": { "set_property": { "ldz:gardener": false } },
			"set_gardener_to_true": { "set_property": { "ldz:gardener": true } },
			"set_hydro_to_false": { "set_property": { "ldz:hydro": false } },
			"set_hydro_to_true": { "set_property": { "ldz:hydro": true } },
			"set_mystic_to_false": { "set_property": { "ldz:mystic": false } },
			"set_mystic_to_true": { "set_property": { "ldz:mystic": true } },
			"set_scorcher_to_false": { "set_property": { "ldz:scorcher": false } },
			"set_scorcher_to_true": { "set_property": { "ldz:scorcher": true } },
			"set_scourge_to_false": { "set_property": { "ldz:scourge": false } },
			"set_scourge_to_true": { "set_property": { "ldz:scourge": true } },
			"set_troll_to_false": { "set_property": { "ldz:troll": false } },
			"set_troll_to_true": { "set_property": { "ldz:troll": true } },
			"set_vanilla_to_false": { "set_property": { "ldz:vanilla": false } },
			"set_vanilla_to_true": { "set_property": { "ldz:vanilla": true } },
			"set_wraith_to_false": { "set_property": { "ldz:wraith": false } },
			"set_wraith_to_true": { "set_property": { "ldz:wraith": true } },

			"set_cell_status_to_closed": { "set_property": { "ldz:cell_status": "closed" } },
			"set_cell_status_to_opening": { "set_property": { "ldz:cell_status": "opening" } },
			"set_cell_status_to_opened": { "set_property": { "ldz:cell_status": "opened" } },

			"set_hide_pedestals_to_false": { "set_property": { "ldz:hide_pedestals": false } },
			"set_hide_pedestals_to_true": { "set_property": { "ldz:hide_pedestals": true } },
			

			"remove_duplication_check_toggle": {
				"remove": {
					"component_groups": [
						"duplication_check_toggle"
					]
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			}
		}
	}
}