{
  "format_version": "1.8.0",
  "minecraft:entity": {
    "description": {
      "identifier": "bowo:police",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "minecraft:lightning_immune": {
        "minecraft:damage_sensor": [
          {
            "on_damage": {
              "filters": {
                "other_with_families": "lightning"
              }
            },
            "deals_damage": false
          }
        ]
      },
      "minecraft:ranged_attack": {
        "minecraft:behavior.ranged_attack": {
          "attack_interval_min": 1,
          "attack_interval_max": 3,
          "attack_radius": 15
        },
        "minecraft:shooter": {
          "type": "kartu",
          "def": "mcpe:bow"
        },
        "minecraft:environment_sensor": {
          "on_environment": {
            "filters": {
              "test": "is_underwater",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "event": "minecraft:melee_mode"
          }
        }
      },
      "minecraft:melee_attack": {
        "minecraft:behavior.melee_attack": {
          "priority": 4,
          "target_dist": 1.2,
          "speed_multiplier": 1.25,
          "track_target": true
        },
        "minecraft:attack": {
          "damage": 3
        },
        "minecraft:environment_sensor": {
          "on_environment": {
            "filters": {
              "test": "in_water",
              "subject": "self",
              "operator": "==",
              "value": false
            },
            "event": "minecraft:ranged_mode"
          }
        }
      }
    },
    "components": {
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 1.95
      },
      "minecraft:type_family": {
        "family": [
          "cat",
          "mob",
          "player",
          "villager"
        ]
      },
      "minecraft:breathable": {
        "totalSupply": 15,
        "suffocateTime": 0,
        "breathesWater": true,
        "generatesBubbles": true
      },
      "minecraft:health": {
        "value": 10,
        "max": 10
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:navigation.walk": {
        "is_amphibious": true,
        "avoid_sun": true,
        "avoid_water": true
      },
      "minecraft:movement.basic": {},
      "minecraft:jump.static": {},
      "minecraft:can_climb": {},
      "minecraft:equipment": {
        "table": "loot_tables/entities/skeleton_gear.json"
      },
      "minecraft:environment_sensor": {
        "on_environment": {
          "filters": {
            "test": "is_underwater",
            "subject": "self",
            "operator": "==",
            "value": true
          },
          "event": "minecraft:melee_mode"
        }
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:behavior.random_stroll": {
        "priority": 5,
        "speed_multiplier": 1
      },
      "minecraft:behavior.look_at_player": {
        "priority": 6,
        "look_distance": 8
      },
      "minecraft:behavior.random_look_around": {
        "priority": 6
      },
      "minecraft:physics": {},
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 10 : 0"
      },
      "minecraft:flying_speed": {
        "value": 0.02
      },
      "minecraft:scale": {
        "value": 1
      },
      "minecraft:equip_item": {}
    },
    "events": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "minecraft:ranged_attack"
          ]
        }
      },
      "minecraft:spring_trap": {
        "add": {
          "component_groups": [
            "minecraft:lightning_immune"
          ]
        }
      },
      "minecraft:melee_mode": {
        "remove": {
          "component_groups": [
            "minecraft:ranged_attack"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:melee_attack"
          ]
        }
      },
      "minecraft:ranged_mode": {
        "remove": {
          "component_groups": [
            "minecraft:melee_attack"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:ranged_attack"
          ]
        }
      }
    }
  }
}