{
	"format_version": "1.19.0",
	"minecraft:entity": {
		"description": {
			"identifier": "dotvi:deathblade",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"deathblade_server_enrage": "controller.animation.deathblade_server_enrage"
			},
			"scripts": {
				"animate": [
					"deathblade_server_enrage"
				]
			}
		},
		"component_groups": {
			"dotvi:spin_attack": {
				"minecraft:area_attack": {
					"damage_range": 1.5,
					"damage_per_tick": 30,
					"cause": "entity_attack"
				},
				"minecraft:timer": {
					"time": 2.5,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:spin_attack_unactive"
					}
				},
				"minecraft:is_sheared": {}
			},
			"dotvi:enrage_roar": {
				"minecraft:behavior.knockback_roar": {
					"priority": 0,
					"on_roar_end": {
						"target": "self",
						"event": "dotvi:enrageroar_cancel"
					},
					"knockback_range": 5,
					"duration": 3,
					"knockback_damage": 0,
					"knockback_horizontal_strength": 3,
					"knockback_vertical_strength": 0
				}
			}
		},
		"components": {
			"minecraft:is_hidden_when_invisible": {},
			"minecraft:experience_reward": {
				"on_death": "query.last_hit_by_player?5+(query.equipment_count*math.random(1,3)):0"
			},
			"minecraft:nameable": {},
			"minecraft:breathable": {
				"total_supply": 15,
				"suffocate_time": 0,
				"breathes_water": true
			},
			"minecraft:health": {
				"value": 1500
			},
			"minecraft:collision_box": {
				"width": 0.72,
				"height": 2.01
			},
			"minecraft:attack": {
				"effect_name": "wither",
				"effect_duration": 10,
				"damage": 12
			},
			"minecraft:loot": {
				"table": "loot_tables/entities/deathblade.json"
			},
			"minecraft:equipment": {
				"table": "loot_tables/entities/wither_skeleton_gear.json"
			},
			"minecraft:movement": {
				"value": 0.3
			},
			"minecraft:navigation.walk": {
				"is_amphibious": true,
				"avoid_sun": true,
				"avoid_water": true
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:shareables": {
				"items": [
					{
						"item": "minecraft:netherite_sword",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 0
					},
					{
						"item": "minecraft:diamond_sword",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 1
					},
					{
						"item": "minecraft:iron_sword",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 2
					},
					{
						"item": "minecraft:stone_sword",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 3
					},
					{
						"item": "minecraft:golden_sword",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 4
					},
					{
						"item": "minecraft:wooden_sword",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 5
					},
					{
						"item": "minecraft:wooden_shovel",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:stone_shovel",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:golden_shovel",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:iron_shovel",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:diamond_shovel",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:netherite_shovel",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:wooden_pickaxe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:stone_pickaxe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:golden_pickaxe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:iron_pickaxe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:diamond_pickaxe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:netherite_pickaxe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:wooden_axe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:stone_axe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:golden_axe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:iron_axe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:diamond_axe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:netherite_axe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:wooden_hoe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:stone_hoe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:golden_hoe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:iron_hoe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:diamond_hoe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:netherite_hoe",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:netherite_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 0
					},
					{
						"item": "minecraft:diamond_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 1
					},
					{
						"item": "minecraft:iron_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 2
					},
					{
						"item": "minecraft:chainmail_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 3
					},
					{
						"item": "minecraft:golden_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 4
					},
					{
						"item": "minecraft:leather_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 5
					},
					{
						"item": "minecraft:turtle_helmet",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 6
					},
					{
						"item": "minecraft:skull:0",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 7
					},
					{
						"item": "minecraft:skull:1",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 7
					},
					{
						"item": "minecraft:carved_pumpkin",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 7
					},
					{
						"item": "minecraft:netherite_chestplate",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 0
					},
					{
						"item": "minecraft:diamond_chestplate",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 1
					},
					{
						"item": "minecraft:iron_chestplate",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 2
					},
					{
						"item": "minecraft:chainmail_chestplate",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 3
					},
					{
						"item": "minecraft:golden_chestplate",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 4
					},
					{
						"item": "minecraft:leather_chestplate",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 5
					},
					{
						"item": "minecraft:netherite_leggings",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 0
					},
					{
						"item": "minecraft:diamond_leggings",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 1
					},
					{
						"item": "minecraft:iron_leggings",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 2
					},
					{
						"item": "minecraft:chainmail_leggings",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 3
					},
					{
						"item": "minecraft:golden_leggings",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 4
					},
					{
						"item": "minecraft:leather_leggings",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 5
					},
					{
						"item": "minecraft:netherite_boots",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 0
					},
					{
						"item": "minecraft:diamond_boots",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 1
					},
					{
						"item": "minecraft:iron_boots",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 2
					},
					{
						"item": "minecraft:chainmail_boots",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 3
					},
					{
						"item": "minecraft:golden_boots",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 4
					},
					{
						"item": "minecraft:leather_boots",
						"want_amount": 1,
						"surplus_amount": 1,
						"priority": 5
					}
				]
			},
			"minecraft:scale": {
				"value": 1.2
			},
			"minecraft:fire_immune": {},
			"minecraft:despawn": {
				"despawn_from_distance": {}
			},
			"minecraft:behavior.hurt_by_target": {
				"priority": 1
			},
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 2,
				"reselect_targets": true,
				"must_see": true,
				"entity_types": [
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "player"
						},
						"max_dist": 16
					},
					{
						"filters": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "piglin"
								},
								{
									"test": "is_difficulty",
									"operator": "!=",
									"value": "peaceful"
								}
							]
						},
						"max_dist": 16
					},
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "irongolem"
						},
						"max_dist": 16
					},
					{
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "disciple",
							"operator": "not"
						},
						"max_dist": 16
					}
				]
			},
			"minecraft:behavior.equip_item": {
				"priority": 3
			},
			"minecraft:behavior.melee_attack": {
				"priority": 4,
				"track_target": true,
				"speed_multiplier": 1.25,
				"on_attack": {
					"target": "self",
					"event": "dotvi:spin_attack_active"
				}
			},
			"minecraft:behavior.random_stroll": {
				"priority": 6,
				"speed_multiplier": 1
			},
			"minecraft:behavior.look_at_player": {
				"priority": 7,
				"look_distance": 8
			},
			"minecraft:behavior.random_look_around": {
				"priority": 8
			},
			"minecraft:type_family": {
				"family": [
					"wither",
					"monster",
					"undead",
					"skeleton",
					"mob",
					"disciple",
					"disciplevoli"
				]
			},
			"minecraft:physics": {},
			"minecraft:pushable": {
				"is_pushable": true,
				"is_pushable_by_piston": true
			},
			"minecraft:conditional_bandwidth_optimization": {},
			"minecraft:area_attack": {},
			"minecraft:timer": {},
			"minecraft:boss": {
				"name": "Deathblade, Skeleton of Crystallization"
			},
			"minecraft:knockback_resistance": {
				"value": 50
			},
			"minecraft:on_death": {
				"target": "self",
				"event": "dotvi:on_death"
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "lightning",
						"deals_damage": false
					}
				]
			}
		},
		"events": {
			"minecraft:entity_spawned": {},
			"dotvi:spin_attack_active": {
				"randomize": [
					{
						"weight": 12
					},
					{
						"weight": 1,
						"add": {
							"component_groups": [
								"dotvi:spin_attack"
							]
						},
						"run_command": {
							"command": [
								"playanimation @s animation.deathblade.angryspin"
							]
						}
					}
				]
			},
			"dotvi:spin_attack_unactive": {
				"remove": {
					"component_groups": [
						"dotvi:spin_attack"
					]
				}
			},
			"dotvi:on_death": {
				"run_command": {
					"command": [
						"function defeattriggers/discipleslain"
					]
				}
			},
			"dotvi:enrageroar": {
				"run_command": {
					"command": [
						"playsound deathblade.roar @a[r=15]",
						"playanimation @s animation.deathblade.enrage"
					]
				},
				"add": {
					"component_groups": [
						"dotvi:enrage_roar"
					]
				}
			},
			"dotvi:enrageroar_cancel": {
				"remove": {
					"component_groups": [
						"dotvi:enrage_roar"
					]
				}
			}
		},
		"permutations": [
			{
				"condition": "query.health<600",
				"components": {
					"minecraft:spell_effects": {
						"add_effects": [
							{
								"effect": "strength",
								"duration": 1800,
								"amplifier": 2,
								"visible": false
							},
							{
								"effect": "speed",
								"duration": 1800,
								"amplifier": 2,
								"visible": false
							}
						]
					}
				}
			}
		]
	}
}