{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:witch",
      "is_experimental": false,
      "is_summonable": true,
      "is_spawnable": true,
      "spawn_category": "monster"
    },
    "components": {
      "minecraft:behavior.drink_potion": {
        "potions": [
          {
            "chance": 0.15,
            "filters": {
              "all_of": [
                {
                  "subject": "self",
                  "test": "is_underwater",
                  "value": true
                },
                {
                  "none_of": {
                    "subject": "self",
                    "test": "has_mob_effect",
                    "value": "water_breathing"
                  }
                }
              ]
            },
            "id": 19
          },
          {
            "chance": 0.15,
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "subject": "self",
                      "test": "on_fire",
                      "value": true
                    },
                    {
                      "subject": "self",
                      "test": "on_hot_block",
                      "value": true
                    }
                  ]
                },
                {
                  "none_of": {
                    "subject": "self",
                    "test": "has_mob_effect",
                    "value": "fire_resistance"
                  }
                }
              ]
            },
            "id": 12
          },
          {
            "chance": 0.05,
            "filters": {
              "all_of": [
                {
                  "subject": "self",
                  "test": "is_missing_health",
                  "value": true
                }
              ]
            },
            "id": 21
          },
          {
            "chance": 0.25,
            "filters": {
              "all_of": [
                {
                  "subject": "self",
                  "test": "has_target",
                  "value": true
                },
                {
                  "operator": ">=",
                  "test": "target_distance",
                  "subject": "self",
                  "value": 11
                },
                {
                  "none_of": {
                    "subject": "self",
                    "test": "has_mob_effect",
                    "value": "speed"
                  }
                }
              ]
            },
            "id": 14
          }
        ],
        "priority": 1,
        "speed_modifier": -0.25
      },
      "minecraft:behavior.float": {
        "priority": 1
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:behavior.look_at_player": {
        "look_time": {
          "min": 1,
          "max": 2
        },
        "priority": 5
      },
      "minecraft:behavior.nearest_attackable_target": {
        "must_reach": true,
        "entity_types": [
          {
            "filters": {
              "AND": [
                {
                  "OR": [
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "player"
                    },
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "snowgolem"
                    },
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "irongolem"
                    }
                  ]
                }
              ]
            },
            "max_dist": 10
          }
        ],
        "priority": 2
      },
      "minecraft:behavior.random_look_around": {
        "look_distance": 8,
        "priority": 5
      },
      "minecraft:behavior.random_stroll": {
        "priority": 4,
        "speed_multiplier": 1
      },
      "minecraft:behavior.ranged_attack": {
        "attack_interval_max": 3,
        "attack_interval_min": 3,
        "attack_radius": 10,
        "priority": 2,
        "speed_multiplier": 1
      },
      "minecraft:breathable": {
        "suffocate_time": 0,
        "total_supply": 15
      },
      "minecraft:can_climb": {},
      "minecraft:collision_box": {
        "height": 1.9,
        "width": 0.6
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:experience_reward": {
        "on_death": {
          "expression": "query.last_hit_by_player ? (query.is_baby ? 12 : 5) + (Math.die_roll(query.equipment_count,1,3)) : 0",
          "version": 0
        }
      },
      "minecraft:follow_range": {
        "value": 64
      },
      "minecraft:health": {
        "max": 26,
        "value": 26
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "cause": "lava",
            "damage_per_tick": 4,
            "filters": {
              "operator": "==",
              "test": "in_lava",
              "subject": "self",
              "value": true
            }
          }
        ]
      },
      "minecraft:jump.static": {},
      "minecraft:loot": {
        "table": "loot_tables/entities/witch.json"
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:movement.basic": {},
      "minecraft:nameable": {},
      "minecraft:navigation.walk": {
        "avoid_water": false,
        "can_path_over_water": true,
        "using_door_annotation": true
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:shooter": {
        "aux_val": 23,
        "def": "minecraft:splash_potion",
        "magic": true,
        "sound": "throw",
        "power": 0.75,
        "projectiles": [
          {
            "aux_val": 17,
            "def": "minecraft:splash_potion",
            "filters": {
              "all_of": [
                {
                  "operator": ">=",
                  "test": "target_distance",
                  "subject": "self",
                  "value": 8
                },
                {
                  "none_of": {
                    "subject": "other",
                    "test": "has_mob_effect",
                    "value": "slowness"
                  }
                }
              ]
            }
          },
          {
            "aux_val": 25,
            "def": "minecraft:splash_potion",
            "filters": {
              "all_of": [
                {
                  "operator": ">=",
                  "test": "actor_health",
                  "subject": "other",
                  "value": 8
                },
                {
                  "none_of": {
                    "subject": "other",
                    "test": "has_mob_effect",
                    "value": "poison"
                  }
                }
              ]
            }
          },
          {
            "aux_val": 34,
            "chance": 0.25,
            "def": "minecraft:splash_potion",
            "filters": {
              "all_of": [
                {
                  "operator": "<=",
                  "test": "target_distance",
                  "subject": "self",
                  "value": 3
                },
                {
                  "none_of": {
                    "subject": "other",
                    "test": "has_mob_effect",
                    "value": "weakness"
                  }
                }
              ]
            }
          }
        ]
      },
      "minecraft:type_family": {
        "family": [
          "witch",
          "monster",
          "mob"
        ]
      }
    },
    "component_groups": {
      "minecraft:celebrate": {
        "minecraft:behavior.celebrate": {
          "celebration_sound": "celebrate",
          "duration": 30,
          "jump_interval": {
            "range_max": 3.5,
            "range_min": 1
          },
          "on_celebration_end_event": {
            "event": "minecraft:stop_celebrating",
            "target": "self"
          },
          "priority": 5,
          "sound_interval": {
            "range_max": 7,
            "range_min": 2
          }
        }
      },
      "minecraft:raid_configuration": {
        "minecraft:ambient_sound_interval": {
          "event_name": "ambient.in.raid",
          "range": 4,
          "value": 2
        },
        "minecraft:behavior.move_to_village": {
          "goal_radius": 2,
          "priority": 3,
          "speed_multiplier": 1.2
        },
        "minecraft:dweller": {
          "can_find_poi": false,
          "dwelling_type": "village",
          "can_migrate": false,
          "dweller_role": "hostile",
          "first_founding_reward": 0,
          "update_interval_base": 60,
          "update_interval_variant": 40
        }
      }
    },
    "events": {
      "minecraft:spawn_for_raid": {
        "add": {
          "component_groups": [
            "minecraft:raid_configuration"
          ]
        }
      },
      "minecraft:stop_celebrating": {
        "remove": {
          "component_groups": [
            "minecraft:celebrate"
          ]
        }
      },
      "minecraft:start_celebrating": { // Event must be called exactly this for village to fire it when a raid is lost
        "add": {
          "component_groups": [
            "minecraft:celebrate"
          ]
        }
      }
    }
  }
}