{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "nicothekid:rat_curserer",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "component:target_sensor": {
				"minecraft:target_nearby_sensor": {
					"inside_range": 3.0,
					"outside_range": 6.0,
					"on_inside_range": {
						"event": "minecraft:switch_to_combat_melee",
						"target": "self"
					},
					"on_outside_range": {
						"event": "minecraft:switch_to_combat_ranged",
						"target": "self"
					}
				}
			},
			"component:combat_melee": {
				"minecraft:attack": {
					"damage": [ 9, 10 ]
				},
				"minecraft:behavior.melee_attack": {
          "priority": 5,
          "attack_once": false,
          "track_target": true,
          "require_complete_path": false,
          "cooldown_time": 1,
          "speed_multiplier": 1.15
				}
			},
			"component:combat_ranged": {
				"minecraft:shooter": {
          "def": "nicothekid:projectile_rat_curserer_missile",
          "sound": "firework.launch",
          "magic": false,
          "power": 1.2
        },
				"minecraft:behavior.ranged_attack": {
					"priority": 6,
					"burst_shots": 1,
          "attack_interval_min": 1.0,
          "attack_interval_max": 1.0,
          "attack_radius": 16.0,
          "charge_shoot_trigger": 2,
          "charge_charged_trigger": 1
				}
			},
      "component:variant_00": {
        "minecraft:variant": {
          "value": 0
        }
      },
      "component:variant_01": {
        "minecraft:variant": {
          "value": 1
        }
      }
    },
    "components": {
      "minecraft:balloonable": {
        "mass": 0.8
      },
      "minecraft:can_climb": {},
      "minecraft:collision_box": {
        "width": 0.8,
        "height": 1.8
      },
      "minecraft:health": {
        "value": 200,
        "max": 200
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:scale": {
        "value": 1.0
      },
      "minecraft:type_family": {
        "family": [
          "rat_curserer",
          "monster",
          "boss",
          "mob"
        ]
      },
      
      "minecraft:attack": {
        "damage": [ 9, 10 ]
      },
      "minecraft:block_climber": {},
      "minecraft:boss": {
        "name": "Rat Curserer",
				"hud_range": 8,
				"should_darken_sky": false
			},
      "minecraft:breathable": {
        "breathes_air": true,
        "breathes_lava": false,
        "breathes_solids": false,
        "breathes_water": false,
        "generates_bubbles": true,
        "inhale_time": 0,
        "suffocate_time": 0,
        "total_supply": 15
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "cause": "fall",
            "deals_damage": true,
						"damage_modifier": 0.0,
						"damage_multiplier": 1.0
          }
        ]
      },
      "minecraft:follow_range": {
        "value": 64
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "cause": "lava",
            "damage_per_tick": 4,
            "filters": {
              "test": "in_lava",
              "subject": "self",
              "operator": "==",
              "value": true
            }
          }
        ]
      },
      "minecraft:jump.static": {
        "jump_power": 0.42
      },
      "minecraft:knockback_resistance": {
				"value": 0.5
			},
      "minecraft:leashable": {
        "soft_distance": 4.0,
        "hard_distance": 6.0,
        "max_distance": 10.0
      },
      "minecraft:movement.basic": {
        "max_turn": 30.0
      },
      "minecraft:nameable": {
        "allow_name_tag_renaming": true,
        "always_show": false
      },
      "minecraft:navigation.walk": {
        "avoid_damage_blocks": true,
        "avoid_portals": false,
        "avoid_sun": false,
        "avoid_water": true,
        "can_breach": false,
        "can_break_doors": true,
        "can_jump": true,
        "can_open_doors": true,
        "can_open_iron_doors": true,
        "can_pass_doors": true,
        "can_path_from_air": false,
        "can_path_over_lava": false,
        "can_path_over_water": true,
        "can_sink": true,
        "can_swim": false,
        "can_walk": true,
        "can_walk_in_lava": false,
        "is_amphibious": false,
        "blocks_to_avoid": [
          {
            "tags": "query.any_tag('heated_netherrack_active')"
          },
          "minecraft:fire",
          "minecraft:flowing_lava",
          "minecraft:lava",
          "minecraft:magma",
          "minecraft:soul_fire",
          "minecraft:web"
        ]
      },
      "minecraft:persistent": {},
      "minecraft:physics": {
        "has_collision": true,
        "has_gravity": true
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1,
        "alert_same_type": true,
        "hurt_owner": false,
        "entity_types": [
          {
            "must_see": false,
            "reevaluate_description": false,
            "max_dist": 16,
            "walk_speed_multiplier": 1.10,
            "sprint_speed_multiplier": 1.10,
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "creeper",
                  "operator": "!="
                }
              ]
            }
          }
        ]
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "attack_owner": false,
        "must_reach": false,
        "must_see": true,
        "reselect_targets": true,
        "set_persistent": false,
        "attack_interval": 0,
        "attack_interval_min": 0,
        "persist_time": 0.0,
        "scan_interval": 16,
        "target_invisible_multiplier": 0.7,
        "target_search_height": -1.0,
        "target_sneak_visibility_multiplier": 0.8,
        "within_radius": 0.0,
        "entity_types": [
          {
            "must_see": true,
            "reevaluate_description": false,
            "max_dist": 20,
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "player",
                  "operator": "=="
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "crates_trader",
                  "operator": "=="
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "irongolem",
                  "operator": "=="
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "snowgolem",
                  "operator": "=="
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "wandering_collector",
                  "operator": "=="
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "wandering_trader",
                  "operator": "=="
                }
              ]
            }
          },
          {
            "must_see": true,
            "reevaluate_description": false,
            "max_dist": 20,
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "player_tamed_aggressive",
                  "operator": "=="
                },
                {
                  "test": "has_component",
                  "subject": "other",
                  "value": "minecraft:behavior.stay_while_sitting",
                  "operator": "!="
                }
              ]
            }
          },
          {
            "must_see": true,
            "reevaluate_description": false,
            "max_dist": 10,
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "villager",
                  "operator": "=="
                },
                {
                  "test": "has_component",
                  "subject": "other",
                  "value": "minecraft:is_baby",
                  "operator": "!="
                }
              ]
            }
          }
        ]
      },
      "minecraft:behavior.avoid_mob_type": {
        "priority": 3,
        "remove_target": false,
        "avoid_target_xz": 16,
        "avoid_target_y": 7,
        "max_dist": 3.0,
        "max_flee": 10.0,
        "sprint_distance": 7.0,
        "sprint_speed_multiplier": 1.0,
        "walk_speed_multiplier": 1.0,
        "entity_types": [
          {
            "must_see": true,
            "reevaluate_description": false,
            "max_dist": 16,
            "walk_speed_multiplier": 1.10,
            "sprint_speed_multiplier": 1.25,
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "creeper",
                  "operator": "=="
                }
              ]
            }
          }
        ]
      },
      "minecraft:behavior.summon_entity": {
        "priority": 4,
        "summon_choices": [
          {
            "weight": 100,
            "do_casting": true,
            "cast_duration": 3.0,
            "cooldown_time": 50.0,
            "particle_color": "#E62008",
            "start_sound_event": "cast.spell",
            "sequence": [
              {
                "entity_type": "nicothekid:cursed_rat",
                "shape": "circle",
                "target": "self",
                "base_delay": 1.0,
                "delay_per_summon": 0.0,
                "entity_lifespan": 64.0,
                "num_entities_spawned": 3,
                "size": 1.0,
                "summon_cap": 8,
                "summon_cap_radius": 16.0,
                "sound_event": "prepare.summon"
              }
            ]
          }
        ]
      },
      "minecraft:behavior.look_at_target": {
        "priority": 6,
        "probability": 0.02,
        "angle_of_view_horizontal": 360,
        "angle_of_view_vertical": 360,
        "look_distance": 8.0,
        "look_time": [ 2, 4 ]
      },
      "minecraft:behavior.avoid_block": {
        "priority": 7,
        "search_height": 4,
        "search_range": 8,
        "sprint_speed_modifier": 1.1,
        "walk_speed_modifier": 1.0,
        "tick_interval": 2,
        "target_selection_method": "nearest",
        "target_blocks": [
          "minecraft:sculk",
          "minecraft:sculk_catalyst",
          "minecraft:sculk_sensor",
          "minecraft:sculk_shrieker"
        ]
      },
      "minecraft:behavior.send_event": {
        "priority": 8,
        "event_choices": [
          {
            "weight": 100,
            "min_activation_range": 0.0,
            "max_activation_range": 16.0,
            "cooldown_time": 4.0,
            "cast_duration": 2.0,
            "particle_color": "#E62008",
            "filters": { 
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "rat"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "player_tamed",
                  "operator": "!="
                }
              ] 
            },
            "start_sound_event": "cast.spell",
            "sequence": [
              {
                "base_delay": 0.5,
                "event": "minecraft:cursing_transformation",
                "sound_event": "prepare.wololo"
              }
            ]
          }
        ]
      },
      "minecraft:behavior.random_stroll": {
        "priority": 9,
        "speed_multiplier": 1.10
      },
      "minecraft:behavior.look_at_player": {
        "priority": 10,
        "probability": 0.02,
        "angle_of_view_horizontal": 360,
        "angle_of_view_vertical": 360,
        "look_distance": 8.0,
        "look_time": [ 2, 4 ]
      },
      "minecraft:behavior.random_look_around": {
        "priority": 11,
        "look_time": [ 2, 4 ]
      },
      
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 100 + (query.equipment_count * Math.Random(1,3)) : 0"
      },
      "minecraft:loot": {
        "table": "loot_tables/nicos_more_dungeon/entities/nicothekid_rat_curserer.json"
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 100,
            "remove": {},
            "add": {
              "component_groups": [
                "component:variant_00",
                "component:combat_ranged",
                "component:target_sensor"
              ]
            }
          },
          {
            "weight": 100,
            "remove": {},
            "add": {
              "component_groups": [
                "component:variant_01",
                "component:combat_ranged",
                "component:target_sensor"
              ]
            }
          }
        ]
      },
      "minecraft:switch_to_combat_melee": {
				"remove": {
					"component_groups": [
						"component:combat_ranged"
					]
				},
				"add": {
					"component_groups": [
						"component:combat_melee"
					]
				}
			},
			"minecraft:switch_to_combat_ranged": {
				"remove": {
					"component_groups": [
						"component:combat_melee"
					]
				},
				"add": {
					"component_groups": [
						"component:combat_ranged"
					]
				}
			}
    }
  }
}