{
  "format_version": "1.18.10",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:panda",
      "spawn_category": "creature",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "minecraft:panda_baby": {
        "minecraft:is_baby": {
        },
        "minecraft:scale": {
          "value": 0.4
        },
        "minecraft:ageable": {
          "duration": 1200,
          "feed_items": "bamboo",
          "grow_up": {
            "event": "minecraft:ageable_grow_up",
            "target": "self"
          }
        },
        "minecraft:behavior.roll": {
          "priority": 12,
          "probability": 0.0016
        },
        "minecraft:behavior.follow_parent": {
          "priority": 13,
          "speed_multiplier": 1.1
        },
        "minecraft:on_target_acquired": {
          "event": "minecraft:on_scared",
          "target": "self"
        },
        "minecraft:behavior.sneeze": {
          "priority": 7,
          "probability": 0.0001666,
          "cooldown_time": 1.0,
          "within_radius": 10.0,
          "entity_types": [
            {
              "filters": {
                "all_of": [
                  {
                    "test": "has_component",
                    "subject": "other",
                    "operator": "!=",
                    "value": "minecraft:is_baby"
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "panda"
                  },
                  {
                    "test": "in_water",
                    "subject": "other",
                    "operator": "!=",
                    "value": true
                  },
                  {
                    "test": "on_ground",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "max_dist": 10
            }
          ],
          "drop_item_chance": 0.001,
          "loot_table": "loot_tables/entities/panda_sneeze.json",
          "prepare_sound": "presneeze",
          "prepare_time": 1.0,
          "sound": "sneeze"
        }
      },
      "minecraft:panda_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/panda.json"
        },
        "minecraft:behavior.breed": {
          "priority": 3,
          "speed_multiplier": 1.0
        },
        "minecraft:breedable": {
          "require_tame": false,
          "blend_attributes": false,
          "environment_requirements": {
            "blocks": "bamboo",
            "count": 8,
            "radius": 5
          },
          "breed_items": "bamboo",
          "breeds_with": {
            "mate_type": "minecraft:panda",
            "baby_type": "minecraft:panda",
            "breed_event": {
              "event": "minecraft:entity_born",
              "target": "baby"
            }
          },
          "mutation_factor": {
            "variant": 1.0
          }
        },
        "minecraft:on_target_acquired": {
          "event": "minecraft:become_angry",
          "target": "self"
        },
        "minecraft:on_target_escape": {
          "event": "minecraft:on_calm",
          "target": "self"
        },
        "minecraft:attack": {
          "damage": 2.0
        },
        "minecraft:behavior.melee_box_attack": {
          "priority": 2,
          "attack_once": true,
          "track_target": true
        }
      },
      "minecraft:panda_lazy": {
        "minecraft:variant": {
          "value": 1
        },
        "minecraft:behavior.lay_down": {
          "priority": 5,
          "interval": 400,
          "random_stop_interval": 2000
        },
        "minecraft:behavior.random_sitting": {
          "priority": 6,
          "start_chance": 0.02,
          "stop_chance": 0.2,
          "cooldown": 25,
          "min_sit_time": 15
        },
        "minecraft:behavior.snacking": {
          "priority": 3,
          "snacking_cooldown": 17.5,
          "snacking_cooldown_min": 10,
          "snacking_stop_chance": 0.0011,
          "items": [
            "bamboo",
            "cake"
          ]
        },
        "minecraft:behavior.panic": {
          "priority": 1,
          // Lazy panda's move half the speed, so double their multiplier when they panic
          // Otherwise, they don't actually look like they're panicking
          "speed_multiplier": 2.5
        },
        "minecraft:movement": {
          "value": 0.07
        }
      },
      "minecraft:panda_worried": {
        "minecraft:variant": {
          "value": 2
        },
        "minecraft:behavior.scared": {
          "priority": 1,
          "sound_interval": 20
        },
        "minecraft:behavior.avoid_mob_type": {
          "priority": 5,
          "max_dist": 16,
          "max_flee": 20,
          "entity_types": [
            {
              "filters": {
                "test": "is_family",
                "operator": "!=",
                "subject": "other",
                "value": "panda"
              },
              "max_dist": 16,
              "sprint_speed_multiplier": 1.5
            }
          ]
        }
      },
      "minecraft:panda_playful": {
        "minecraft:variant": {
          "value": 3
        },
        "minecraft:behavior.roll": {
          "priority": 12,
          "probability": 0.013
        }
      },
      "minecraft:panda_brown": {
        "minecraft:variant": {
          "value": 4
        }
      },
      "minecraft:panda_weak": {
        "minecraft:variant": {
          "value": 5
        },
        "minecraft:health": {
          "value": 10,
          "max": 10
        }
      },
      "minecraft:panda_sneezing": {
        "minecraft:behavior.sneeze": {
          "priority": 7,
          "probability": 0.002,
          "cooldown_time": 1.0,
          "within_radius": 10.0,
          "entity_types": [
            {
              "filters": {
                "all_of": [
                  {
                    "test": "has_component",
                    "subject": "other",
                    "operator": "!=",
                    "value": "minecraft:is_baby"
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "panda"
                  },
                  {
                    "test": "in_water",
                    "subject": "other",
                    "operator": "!=",
                    "value": true
                  },
                  {
                    "test": "on_ground",
                    "operator": "==",
                    "value": true
                  }
                ]
              },
              "max_dist": 10
            }
          ],
          "drop_item_chance": 0.001,
          "loot_table": "loot_tables/entities/panda_sneeze.json",
          "prepare_sound": "presneeze",
          "prepare_time": 1.0,
          "sound": "sneeze"
        }
      },
      "minecraft:panda_aggressive": {
        "minecraft:type_family": {
          "family": [ "panda" , "panda_aggressive", "mob" ]
        },
        "minecraft:variant": {
          "value": 6
        },
        "minecraft:attack": {
          "damage": 6.0
        },
        "minecraft:behavior.melee_box_attack": {
          "priority": 2,
          "track_target": true
        },
        "minecraft:on_friendly_anger": {
          "event": "minecraft:on_anger",
          "target": "self"
        },
        "minecraft:behavior.panic": {
          "priority": 1,
          "speed_multiplier": 1.25,
          // Aggressive pandas don't panic from mob damage
          "ignore_mob_damage": true
        }
      },
      "minecraft:panda_angry": {
        "minecraft:angry": {
          "duration": 500,
          "broadcast_anger": true,
          "broadcast_range": 41,
          "broadcast_filters": {
            "test": "is_family",
            "operator": "==",
            "value": "panda_aggressive"
          },
          "calm_event": {
            "event": "minecraft:on_calm",
            "target": "self"
          }
        },
        "minecraft:on_target_acquired": {
        }
      },
      "minecraft:baby_scared": {
        "minecraft:angry": {
          "duration": 1,
          "broadcast_anger": true,
          "broadcast_range": 41,
          "broadcast_filters": {
            "test": "is_family",
            "operator": "==",
            "value": "panda_aggressive"
          },
          "calm_event": {
            "event": "minecraft:baby_on_calm",
            "target": "self"
          }
        }
      }
    },


    "components": {
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:type_family": {
        "family": [ "panda" ]
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0
      },
      "minecraft:navigation.walk": {
        "can_float": true,
        "avoid_water": true,
        "avoid_damage_blocks": true
      },
      "minecraft:movement.basic": {
      },
      "minecraft:scale": {
        "value": 1.0
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:giveable": {
        "triggers": {
          "cooldown": 3.0,
          "items": [
            "bamboo",
            "cake"
          ],
          "on_give": {
            "event": "minecraft:on_calm",
            "target": "self"
          }
        }
      },
      "minecraft:inventory": {
        "inventory_size": 1,
        "private": true
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:collision_box": {
        "width": 1.3,
        "height": 1.25
      },
      "minecraft:nameable": {
      },
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "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.15
      },
      "minecraft:water_movement": {
        "drag_factor": 0.98
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.random_sitting": {
        "priority": 5,
        "start_chance": 0.01,
        "stop_chance": 0.3,
        "cooldown": 30,
        "min_sit_time": 10
      },
      "minecraft:behavior.snacking": {
        "priority": 2,
        "snacking_cooldown": 22.5,
        "snacking_cooldown_min": 20,
        "snacking_stop_chance": 0.001334,
        "items": [
          "bamboo",
          "cake"
        ]
      },
      "minecraft:behavior.mount_pathing": {
        "priority": 5,
        "speed_multiplier": 1.5,
        "target_dist": 0.0,
        "track_target": true
      },
      "minecraft:behavior.breed": {
        "priority": 3,
        "speed_multiplier": 1.0
      },
      "minecraft:behavior.tempt": {
        "priority": 4,
        "speed_multiplier": 1.25,
        "items": [
          "bamboo"
        ]
      },
      "minecraft:behavior.random_stroll": {
        "priority": 14,
        "speed_multiplier": 0.8
      },
      "minecraft:behavior.look_at_player": {
        "priority": 8,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 9
      },
      "minecraft:behavior.panic": {
        "priority": 1,
        "speed_multiplier": 1.25
      },
      "minecraft:balloonable": {
      },
      "minecraft:rideable": {
        "seat_count": 1,
        "family_types": [
          "zombie"
        ],
        "seats": {
          "position": [ 0.0, 1.105, 0.0 ]
        }
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:variant": {
        "value": 0
      },
      "minecraft:conditional_bandwidth_optimization": {
      },
      "minecraft:genetics": {
        "mutation_rate": 0.03125,
        "genes": [
          {
            "name": "panda_variant",
            "allele_range": {
              "range_min": 0,
              "range_max": 15
            },
            "genetic_variants": [
              {
                "main_allele": 0,
                "birth_event": {
                  "event": "minecraft:panda_lazy",
                  "target": "self"
                }
              },
              {
                "main_allele": 1,
                "birth_event": {
                  "event": "minecraft:panda_worried",
                  "target": "self"
                }
              },
              {
                "main_allele": 2,
                "birth_event": {
                  "event": "minecraft:panda_playful",
                  "target": "self"
                }
              },
              {
                "main_allele": 3,
                "birth_event": {
                  "event": "minecraft:panda_aggressive",
                  "target": "self"
                }
              },
              {
                "both_allele": {
                  "range_min": 4,
                  "range_max": 7
                },
                "birth_event": {
                  "event": "minecraft:panda_weak",
                  "target": "self"
                }
              },
              {
                "both_allele": {
                  "range_min": 8,
                  "range_max": 9
                },
                "birth_event": {
                  "event": "minecraft:panda_brown",
                  "target": "self"
                }
              }
            ]
          }
        ]
      }
    },

    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 95,
            "add": {
              "component_groups": [
                "minecraft:panda_adult"
              ]
            }
          },
          {
            "weight": 5,
            "add": {
              "component_groups": [
                "minecraft:panda_baby"
              ]
            }
          }
        ]
      },

      "minecraft:entity_born": {
        "add": {
          "component_groups": [
            "minecraft:panda_baby"
          ]
        }
      },

      "minecraft:ageable_grow_up": {
        "sequence": [
          {
            "remove": {
              "component_groups": [
                "minecraft:panda_baby"
              ]
            }
          },
          {
            "add": {
              "component_groups": [
                "minecraft:panda_adult"
              ]
            }
          },
          {
            "filters": {
              "test": "is_variant",
              "subject": "self",
              "operator": "==",
              "value": 3
            },
            "add": {
              "component_groups": [
                "minecraft:panda_playful"
              ]
            }
          },
          {
            "filters": {
              "test": "is_variant",
              "subject": "self",
              "operator": "==",
              "value": 6
            },
            "add": {
              "component_groups": [
                "minecraft:panda_aggressive"
              ]
            }
          }
        ]
      },
      "minecraft:panda_lazy": {
        "add": {
          "component_groups": [
            "minecraft:panda_lazy"
          ]
        }
      },
      "minecraft:panda_worried": {
        "add": {
          "component_groups": [
            "minecraft:panda_worried"
          ]
        }
      },
      "minecraft:panda_playful": {
        "add": {
          "component_groups": [
            "minecraft:panda_playful"
          ]
        }
      },
      "minecraft:panda_brown": {
        "add": {
          "component_groups": [
            "minecraft:panda_brown"
          ]
        }
      },
      "minecraft:panda_weak": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "minecraft:panda_weak"
              ]
            }
          },
          {
            "filters": {
              "test": "has_component",
              "operator": "==",
              "value": "minecraft:is_baby"
            },
            "add": {
              "component_groups": [
                "minecraft:panda_sneezing"
              ]
            }
          }
        ]
      },
      "minecraft:panda_aggressive": {
        "add": {
          "component_groups": [
            "minecraft:panda_aggressive"
          ]
        }
      },
      "minecraft:on_scared": {
        "add": {
          "component_groups": [
            "minecraft:baby_scared"
          ]
        }
      },
      "minecraft:baby_on_calm": {
        "remove": {
          "component_groups": [
            "minecraft:baby_scared"
          ]
        }
      },
      "minecraft:become_angry": {
        "add": {
          "component_groups": [
            "minecraft:panda_angry"
          ]
        }
      },
      "minecraft:on_calm": {
        "remove": {
          "component_groups": [
            "minecraft:panda_angry"
          ]
        }
      }
    }
  }
}
