{
  "format_version": "1.19.0",
  "minecraft:entity": {
    "description": {
      "identifier": "wesl3y:igris_tamed",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false,
      "animations": {},
      "scripts": {
        "animate": [
          "main"
        ]
      }
    },
    "component_groups": {
      "look_priority":{
        "minecraft:behavior.look_at_player": {
          "priority": 1,
          "look_distance": 8
        }
      },
      "start": {
        "minecraft:movement": {
          "value": 0.0
        },
        "minecraft:timer": {
          "time": [ 2.6, 2.7 ],
          "looping": true,
          "time_down_event": {
            "event": "minecraft:entity_spawned"
          }
        }
      },
      "attack1": {
        "minecraft:mark_variant": {
          "value": 0
        },
        "minecraft:movement": {
          "value": 0.3
        },
        "minecraft:attack": {
          "damage": 10
        },
        "minecraft:behavior.delayed_attack": {
          "priority": 1,
          "track_target": true,
          "reach_multiplier": 2.0,
          "speed_multiplier": 1.5,
          "attack_duration": 0.5,//tempo da animacão
          "hit_delay_pct": 0.1//tempo do attack na animacão ÷2
        },
        "minecraft:timer": {
          "time": [ 2, 5 ],
          "looping": true,
          "time_down_event": {
            "event": "attack2"
          }
        }
      },
      "attack2": {
        "minecraft:mark_variant": {
          "value": 1
        },
        "minecraft:movement": {
          "value": 0.3
        },
        "minecraft:attack": {
          "damage": 12
        },
        "minecraft:behavior.delayed_attack": {
          "priority": 1,
          "track_target": true,
          "reach_multiplier": 2.0,
          "speed_multiplier": 1.5,
          "attack_duration": 1.0,//tempo da animacão
          "hit_delay_pct": 0.15//tempo do attack na animacão ÷2
        },
        "minecraft:timer": {
          "time": [ 2, 5 ],
          "looping": true,
          "time_down_event": {
            "event": "attack1"
          }
        }
      },
      "despawn": {
        "minecraft:instant_despawn": {}
      },
      "tamed": {
        "minecraft:is_tamed": {},
        "minecraft:behavior.follow_owner": {
          "priority": 6,
          "speed_multiplier": 1.3,
          "start_distance": 10,
          "stop_distance": 5
        },
        "minecraft:behavior.owner_hurt_by_target": {
          "priority": 1
        },
        "minecraft:behavior.owner_hurt_target": {
          "priority": 2
        }
      }
    },

    "components": {
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 1 : 0"
      },
      "minecraft:type_family": {
        "family": [ "igris", "mob" ]
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0
      },
      "minecraft:nameable": {},
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 1.8
      },
      "minecraft:health": {
        "value": 200,
        "max": 200
      },
      "minecraft:scale": {
        "value": 1.94
      },
      "minecraft:flying_speed": {
        "value": 0.3
      },
      "minecraft:knockback_resistance": {
        "value": 1.0
      },
      "minecraft:despawn": {
        "filters": {
          "all_of": [
            {"test": "distance_to_nearest_player", "operator": ">", "value": 80}
          ]
        }
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 0,
        "must_see": true,
        "reselect_targets": false,
        "entity_types": [
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "player"
            },
            "max_dist": 32
          }
        ]
      },
      "minecraft:follow_range": {
        "value": 32,
        "max": 32
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": true
      },
      "minecraft:movement.basic": {},
      "minecraft:jump.static": {},
      "minecraft:can_climb": {},
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:physics": {},
      "minecraft:conditional_bandwidth_optimization": {
      }
    },

    "events": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "attack1",
            "tamed"
          ]
        },
        "remove": {
          "component_groups": [
            "start"
          ]
        }
      },
      "start": {
        "queue_command": {
          "command": [
            "tp @s ^^^ facing @p[tag=igris,r=5,c=1]"
          ]
        },
        "add": {
          "component_groups": [
            "start"
          ]
        }
      },
      "attack1": {
        "sequence": [
          {
            "filters": {
              "all_of": [
                {"test": "has_target", "subject": "self", "value": true}
              ]
            },
            "remove": {
              "component_groups": [
                "attack2"
              ]
            },
            "add": {
              "component_groups": [
                "attack1"
              ]
            }
          }
        ]
      },
      "attack2": {
        "sequence": [
          {
            "filters": {
              "all_of": [
                {"test": "has_target", "subject": "self", "value": true}
              ]
            },
            "remove": {
              "component_groups": [
                "attack1"
              ]
            },
            "add": {
              "component_groups": [
                "attack2"
              ]
            }
          }
        ]
      },
      "despawn": {
        "add": {
          "component_groups": [
            "despawn"
          ]
        }
      }
    }
  }
}