{
	"format_version": "1.16.0",
	"minecraft:entity": {
		"description": {
			"identifier": "ldz:ender_charger",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {		
				"duplication_check": "animation.ender_prisoner.duplication_check",
				"barrier_sensor": "animation.ender_prisoner.barrier_sensor",
				"spawn_target": "animation.ender_prisoner.spawn_target",
				"trader_alert": "animation.ender_prisoner.trader_alert",		
				"engine_sfx": "animation.ender_charger.engine",
				"ctrl.ice_timer": "controller.animation.vanilla.ice_timer",
				"ice_timer": "animation.vanilla.ice_timer",
				"ice_damage": "animation.vanilla.ice_damage"
			},
			"scripts": {
				"animate": [
					{ "duplication_check": "q.is_tamed" },
					{ "barrier_sensor": "q.property('ldz:barrier_sensor')" },
					{ "spawn_target": "q.property('ldz:spawn_target')" },
					{ "trader_alert": "q.property('ldz:trader')" },
					{ "engine_sfx": "q.ground_speed >= 0.3" },
					"ctrl.ice_timer"
				]
			},				
			"properties": {
				"ldz:ice_overlay": {
					"type": "bool",
					"client_sync": true,
					"default": false
				},
				"ldz:barrier_sensor": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"ldz:spawn_target": {
					"type": "bool",
					"default": false,
					"client_sync": true
				},
				"ldz:trader": {
					"type": "bool",
					"default": false,
					"client_sync": true
				}
			}
		},
		"component_groups": {
			"instant_despawn": {
				"minecraft:instant_despawn": {}
			},
			"duplication_check_toggle": {
				"minecraft:is_tamed": {}
			},
			"ice_overlay": {
				"minecraft:is_shaking": {}
			},
			"npc": {
				"minecraft:npc": {
					"npc_data": {
						"portrait_offsets": {
							"scale": [ 1.8, 1.8, 1.8],
							"translate": [ 0, 45, 0]
						}
					}
				},
				"minecraft:interact": {
					"interactions": [
						{
							"interact_text": "action.interact.ender_charger",
							"on_interact": {
								"event": "set_interacted_with_to_charger",
								"target": "other"
							}
						}
					]
				}
			},
			"trader_family": {
				"minecraft:type_family": {
					"family": [ "ldz", "ender", "ender_charger", "ender_trader" ]
				}
			},
			"trader": {
				"minecraft:trade_table": {
					"display_name": "entity.ldz:ender_charger.name",
					"new_screen": true,
					"table": "trading/ender_charger.json"
				}
			},
			"attackable": {
				"minecraft:follow_range": {
					"value": 200,
					"max": 200
				},
				"minecraft:behavior.nearest_prioritized_attackable_target": {
					"priority": 0,
					"within_radius": 200,
					"entity_types": [
						{
							"priority": 1,
							"max_dist": 200,
							"must_see": false,
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "ender_charger_target_1"
							}
						},
						{
							"priority": 2,
							"max_dist": 200,
							"must_see": false,
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "ender_charger_target_2"
							}
						},
						{
							"priority": 3,
							"max_dist": 200,
							"must_see": false,
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "ender_charger_target_3"
							}
						},
						{
							"priority": 4,
							"max_dist": 200,
							"must_see": false,
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "ender_charger_target_4"
							}
						},
						{
							"priority": 5,
							"max_dist": 200,
							"must_see": false,
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "ender_charger_target_5"
							}
						},
						{
							"priority": 99,
							"max_dist": 200,
							"must_see": false,
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "ender_charger_target"
							}
						}
					]
				},
				"minecraft:behavior.ranged_attack": {
					"attack_radius": 0
				},
				"minecraft:navigation.walk": {},
				"minecraft:jump.static": {},
				"minecraft:can_climb": {},
				"minecraft:movement": {
					"max": 0.5
				},
				"minecraft:movement.basic": {}
			}
		},
		"components": {
			"minecraft:type_family": {
				"family": [ "ldz", "ender", "ender_charger", "ender_prisoner" ]
			},
			"minecraft:collision_box": {
				"width": 0.7,
				"height": 1.8
			},
			"minecraft:health": {
				"value": 40,
				"max": 40
			},
			"minecraft:behavior.look_at_player": {
				"priority": 8,
				"look_distance": 16,
				"probability": 0.5
			},
			"minecraft:behavior.random_look_around": {
				"priority": 9
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"on_damage": {
							"filters": {
								"test": "has_damage",
								"value": "void"
							},
							"event": "despawn"
						},
						"deals_damage": false
					},
					{
						"cause": "all",
						"deals_damage": false
					}
				]
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": false,
				"is_pushable_by_piston": false
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"duplication_check_toggle"
					]
				}
			},
			"add_duplication_check_toggle": {
				"add": {
					"component_groups": [
						"duplication_check_toggle"
					]
				}
			},
			"remove_duplication_check_toggle": {
				"remove": {
					"component_groups": [
						"duplication_check_toggle"
					]
				}
			},
			"set_ice_overlay_to_true": {
				"set_property": {
					"ldz:ice_overlay": true
				},
				"add": {
					"component_groups": [
						"ice_overlay"
					]
				}
			},
			"set_ice_overlay_to_false": {
				"set_property": {
					"ldz:ice_overlay": false
				},
				"remove": {
					"component_groups": [
						"ice_overlay"
					]
				}
			},
			"add_npc": {
				"remove": {
					"component_groups": [
						"trader"
					]
				},
				"add": {
					"component_groups": [
						"npc"
					]
				},
				"trigger": "set_trader_to_false"
			},
			"remove_npc": {
				"remove": {
					"component_groups": [
						"npc"
					]
				}
			},
			"add_trader": {
				"remove": {
					"component_groups": [
						"npc"
					]
				},
				"add": {
					"component_groups": [
						"trader",
						"trader_family"
					]
				},
				"trigger": "set_trader_to_true"
			},
			"remove_trader": {
				"remove": {
					"component_groups": [
						"trader"
					]
				},
				"trigger": "set_trader_to_false"
			},
			"set_trader_to_true": {
				"set_property": {
					"ldz:trader": true
				}
			},
			"set_trader_to_false": {
				"set_property": {
					"ldz:trader": false
				}
			},
			"set_spawn_target_to_true": {
				"set_property": {
					"ldz:spawn_target": true
				}
			},
			"set_spawn_target_to_false": {
				"set_property": {
					"ldz:spawn_target": false
				}
			},
			"add_attackable": {
				"remove": {
					"component_groups": [
						"npc",
						"trader"
					]
				},
				"add": {
					"component_groups": [
						"attackable"
					]
				}
			},
			"remove_attackable": {
				"remove": {
					"component_groups": [
						"attackable"
					]
				}
			},
			"set_barrier_sensor_to_true": {
				"set_property": {
					"ldz:barrier_sensor": true
				}
			},
			"set_barrier_sensor_to_false": {
				"set_property": {
					"ldz:barrier_sensor": false
				}
			},
			"despawn": {
				"add": {
					"component_groups": [
						"instant_despawn"
					]
				}
			}
		}
	}
}