{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:guardian",
      "is_experimental": false,
      "is_summonable": true,
      "is_spawnable": true,
      "spawn_category": "monster"
    },
    "components": {
      "minecraft:attack": {
        "damage": 5
      },
      "minecraft:behavior.guardian_attack": {
        "priority": 4
      },
      "minecraft:behavior.look_at_player": {
        "look_time": {
          "min": 1,
          "max": 2
        },
        "look_distance": 12,
        "probability": 0.01,
        "priority": 8
      },
      "minecraft:behavior.move_towards_home_restriction": {
        "priority": 5
      },
      "minecraft:behavior.nearest_attackable_target": {
        "attack_interval": {
          "max": 1
        },
        "must_see": true,
        "entity_types": [
          {
            "filters": {
              "AND": [
                {
                  "OR": [
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "player"
                    },
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "squid"
                    }
                  ]
                }
              ]
            }
          }
        ],
        "priority": 1
      },
      "minecraft:behavior.random_look_around": {
        "priority": 9
      },
      "minecraft:behavior.random_swim": {
        "avoid_surface": false,
        "speed_multiplier": 1.0,
        "interval": 80,
        "priority": 7
      },
      "minecraft:breathable": {
        "breathes_water": true
      },
      "minecraft:collision_box": {
        "height": 0.85,
        "width": 0.85
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:experience_reward": {
        "on_death": {
          "expression": "query.last_hit_by_player ? 10 : 0",
          "version": 0
        }
      },
      "minecraft:follow_range": {
        "max": 16,
        "value": 16
      },
      "minecraft:health": {
        "max": 30,
        "value": 30
      },
      "minecraft:home": {
        "restriction_radius": 16,
        "restriction_type": "random_movement"
      },
      "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/guardian.json"
      },
      "minecraft:movement": {
        "value": 0.12
      },
      "minecraft:movement.sway": {},
      "minecraft:nameable": {},
      "minecraft:navigation.generic": {
        "can_breach": true,
        "can_walk": false,
        "can_path_over_water": false,
        "can_swim": true,
        "is_amphibious": true,
        "using_door_annotation": true
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:target_nearby_sensor": {
        "inside_range": 3.0,
        "on_inside_range": {
          "event": "minecraft:target_too_close",
          "target": "self"
        },
        "outside_range": 4.0
      },
      "minecraft:type_family": {
        "family": [
          "guardian",
          "monster",
          "mob"
        ]
      },
      "minecraft:underwater_movement": {
        "value": 0.12
      }
    },
    "component_groups": {
      "minecraft:guardian_aggressive": {
        "minecraft:behavior.guardian_attack": {
          "priority": 4
        },
        "minecraft:behavior.nearest_attackable_target": {
          "attack_interval": {
            "max": 1
          },
          "must_see": true,
          "entity_types": [
            {
              "filters": {
                "AND": [
                  {
                    "OR": [
                      {
                        "test": "is_family",
                        "subject": 1,
                        "operator": 0,
                        "value": "player"
                      },
                      {
                        "test": "is_family",
                        "subject": 1,
                        "operator": 0,
                        "value": "squid"
                      }
                    ]
                  }
                ]
              }
            }
          ],
          "priority": 1
        },
        "minecraft:target_nearby_sensor": {
          "inside_range": 3.0,
          "on_inside_range": {
            "event": "minecraft:target_too_close",
            "target": "self"
          },
          "outside_range": 4.0
        }
      },
      "minecraft:guardian_passive": {
        "minecraft:behavior.avoid_mob_type": {
          "entity_types": [
            {
              "filters": {
                "AND": [
                  {
                    "test": "is_family",
                    "subject": 1,
                    "operator": 0,
                    "value": "player"
                  }
                ]
              },
              "max_dist": 8
            }
          ],
          "priority": 1
        },
        "minecraft:timer": {
          "looping": false,
          "time": [
            1,
            3
          ],
          "time_down_event": {
            "event": "minecraft:target_far_enough",
            "target": "self"
          }
        }
      }
    },
    "events": {
      "minecraft:target_far_enough": {
        "add": {
          "component_groups": [
            "minecraft:guardian_aggressive"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:guardian_passive"
          ]
        }
      },
      "minecraft:target_too_close": {
        "add": {
          "component_groups": [
            "minecraft:guardian_passive"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:guardian_aggressive"
          ]
        }
      }
    }
  }
}