{
  "format_version": "1.8.0",
  "minecraft:entity": {
	"description": {
      "identifier": "guardian:mushroom_crab",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false,
      "runtime_identifier": "minecraft:spider"
    },
    "component_groups": {
      "guardian:mushroom_crab_baby": {
        "minecraft:is_baby": {
        },
        "minecraft:scale": {
          "value":0.5
        },
        "minecraft:ageable": {
          "duration": 1200,
          "feed_items": [
            "seagrass",
            "tropical_fish"
          ],
          "grow_up": {
            "event": "minecraft:ageable_grow_up",
            "target": "self"
          }
        },
        "minecraft:behavior.follow_parent": {
          "priority": 5,
          "speed_multiplier": 1.1
        }
      },

      "guardian:mushroom_crab_adult": {
        "minecraft:experience_reward": {
          "on_bred": "Math.Random(1,7)",
          "on_death": "query.last_hit_by_player ? Math.Random(1,3) : 0"
        },
        "minecraft:loot": {
          "table": "loot_tables/entities/ad+/mushroom_crab.json"
        },
        "minecraft:breedable": {
          "require_tame": false,
          "breeds_with": {
            "mate_type": "guardian:mushroom_crab",
            "baby_type": "guardian:mushroom_crab",
            "breed_event": {
              "event": "minecraft:entity_born",
              "target": "baby"
            }
          },
          "breed_items": [
            "seagrass",
            "dried_kelp",
            "red_mushroom"
          ]
        },
        "minecraft:behavior.breed": {
          "priority": 3,
          "speed_multiplier": 1.0
        },
        "minecraft:rideable": {
          "seat_count": 1,
          "family_types": [
            "drowned"
          ],
          "seats": {
            "position": [ 0.0, 0.4, 0.0 ]
          }
        }
      }
    },

    "components": {
      "minecraft:type_family": {
        "family": [ "crab", "fish" ]
      },
      "minecraft:behavior.random_sitting": {
        "priority": 1,
        "start_chance": 0.02,
        "stop_chance": 1.0,
        "cooldown": 25,
        "min_sit_time": 10
      },
        "minecraft:behavior.avoid_mob_type": {
          "priority": 6,
          "entity_types": [
            {
              "filters": {
                "test": "is_family",
                "subject": "other",
                "value": "player"
              },
              "max_dist": 10,
              "walk_speed_multiplier": 0.8,
              "sprint_speed_multiplier": 1.33
            }
          ]
        },
      "minecraft:behavior.stay_while_sitting": {
        "priority": 2
      },
      "minecraft:nameable": {
      },
        "minecraft:collision_box": {
            "width": 0.4,
            "height": 0.4
        },
      "minecraft:nameable": {
      },
      "minecraft:health": {
        "value": 6,
        "max": 6
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.20
      },
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "fall",
          "deals_damage": false
        }
      },
      "minecraft:leashable": {
        "soft_distance": 4.0,
        "hard_distance": 6.0,
        "max_distance": 10.0
      },
      "minecraft:balloonable": {
        "mass": 0.6
      },
      "minecraft:navigation.walk": {
        "is_amphibious": true,
        "can path over water": false,
        "avoid_water": false,
        "avoid_damage_blocks": true
      },
	  "minecraft:underwater_movement": {
	    "value": 0.1844
	  },
      "minecraft:behavior.avoid_mob_type": {
        "priority": 3,
        "entity_types": [
          {
            "filters": {
              "any_of": [
                { "test" :  "is_family", "subject" : "other", "value" :  "player" }
              ]
            },
            "max_dist": 5,
            "walk_speed_multiplier": 1,
            "sprint_speed_multiplier": 1.2
          }
        ]
      },
      "minecraft:movement.basic": {
        
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:behavior.panic": {
        "priority": 1,
        "speed_multiplier": 1.5
      },
      "minecraft:behavior.mount_pathing": {
        "priority": 2,
        "speed_multiplier": 1.5,
        "target_dist": 0.0,
        "track_target": true
      },
      "minecraft:behavior.tempt": {
        "priority": 4,
        "speed_multiplier": 1.0,
        "items": [
            "seagrass",
            "tropical_fish"
        ]
      },
      "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 1.0
      },
      "minecraft:behavior.look_at_player": {
        "priority": 4,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 4
      },
	    "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      }
    },

    "events": {
      "from_egg": {
        "add": { "component_groups": [ "guardian:mushroom_crab_baby" ] }
      },
      
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 75,
            "remove": {
            },
            "add": {
              "component_groups": [
                "guardian:mushroom_crab_adult"
              ]
            }
          },
          {
            "weight": 25,
            "remove": {
            },
            "add": {
              "component_groups": [
                "guardian:mushroom_crab_baby"
              ]

            }
          }
        ]
      },

      "minecraft:entity_born": {
        "remove": {
        },
        "add": {
          "component_groups": [
            "guardian:mushroom_crab_baby"
          ]
        }
      },

      "minecraft:ageable_grow_up": {
        "remove": {
          "component_groups": [
            "guardian:mushroom_crab_baby"
          ]
        },
        "add": {
          "component_groups": [
            "guardian:mushroom_crab_adult"
          ]
        }
      }
    }
  }
}
