{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:pufferfish",
      "is_experimental": false,
      "is_summonable": true,
      "is_spawnable": true,
      "spawn_category": "water_ambient"
    },
    "components": {
      "minecraft:behavior.avoid_mob_type": {
        "entity_types": [
          {
            "filters": {
              "AND": [
                {
                  "OR": [
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "player"
                    },
                    {
                      "test": "is_family",
                      "subject": 1,
                      "operator": 0,
                      "value": "axolotl"
                    }
                  ]
                }
              ]
            },
            "max_dist": 6,
            "walk_speed_multiplier": 1.5,
            "sprint_speed_multiplier": 2
          }
        ],
        "priority": 1
      },
      "minecraft:behavior.random_swim": { // Randomly selects points to go to, even in water
        "interval": 0,
        "xz_dist": 16,
        "priority": 3,
        "speed_multiplier": 1,
        "y_dist": 4
      },
      "minecraft:behavior.swim_wander": {
        "interval": 1,
        "look_ahead": 2,
        "priority": 5
      },
      "minecraft:breathable": {
        "breathes_air": false,
        "breathes_water": true,
        "suffocate_time": 0,
        "total_supply": 15
      },
      "minecraft:collision_box": {
        "height": 0.8,
        "width": 0.8
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:despawn": {
        "despawn_from_distance": {
          "max_distance": 40,
          "min_distance": 32
        }
      },
      "minecraft:experience_reward": {
        "on_death": {
          "expression": "query.last_hit_by_player ? Math.Random(1,3) : 0",
          "version": 6
        }
      },
      "minecraft:flocking": {
        "breach_influence": 7,
        "block_distance": 2,
        "high_flock_limit": 8,
        "block_weight": 0.85,
        "min_height": 1.5,
        "cohesion_threshold": 1.95,
        "in_water": true,
        "cohesion_weight": 2,
        "goal_weight": 2,
        "influence_radius": 3,
        "innner_cohesion_threshold": 1.25,
        "loner_chance": 0.1,
        "low_flock_limit": 4,
        "match_variants": false,
        "max_height": 6,
        "separation_threshold": 0.95,
        "separation_weight": 1.75,
        "use_center_of_mass": true
      },
      "minecraft:health": {
        "max": 3,
        "value": 3
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "cause": "lava",
            "damage_per_tick": 4,
            "filters": {
              "operator": "==",
              "test": "in_lava",
              "subject": "self",
              "value": true
            }
          }
        ]
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:loot": {
        "table": "loot_tables/entities/pufferfish.json"
      },
      "minecraft:movement": {
        "value": 0.13
      },
      "minecraft:movement.sway": {
        "sway_amplitude": 0
      },
      "minecraft:nameable": {},
      "minecraft:navigation.generic": { // Allows the mob to go through water
        "can_breach": false,
        "can_walk": false,
        "can_path_over_water": false,
        "can_sink": false,
        "can_swim": true,
        "is_amphibious": false,
        "using_door_annotation": true
      },
      "minecraft:physics": {
        "has_gravity": false
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:scale": {
        "value": 1.2
      },
      "minecraft:type_family": {
        "family": [
          "pufferfish",
          "fish"
        ]
      },
      "minecraft:underwater_movement": {
        "value": 0.13
      }
    },
    "component_groups": {
      "minecraft:deflate_sensor": {
        "minecraft:entity_sensor": {
          "relative_range": false,
          "subsensors": [
            {
              "event": "minecraft:from_full_puff",
              "event_filters": {
                "none_of": [
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "mob"
                  },
                  {
                    "all_of": [
                      {
                        "subject": "other",
                        "test": "is_family",
                        "value": "player"
                      },
                      {
                        "none_of": {
                          "subject": "other",
                          "test": "has_ability",
                          "value": "instabuild"
                        }
                      }
                    ]
                  }
                ],
                "operator": ">",
                "test": "distance_to_nearest_player",
                "value": 2.9
              },
              "range": [
                2.9000000953674316,
                2.9000000953674316
              ],
              "require_all": true
            }
          ]
        }
      },
      "minecraft:deflate_sensor_buffer": {
        "minecraft:timer": {
          "looping": false,
          "randomInterval": false,
          "time": 0.01,
          "time_down_event": {
            "event": "minecraft:on_full_puff"
          }
        }
      },
      "minecraft:full_puff": {
        "minecraft:area_attack": {
          "cause": "contact",
          "damage_per_tick": 2,
          "damage_range": 0.2,
          "entity_filter": {
            "any_of": [
              {
                "subject": "other",
                "test": "is_family",
                "value": "player"
              },
              {
                "subject": "other",
                "test": "is_family",
                "value": "monster"
              }
            ]
          }
        },
        "minecraft:mob_effect": {
          "effect_range": 0.2,
          "effect_time": 10,
          "entity_filter": {
            "any_of": [
              {
                "subject": "other",
                "test": "is_family",
                "value": "player"
              },
              {
                "subject": "other",
                "test": "is_family",
                "value": "monster"
              }
            ]
          },
          "mob_effect": "poison"
        },
        "minecraft:variant": {
          "value": 2
        }
      },
      "minecraft:half_puff_primary": {
        "minecraft:timer": {
          "looping": false,
          "randomInterval": false,
          "time": 2,
          "time_down_event": {
            "event": "minecraft:on_half_puff"
          }
        },
        "minecraft:variant": {
          "value": 1
        }
      },
      "minecraft:half_puff_secondary": {
        "minecraft:entity_sensor": {
          "relative_range": false,
          "subsensors": [
            {
              "event": "minecraft:start_full_puff",
              "minimum_count": 1,
              "event_filters": {
                "any_of": [
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "mob"
                  },
                  {
                    "all_of": [
                      {
                        "subject": "other",
                        "test": "is_family",
                        "value": "player"
                      },
                      {
                        "none_of": {
                          "subject": "other",
                          "test": "has_ability",
                          "value": "instabuild"
                        }
                      }
                    ]
                  }
                ]
              },
              "range": [
                2.5,
                2.5
              ]
            }
          ]
        },
        "minecraft:timer": {
          "looping": false,
          "randomInterval": false,
          "time": 2,
          "time_down_event": {
            "event": "minecraft:on_normal_puff"
          }
        },
        "minecraft:variant": {
          "value": 1
        }
      },
      "minecraft:start_deflate": {
        "minecraft:timer": {
          "looping": false,
          "randomInterval": false,
          "time": 3,
          "time_down_event": {
            "event": "minecraft:on_deflate"
          }
        }
      },
      "minecraft:normal_puff": {
        "minecraft:entity_sensor": {
          "relative_range": false,
          "subsensors": [
            {
              "event": "minecraft:start_half_puff",
              "minimum_count": 1,
              "event_filters": {
                "any_of": [
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "mob"
                  },
                  {
                    "all_of": [
                      {
                        "subject": "other",
                        "test": "is_family",
                        "value": "player"
                      },
                      {
                        "none_of": {
                          "subject": "other",
                          "test": "has_ability",
                          "value": "instabuild"
                        }
                      }
                    ]
                  }
                ]
              },
              "range": [
                2.5,
                2.5
              ]
            }
          ]
        },
        "minecraft:variant": {
          "value": 0
        }
      }
    },
    "events": {
      "minecraft:from_full_puff": {
        "add": {
          "component_groups": [
            "minecraft:start_deflate"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:deflate_sensor"
          ]
        }
      },
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "minecraft:normal_puff"
          ]
        }
      },
      "minecraft:on_normal_puff": {
        "add": {
          "component_groups": [
            "minecraft:normal_puff"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:half_puff_secondary"
          ]
        }
      },
      "minecraft:on_deflate": {
        "add": {
          "component_groups": [
            "minecraft:half_puff_secondary"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:full_puff",
            "minecraft:start_deflate"
          ]
        }
      },
      "minecraft:on_full_puff": {
        "add": {
          "component_groups": [
            "minecraft:deflate_sensor"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:deflate_sensor_buffer"
          ]
        }
      },
      "minecraft:on_half_puff": {
        "add": {
          "component_groups": [
            "minecraft:half_puff_secondary"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:half_puff_primary"
          ]
        }
      },
      "minecraft:start_half_puff": {
        "add": {
          "component_groups": [
            "minecraft:half_puff_primary"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:normal_puff"
          ]
        }
      },
      "minecraft:start_full_puff": {
        "add": {
          "component_groups": [
            "minecraft:full_puff",
            "minecraft:deflate_sensor_buffer"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:half_puff_secondary"
          ]
        }
      },
      "minecraft:to_full_puff": {
        "add": {
          "component_groups": [
            "minecraft:full_puff",
            "minecraft:deflate_sensor_buffer"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:normal_puff"
          ]
        }
      }
    }
  }
}