{
  "format_version": "1.17.20",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:ravager",
      "spawn_category": "monster",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "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"
          }
        }
      },
      "minecraft:pillager_rider": {
        "minecraft:addrider": {
          "entity_type": "minecraft:pillager"
        }
      },
      "minecraft:pillager_rider_for_raid": {
        "minecraft:addrider": {
          "entity_type": "minecraft:pillager",
          "spawn_event": "minecraft:spawn_for_raid"
        }
      },
      "minecraft:evoker_rider_for_raid": {
        "minecraft:addrider": {
          "entity_type": "minecraft:evocation_illager",
          "spawn_event": "minecraft:spawn_for_raid"
        }
      },
      "minecraft:pillager_captain_rider": {
        "minecraft:addrider": {
          "entity_type": "minecraft:pillager",
          "spawn_event": "minecraft:spawn_as_illager_captain"
        }
      },
      "minecraft:vindicator_rider": {
        "minecraft:addrider": {
          "entity_type": "minecraft:vindicator"
        }
      },
      "minecraft:vindicator_captain_rider": {
        "minecraft:addrider": {
          "entity_type": "minecraft:vindicator",
          "spawn_event": "minecraft:spawn_as_illager_captain"
        }
      },
      "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": 5,
          "speed_multiplier": 1.0,
          "goal_radius": 2.0
        },
        "minecraft:behavior.random_stroll": {
          "priority": 6,
          "speed_multiplier": 1.0
        },
        "minecraft:ambient_sound_interval": {
          "value": 4.0,
          "range": 8.0,
          "event_name": "ambient.in.raid"
        }
      },
      "minecraft:raid_persistence": {
        "minecraft:persistent": {}
      },
      "minecraft:hostile": {
        "minecraft:movement": {
          "value": 0.4
        },
        "minecraft:behavior.delayed_attack": {
          "priority": 4,
          "attack_once": false,
          "track_target": true,
          "require_complete_path": false,
          "random_stop_interval": 0,
          "reach_multiplier": 1.5,
          "speed_multiplier": 1.0,
          "attack_duration": 0.75,
          "hit_delay_pct": 0.5
        },
        "minecraft:behavior.random_stroll": {
          "priority": 6,
          "speed_multiplier": 0.4
        },
        "minecraft:behavior.look_at_player": {
          "priority": 7,
          "look_distance": 6,
          "angle_of_view_horizontal": 45,
          "probability": 1
        },
        "minecraft:behavior.look_at_entity": {
          "priority": 10,
          "look_distance": 8,
          "angle_of_view_horizontal": 45,
          "filters": {
            "test": "is_family",
            "subject": "other",
            "value": "mob"
          }
        },
        "minecraft:behavior.hurt_by_target": {
          "priority": 2,
          "entity_types": {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "operator": "!=",
              "value": "illager"
            },
            "max_dist": 64
          }
        },
        "minecraft:behavior.nearest_attackable_target": {
          "priority": 3,
          "must_see": true,
          "within_radius": 16.0,
          "entity_types": [
            {
              "filters": {
                "any_of": [
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "irongolem"
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "wandering_trader"
                  }
                ]
              },
              "max_dist": 16
            },
            {
              "filters": {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "villager"
                  },
                  {
                    "test": "has_component",
                    "subject": "other",
                    "operator": "!=",
                    "value": "minecraft:is_baby"
                  }
                ]
              },
              "max_dist": 16
            }
          ]
        },
        "minecraft:behavior.mount_pathing": {
          "priority": 5,
          "speed_multiplier": 1.25,
          "target_dist": 0.0,
          "track_target": true
        }
      },
      "stunned": {
        "minecraft:is_stunned": {
        },
        "minecraft:timer": {
          "looping": false,
          "time": 2,
          "time_down_event": {
            "event": "minecraft:start_roar"
          }
        }
      },
      "roaring": {
        "minecraft:behavior.knockback_roar": {
          "priority": 1,
          "duration": 1,
          "attack_time": 0.5,
          "knockback_damage": 6,
          "knockback_horizontal_strength": 3,
          "knockback_vertical_strength": 3,
          "knockback_range": 4,
          "knockback_filters": {
            "test": "is_family",
            "subject": "other",
            "operator": "!=",
            "value": "ravager"
          },
          "damage_filters": {
            "test": "is_family",
            "subject": "other",
            "operator": "!=",
            "value": "illager"
          },
          "on_roar_end": {
            "event": "minecraft:end_roar"
          },
          "cooldown_time": 0.1
        }
      }
    },
    "components": {
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 20 : 0"
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:ravager_blocked": {
        "knockback_strength": 3.0,
        "reaction_choices": [
          {
            "weight": 1,
            "value": {
              "event": "minecraft:become_stunned",
              "target": "self"
            }
          },
          {
            // Default, large knockback case
            "weight": 1
          }
        ]
      },
      "minecraft:attack": {
        "damage": 12.0
      },
      "minecraft:breathable": {
        "suffocate_time": 0,
        "total_supply": 15
      },
      "minecraft:collision_box": {
        "height": 2.2,
        "width": 1.95
      },
      "minecraft:health": {
        "max": 100,
        "value": 100
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:jump.static": {},
      "minecraft:loot": {
        "table": "loot_tables/entities/ravager.json"
      },
      "minecraft:knockback_resistance": {
        "value": 0.75
      },
      "minecraft:movement": {
        "value": 0.0
      },
      "minecraft:movement.basic": {},
      "minecraft:nameable": {},
      "minecraft:navigation.walk": {
        "avoid_damage_blocks": true,
        "can_path_over_water": true,
        "can_sink": false
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:can_join_raid": {
      },
      "minecraft:conditional_bandwidth_optimization": {
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:break_blocks": {
        "breakable_blocks": [
          "bamboo",
          "bamboo_sapling",
          "beetroot",
          "brown_mushroom",
          "carrots",
          "carved_pumpkin",
          "chorus_flower",
          "chorus_plant",
          "deadbush",
          "double_plant",
          "leaves",
          "leaves2",
          "lit_pumpkin",
          "melon_block",
          "melon_stem",
          "potatoes",
          "pumpkin",
          "pumpkin_stem",
          "red_flower",
          "red_mushroom",
          "crimson_fungus",
          "warped_fungus",
          "reeds",
          "sapling",
          "snow_layer",
          "sweet_berry_bush",
          "tallgrass",
          "turtle_egg",
          "vine",
          "waterlily",
          "wheat",
          "yellow_flower",
          "azalea",
          "flowering_azalea",
          "azalea_leaves",
          "azalea_leaves_flowered",
          "cave_vines",
          "cave_vines_body_with_berries",
          "cave_vines_head_with_berries",
          "small_dripleaf_block",
          "big_dripleaf",
          "spore_blossom",
          "hanging_roots",
          "mangrove_leaves"
        ]
      },
      "minecraft:follow_range": {
        "value": 64
      },
      "minecraft:rideable": {
        "seat_count": 1,
        "family_types": [
          "pillager",
          "vindicator",
          "evocation_illager"
        ],
        "seats": {
          "position": [ 0.0, 2.1, -0.3 ]
        }
      },
      "minecraft:type_family": {
        "family": [
          "monster",          
          "ravager", 
          "mob"
        ]
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "minecraft:hostile"
          ]
        }
      },
      "minecraft:spawn_for_raid": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:raid_configuration",
            "minecraft:raid_persistence"
          ]
        }
      },
      "minecraft:spawn_for_raid_with_evoker_rider": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:evoker_rider_for_raid",
            "minecraft:raid_configuration",
            "minecraft:raid_persistence"
          ]
        }
      },
      "minecraft:spawn_for_raid_with_pillager_rider": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:pillager_rider_for_raid",
            "minecraft:raid_configuration",
            "minecraft:raid_persistence"
          ]
        }
      },
      "minecraft:spawn_with_pillager_rider": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:pillager_rider"
          ]
        }
      },
      "minecraft:spawn_with_pillager_captain_rider": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:pillager_captain_rider"
          ]
        }
      },
      "minecraft:spawn_with_vindicator_rider": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:vindicator_rider"
          ]
        }
      },
      "minecraft:spawn_with_vindicator_captain_rider": {
        "add": {
          "component_groups": [
            "minecraft:hostile",
            "minecraft:vindicator_captain_rider"
          ]
        }
      },
      "minecraft:become_stunned": {
        "add": {
          "component_groups": [
            "stunned"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:hostile"
          ]
        }
      },
      "minecraft:start_roar": {
        "add": {
          "component_groups": [
            "roaring"
          ]
        },
        "remove": {
          "component_groups": [
            "stunned"
          ]
        }
      },
      "minecraft:end_roar": {
        "add": {
          "component_groups": [
            "minecraft:hostile"
          ]
        },
        "remove": {
          "component_groups": [
            "roaring"
          ]
        }
      },
      "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:stop_celebrating": {
        "remove": { "component_groups": [ "minecraft:celebrate" ] }
      },
      "minecraft:raid_expired": {
        "sequence": [
          {
            "filters": { "test": "has_nametag", "value": false },
            "remove": { "component_groups": [ "minecraft:raid_persistence" ] }
          }
        ]
      }
    }
  }
}
