{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "vatonage:emerald_mage",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "vatonage:variant1": {
         "minecraft:attack": {
           "damage": 10
         },
         "minecraft:movement": {
           "value": 0.3
         },
         "minecraft:scale": {
           "value": 0.7
         },
         "minecraft:health": {
           "value": 400,
           "max": 400
         }
      },
      "vatonage:variant2": {
         "minecraft:attack": {
           "damage": 11
         },
         "minecraft:movement": {
           "value": 0.28
         },
         "minecraft:scale": {
           "value": 0.75
         },
         "minecraft:health": {
           "value": 500,
           "max": 500
         }
      },
      "vatonage:variant3": {
         "minecraft:attack": {
           "damage": 12
         },
         "minecraft:movement": {
           "value": 0.27
         },
         "minecraft:scale": {
           "value": 0.8
         },
         "minecraft:health": {
           "value": 320,
           "max": 320
         }
      },
      "vatonage:variant4": {
         "minecraft:attack": {
           "damage": 13
         },
         "minecraft:movement": {
           "value": 0.25
         },
         "minecraft:scale": {
           "value": 0.9
         },
         "minecraft:health": {
           "value": 600,
           "max": 600
         }
      },
      "vatonage:variant5": {
         "minecraft:attack": {
           "damage": 14
         },
         "minecraft:movement": {
           "value": 0.23
         },
         "minecraft:scale": {
           "value": 1.0
         },
         "minecraft:health": {
           "value": 700,
           "max": 700
         }
      }
    },
    "components": {
      "minecraft:boss":{
        "name":"Emerald Mage",
        "hud_range":20
      },
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 60 + (query.equipment_count * Math.Random(2,5)) : 0"
      },
      "minecraft:type_family": {
        "family": [ "undead", "monster", "mob" ]
      },
      "minecraft:behavior.summon_entity": {
        "priority": 2,
        "summon_choices": [
          {
            "min_activation_range": 0.0,
            "max_activation_range": 7.0,
            "cooldown_time": 1.0,
            "weight": 3,
            "cast_duration": 2.0,
            "particle_color": "#FF664D59",
            "start_sound_event": "cast.spell",
            "sequence": [
              {
                "shape": "circle",
                "target": "self",
                "base_delay": 1.0,
                "delay_per_summon": 0.0,
                "num_entities_spawned": 5,
                "entity_type": "minecraft:evocation_fang",
                "size": 1.5,
                "entity_lifespan": 1.1,
                "sound_event": "prepare.attack"
              },
              {
                "shape": "circle",
                "target": "self",
                "base_delay": 0.15,
                "delay_per_summon": 0.0,
                "num_entities_spawned": 8,
                "entity_type": "minecraft:evocation_fang",
                "size": 2.5,
                "entity_lifespan": 1.1
              }
            ]
          },
          {
            "min_activation_range": 3.0,
            "weight": 5,
            "cooldown_time": 1.0,
            "cast_duration": 2.0,
            "particle_color": "#FF664D59",
            "start_sound_event": "cast.spell",
            "sequence": [
              {
                "shape": "line",
                "target": "self",
                "base_delay": 1.0,
                "delay_per_summon": 0.05,
                "num_entities_spawned": 16,
                "entity_type": "minecraft:evocation_fang",
                "size": 20,
                "entity_lifespan": 1.1
              }
            ]
          },
          {
            "weight": 1,
            "cooldown_time": 17.0,
            "cast_duration": 2.0,
            "particle_color": "#FFB3B3CC",
            "sequence": [
              {
                "shape": "circle",
                "target": "self",
                "base_delay": 5.0,
                "num_entities_spawned": 3,
                "entity_type": "vatonage:wraith_mage",
                "summon_cap": 8,
                "summon_cap_radius": 16.0,
                "size": 1.0,
                "sound_event": "prepare.summon"
              }
            ]
          }
        ]
      },
      "minecraft:behavior.send_event": {
        "priority": 3,
        "event_choices": [
          {
            "min_activation_range": 0.0,
            "max_activation_range": 16.0,
            "cooldown_time": 5.0,
            "cast_duration": 3.0,
            "particle_color": "#FFB38033",
            "weight": 3,
            "filters": { 
                "all_of": [
                  { "test" :  "is_family", "subject" : "other", "value" :  "sheep"},
                  { "test" :  "is_color", "subject" : "other", "value" :  "blue"}
                ] 
            },
            "start_sound_event": "cast.spell",
            "sequence": [
              {
                "base_delay": 2.0,
                "event": "wololo",
                "sound_event": "prepare.wololo"
              }
            ]
          }
        ]
      },
      "minecraft:behavior.avoid_mob_type": {
        "priority": 5,
        "entity_types": [
          {
            "filters": { "test" :  "is_family", "subject" : "other", "value" :  "player"},
            "max_dist": 8,
            "walk_speed_multiplier": 0.6,
            "sprint_speed_multiplier": 1.0
          }
        ]
      },
      "minecraft:follow_range": {
        "value": 32
      },
      "minecraft:fire_immune": {
      },
      "minecraft:movement.basic": {
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": true
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 0.8
      },
      "minecraft:behavior.look_at_player": {
        "priority": 7,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 7
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "reselect_targets": true,
        "must_see": true,
        "within_radius": 12.0,
        "must_see_forget_duration": 17.0,
        "persist_time": 0.5,
        "entity_types": [
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    { "test": "is_family", "subject": "other", "value": "player" }
                  ]
                }
              ]
            },
            "max_dist": 20
          }
        ]
      },
      "minecraft:physics": {
      },
      "minecraft:loot": {
        "table": "loot_tables/entities/emerald_mage.json"
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:collision_box": {
        "width": 1,
        "height": 2
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 100,
            "add": {
              "component_groups": [
                "vatonage:variant1"
              ]
            }
          },
          {
            "weight": 50,
            "add": {
              "component_groups": [
                "vatonage:variant2"
              ]
            }
          },
          {
            "weight": 20,
            "add": {
              "component_groups": [
                "vatonage:variant3"
              ]
            }
          },
          {
            "weight": 10,
            "add": {
              "component_groups": [
                "vatonage:variant4"
              ]
            }
          },
          {
            "weight": 2,
            "add": {
              "component_groups": [
                "vatonage:variant5"
              ]
            }
          }
        ]
      }
    }
  }
}