{
  "minecraft:entity": {
    "format_version": "1.2.0",

    "component_groups": {
      "baby": {
        "minecraft:is_baby": {
        },
        "minecraft:scale": {
          "value":0.4
        },
        "minecraft:ageable": {
          "duration": 1200,
          "feedItems": [
            "golden_carrot",
            "carrot",
            "yellow_flower"
          ],
          "grow_up": {
            "event": "grow_up",
            "target": "self"
          }
        },
        "minecraft:behavior.follow_parent": {
          "priority": 6,
          "speed_multiplier": 1.1
        }
      },

      "adult": {
        "minecraft:loot": {
          "table": "loot_tables/entities/rabbit.json"
        },
        "minecraft:scale": {
          "value": 0.6
        },
        "minecraft:behavior.breed": {
          "priority": 2,
          "speed_multiplier": 1.0
        },
        "minecraft:breedable": {
          "breedItems": [
            "golden_carrot",
            "carrot",
            "yellow_flower"
          ],
          "breedsWith": {
            "mateType": "minecraft:rabbit",
            "babyType": "minecraft:rabbit"
          },
          "requireTame": false,
          "mutation_factor": {
            "variant": 0.2
          }
        }
      },

      "minecraft:rabbit_leashed": {
        "minecraft:behavior.move_towards_restriction": {
          "priority": 2,
          "speed_multiplier": 1.0
        }
      },

      "coat_brown": {
        "minecraft:variant": { "value": 0 }
      },
      "coat_white": {
        "minecraft:variant": { "value": 1 }
      },
      "coat_black": {
        "minecraft:variant": { "value": 2 }
      },
      "coat_splotched": {
        "minecraft:variant": { "value": 3 }
      },
      "coat_desert": {
        "minecraft:variant": { "value": 4 }
      },
      "coat_salt": {
        "minecraft:variant": { "value": 5 }
      }

    },

    "components": {
      "minecraft:identifier": {
        "id": "minecraft:rabbit"
      },

      "minecraft:type_family": {
        "family":["rabbit"]
      },
      
      "minecraft:breathable": {
        "totalSupply": 15,
        "suffocateTime": 0
      },
      "minecraft:nameable": {
      },

      "minecraft:health": {
        "value": 3,
        "max": 3
      },
      "minecraft:collision_box": {
        "width": 0.67,
        "height": 0.67
      },
      "minecraft:movement": {
        "value": 0.3
      },
      "minecraft:navigation.walk": {
        "can_path_over_water": true,
        "avoid_water": true
      },
      "minecraft:movement.skip": {
      },
      "minecraft:jump.dynamic": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:leashable": {
        "soft_distance": 4.0,
        "hard_distance": 6.0,
        "max_distance":  10.0,
        "on_leash": {
          "event": "leash",
          "target": "self"
        },
        "on_unleash": {
          "event": "unleash",
          "target": "self"
        }
      },
      "minecraft:balloonable": {
        "mass": 0.75
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.panic" : {
        "priority": 1,
        "speed_multiplier": 2.2
      },
      "minecraft:behavior.avoid_mob_type": {
        "priority": 4,
        "entity_types":[
          {
            "filters": { "test" :  "is_family", "subject" : "other", "value" :  "player"},
            "max_dist": 8,
            "walk_speed_multiplier": 1.5,
            "sprint_speed_multiplier": 1.8
          },
          {
            "filters": { "test" :  "is_family", "subject" : "other", "value" :  "wolf"},
            "max_dist": 4,
            "walk_speed_multiplier": 1.5,
            "sprint_speed_multiplier": 1.8
          },
          {
            "filters": { "test" :  "is_family", "subject" : "other", "value" :  "monster"},
            "max_dist": 4,
            "walk_speed_multiplier": 1.5,
            "sprint_speed_multiplier": 1.5
          }
        ]
      },
      "minecraft:behavior.breed": {
        "priority": 2,
        "speed_multiplier": 0.8
      },
      "minecraft:behavior.tempt": {
        "priority": 3,
        "speed_multiplier": 1,
        "items": [
          "golden_carrot",
          "carrot",
          "yellow_flower"
        ]
      },
      "minecraft:behavior.raid_garden": {
        "priority": 5,
        "blocks": [
          "carrots"
        ],
        "search_range": 16,
        "goal_radius": 0.8
      },
      "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 0.6,
        "xz_dist": 2,
        "y_dist": 1
      },
      "minecraft:behavior.look_at_player": {
        "priority": 11
      },
	    "minecraft:physics": {
      }
    },

    "events": {

      "in_desert": { "add": { "component_groups": [ "coat_desert" ] } },

      "in_snow": {
        "randomize": [
          {
            "weight": 80,
            "add": { "component_groups": [ "coat_white" ] }
          },
          {
            "weight": 20,
            "add": { "component_groups": [ "coat_splotched" ] }
          }
        ]
      },

      "minecraft:entity_spawned": {
        "sequence": [
          {
            "randomize": [
              {
                "weight": 3,
                "add": { "component_groups": [ "adult" ] }
              },
              {
                "weight": 1,
                "add": { "component_groups": [ "baby" ] }
              }
            ]
          },
          {
            "filters": { "test" :  "has_component", "operator": "!=", "value" :  "minecraft:variant"},
            "randomize": [
              {
                "weight": 50,
                "add": { "component_groups": [ "coat_brown" ] }
              },
              {
                "weight": 40,
                "add": { "component_groups": [ "coat_black" ] }
              },
              {
                "weight": 10,
                "add": { "component_groups": [ "coat_salt" ] }
              }
            ]
          },
          {
            "filters": { "test": "is_biome", "value": "desert" },
            "add": { "component_groups": [ "coat_desert" ] }
          },
          {
            "filters": { "test": "is_snow_covered", "value": true },
            "randomize": [
              {
                "weight": 80,
                "add": { "component_groups": [ "coat_white" ] }
              },
              {
                "weight": 20,
                "add": { "component_groups": [ "coat_splotched" ] }
              }
            ]
          }
        ]
      },

      "minecraft:entity_born": {
        "sequence": [
          { "add": { "component_groups": [ "baby" ] } },
          {
            "filters": { "test" :  "has_component", "operator": "!=", "value" :  "minecraft:variant"},
            "randomize": [
              {
                "weight": 50,
                "add": { "component_groups": [ "coat_brown" ] }
              },
              {
                "weight": 40,
                "add": { "component_groups": [ "coat_black" ] }
              },
              {
                "weight": 10,
                "add": { "component_groups": [ "coat_salt" ] }
              }
            ]
          },
          {
            "filters": { "test": "is_biome", "value": "desert" },
            "add": { "component_groups": [ "coat_desert" ] }
          },
          {
            "filters": { "test": "is_snow_covered", "value": true },
            "randomize": [
              {
                "weight": 80,
                "add": { "component_groups": [ "coat_white" ] }
              },
              {
                "weight": 20,
                "add": { "component_groups": [ "coat_splotched" ] }
              }
            ]
          }
        ]
      },

      "grow_up": {
        "remove": { "component_groups": [ "baby" ] },
        "add": { "component_groups": [ "adult" ] }
      },

      "leash": {
        "add": { "component_groups": [ "minecraft:rabbit_leashed" ] }
      },

      "unleash": {
        "remove": { "component_groups": [ "minecraft:rabbit_leashed" ] }
      }
    }
  }
}
