{
  "format_version": "1.19.60",
  "minecraft:entity": {
    "description": {
      "identifier": "legacy:witch2",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "runtime_identifier": "minecraft:witch"
    },
    "component_groups": {
      "minecraft:celebrate": {
        "minecraft:behavior.celebrate": {
          "priority": 5,
          "celebration_sound": "celebrate",
          "sound_interval": {
            "range_min": 2.0,
            "range_max": 7.0
          },
          "jump_interval": {
            "range_min": 1.0,
            "range_max": 3.5
          },
          "duration": 30.0,
          "on_celebration_end_event": {
            "event": "minecraft:stop_celebrating",
            "target": "self"
          }
        }
      },
      "regeneration": {
        "minecraft:spell_effects": {
          "add_effects": [
            {
              "effect": "regeneration",
              "amplifier": 2,
              "visible": 1,
              "ambient": false,
              "duration": 30
            }
          ]
        }
      },
      "desert_witch": {
        "minecraft:mark_variant": {
          "value": 1
        }
      },
      "jungle_witch": {
        "minecraft:mark_variant": {
          "value": 2
        }
      },
      "savanna_witch": {
        "minecraft:mark_variant": {
          "value": 3
        }
      },
      "snow_witch": {
        "minecraft:mark_variant": {
          "value": 4
        }
      },
      "swamp_witch": {
        "minecraft:mark_variant": {
          "value": 5
        }
      },
      "taiga_witch": {
        "minecraft:mark_variant": {
          "value": 6
        }
      },
      "minecraft:raid_configuration": {
        "minecraft:dweller": {
          "dwelling_type": "village",
          "dweller_role": "hostile",
          "update_interval_base": 60,
          "update_interval_variant": 40,
          "can_find_poi": false,
          "can_migrate": true,
          "first_founding_reward": 0
        },
        "minecraft:behavior.move_to_village": {
          "priority": 3,
          "speed_multiplier": 1.2,
          "goal_radius": 2.0
        },
        "minecraft:ambient_sound_interval": {
          "value": 2.0,
          "range": 4.0,
          "event_name": "ambient.in.raid"
        }
      },
      "minecraft:raid_persistence": {
        "minecraft:persistent": {}
      }
    },
    "components": {
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "on_damage": {
              "filters": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "illager"
                }
              ]
            },
            "deals_damage": false
          }
        ]
      },
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? (query.is_baby ? 12 : 5) + (Math.die_roll(query.equipment_count,1,3)) : 0"
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0
      },
      "minecraft:nameable": {
      },
      "minecraft:loot": {
        "table": "loot_tables/entities/witch.json"
      },
      "minecraft:health": {
        "value": 26,
        "max": 26
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": true,
        "can_pass_doors": true,
        "can_open_doors": true,
        "avoid_water": true
      },
      "minecraft:movement.basic": {
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:behavior.float": {
        "priority": 1
      },
      "minecraft:angry": {
        "duration": 30,
        "broadcast_anger": true,
        "broadcast_anger_on_attack": true,
        "broadcast_anger_on_being_attacked": true,
        "broadcast_range": 16,
        "broadcast_targets": [
			"illager"
        ]
      },
      "minecraft:behavior.ranged_attack": {
        "priority": 2,
        "speed_multiplier": 1.0,
        "attack_interval_min": 3,
        "attack_interval_max": 3,
        "attack_radius": 10.0
      },
      "minecraft:shooter": {
        "power" : 0.75,
        "def": "minecraft:splash_potion",
        "aux_val" : 23,   // harming
        "sound" : "throw",
        "projectiles" : [
          {
            "def" : "minecraft:splash_potion",
            "aux_val" : 21, // healing
            "filters" : {
              "all_of" : [
                { "test": "is_raider", "subject": "other", "value": true },
                { "test": "actor_health", "subject": "other", "value": 4, "operator" : "<=" }
              ]
            },
            "lose_target" : true
          },
          {
            "def" : "minecraft:splash_potion",
            "aux_val" : 28, // regeneration
            "filters" : {
              "all_of" : [
                { "test": "is_raider", "subject": "other", "value": true }
              ]
            },
            "lose_target" : true
          },
          {
            "def" : "minecraft:splash_potion",
            "aux_val" : 17, // slowness
            "filters" : {
              "all_of" : [
                { "test" : "target_distance", "subject" : "self", "value" : 8.0, "operator" : ">="},
                {
                  "none_of":[
                    { "test": "has_mob_effect", "subject": "other", "value": "slowness" }
                  ]
                }
              ]
            }
          },
          {
            "def" : "minecraft:splash_potion",
            "aux_val" : 25, // poison
            "filters" : {
              "all_of" : [
                { "test" : "target_distance", "subject" : "self", "value" : 8.0, "operator" : ">="},
                {
                  "none_of": [
                    { "test": "has_mob_effect", "subject": "other", "value": "poison" }
                  ]
                }
              ]
            }
          },
          {
            "def" : "minecraft:splash_potion",
            "aux_val" : 34, // weakness
            "filters" : {
              "all_of" : [
                { "test" : "target_distance", "subject" : "self", "value" : 3, "operator" : "<="},
                {
                  "none_of":[
                    { "test": "has_mob_effect", "subject": "other", "value": "weakness" }
                  ]
                }
              ]
            },
            "chance" : 0.25
          }
        ],
        "magic" : true
      },
      "minecraft:behavior.random_stroll": {
        "priority": 4,
        "speed_multiplier": 1.0
      },
      "minecraft:behavior.look_at_player": {
        "priority": 5,
        "look_distance": 16.0
      },
      "minecraft:behavior.random_look_around": {
        "priority": 5,
        "look_distance": 8.0
      },
      "minecraft:behavior.drink_potion": {
        "priority": 1,
        "speed_modifier": -0.25,
        "potions": [
          {
            "id": 19, // Water breathing
            "chance": 0.15,
            "filters": {
              "all_of": [
                { "test": "is_underwater", "subject": "self", "value": true },
                {
                  "none_of": [
                    { "test": "has_mob_effect", "subject": "self", "value": "water_breathing" }
                  ]
                }
              ]
            }
          },
          {
            "id": 12, // Fire resistance
            "chance": 0.15,
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    { "test": "on_fire", "subject": "self", "value": true },
                    { "test": "on_hot_block", "subject": "self", "value": true },
                    { "test": "taking_fire_damage", "subject": "self", "value": true }
                  ]
                },
                {
                  "none_of": [
                    { "test": "has_mob_effect", "subject": "self", "value": "fire_resistance" }
                  ]
                }
              ]
            }
          },
          {
            "id": 21, // Healing
            "chance": 0.05,
            "filters": {
              "all_of": [
                { "test": "is_missing_health", "subject": "self", "value": true }
              ]
            }
          },
          {
            "id": 14, // Swiftness
            "chance": 0.25,
            "filters": {
              "all_of": [
                { "test": "has_target", "subject": "self", "value": true },
                {
                  "none_of": [
                    { "test": "has_mob_effect", "subject": "self", "value": "speed" }
                  ]
                },
                { "test": "target_distance", "subject": "self", "value": 11.0, "operator": ">=" }
              ]
            }
          }
        ]
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1,
        "entity_types": {
          "filters": {
            "test": "is_family",
            "subject": "other",
            "operator": "!\u003d",
            "value": "illager"
          },
          "max_dist": 64
        }
      },
      "minecraft:behavior.nearest_prioritized_attackable_target": {
        "priority": 2,
        "entity_types": [
          {
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "player"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "villager"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "snowgolem"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "irongolem"
                }
              ]
            },
            "priority": 1,
            "max_dist": 10
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_raider",
                  "subject": "other",
                  "value": true
                },
                {
                  "test": "is_raider",
                  "subject": "self",
                  "value": true
                },
                {
                  "none_of":[
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "witch"
                    }
                  ]
                }
              ]
            },
            "priority": 2,
            "cooldown" : 10,
            "max_dist": 10
          }
        ],
        "must_reach": true
      },
      "minecraft:type_family": {
        "family": [
          "witch",
          "illager",
          "mob"
        ]
      },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 1.9
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:follow_range": {
        "value": 64
      },
      "minecraft:can_join_raid": {
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },
    "events": {
      "minecraft:spawn_for_raid": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "minecraft:raid_configuration"
              ]
            }
          },
          {
            "filters": {
              "any_of": [
                {
                  "test": "has_biome_tag",
                  "value": "desert"
                },
                {
                  "test": "has_biome_tag",
                  "value": "mesa"
                }
              ]
            },
            "add": {
              "component_groups": [
                "desert_witch"
              ]
            }
          },
          {
            "filters": {
              "test": "has_biome_tag",
              "value": "jungle"
            },
            "add": {
              "component_groups": [
                "jungle_witch"
              ]
            }
          },
          {
            "filters": {
              "test": "has_biome_tag",
              "value": "savanna"
            },
            "add": {
              "component_groups": [
                "savanna_witch"
              ]
            }
          },
          {
            "filters": {
              "any_of": [
                {
                  "all_of": [
                    {
                      "test": "has_biome_tag",
                      "value": "cold"
                    },
                    {
                      "test": "has_biome_tag",
                      "operator": "!\u003d",
                      "value": "ocean"
                    }
                  ]
                },
                {
                  "test": "has_biome_tag",
                  "value": "frozen"
                }
              ]
            },
            "add": {
              "component_groups": [
                "snow_witch"
              ]
            }
          },
          {
            "filters": {
              "test": "has_biome_tag",
              "value": "swamp"
            },
            "add": {
              "component_groups": [
                "swamp_witch"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "test": "has_biome_tag",
                      "value": "taiga"
                    },
                    {
                      "test": "has_biome_tag",
                      "value": "extreme_hills"
                    }
                  ]
                },
                {
                  "test": "has_biome_tag",
                  "operator": "!\u003d",
                  "value": "cold"
                }
              ]
            },
            "add": {
              "component_groups": [
                "taiga_witch"
              ]
            }
          }
        ]
      },
      "minecraft:entity_spawned": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "nope"
              ]
            }
          },
          {
            "filters": {
              "any_of": [
                {
                  "test": "has_biome_tag",
                  "value": "desert"
                },
                {
                  "test": "has_biome_tag",
                  "value": "mesa"
                }
              ]
            },
            "add": {
              "component_groups": [
                "desert_witch"
              ]
            }
          },
          {
            "filters": {
              "test": "has_biome_tag",
              "value": "jungle"
            },
            "add": {
              "component_groups": [
                "jungle_witch"
              ]
            }
          },
          {
            "filters": {
              "test": "has_biome_tag",
              "value": "savanna"
            },
            "add": {
              "component_groups": [
                "savanna_witch"
              ]
            }
          },
          {
            "filters": {
              "any_of": [
                {
                  "all_of": [
                    {
                      "test": "has_biome_tag",
                      "value": "cold"
                    },
                    {
                      "test": "has_biome_tag",
                      "operator": "!\u003d",
                      "value": "ocean"
                    }
                  ]
                },
                {
                  "test": "has_biome_tag",
                  "value": "frozen"
                }
              ]
            },
            "add": {
              "component_groups": [
                "snow_witch"
              ]
            }
          },
          {
            "filters": {
              "test": "has_biome_tag",
              "value": "swamp"
            },
            "add": {
              "component_groups": [
                "swamp_witch"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "test": "has_biome_tag",
                      "value": "taiga"
                    },
                    {
                      "test": "has_biome_tag",
                      "value": "extreme_hills"
                    }
                  ]
                },
                {
                  "test": "has_biome_tag",
                  "operator": "!\u003d",
                  "value": "cold"
                }
              ]
            },
            "add": {
              "component_groups": [
                "taiga_witch"
              ]
            }
          }
        ]
      },
      "minecraft:start_celebrating": { // Event must be called exactly this for village to fire it when a raid is lost
        "sequence": [
          {
            "add": { "component_groups": [ "minecraft:celebrate" ] }
          },
          {
            "filters": { "test": "has_nametag", "value": false },
            "remove": { "component_groups": [ "minecraft:raid_persistence" ] }
          }
        ]
      },
      "minecraft:give_regeneration_illager": {
        "add": {
          "component_groups": [
            "regeneration"
          ]
        }
      },
      "minecraft:stop_celebrating": {
        "remove": { "component_groups": [ "minecraft:celebrate" ] }
      },
      "minecraft:raid_expired": {
        "sequence": [
          {
            "filters": { "test": "has_nametag", "value": false },
            "remove": { "component_groups": [ "minecraft:raid_persistence" ] }
          }
        ]
      }
    }
  }
}
