/*
This is the old anglerifish behavior, editing this file doesn't affect the add-on in-game
	 --said by me somewhere late 2018
 {
		"format_version": "1.8.0",
  "minecraft:entity": {
    "description": {
      "identifier": "billey:anglerfish",
      "runtime_identifier" : "minecraft:salmon",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
		"component_groups": {
    "electrocuted": {
       
				"minecraft:loot": {
					"table": "loot_tables/entities/billey_electrocuted.json"
				}
  },
			"alive": {
				"minecraft:scale": {
					"value": 0.6
				},
				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:damage_sensor": [{
					"on_damage": {
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "eatsangler"
						},
						"event": "minecraft:die1"
					},
					"deals_damage": false
				}]
			},
            "dry": {
			"minecraft:physics": {
				"has_gravity": false      
			   },
              "minecraft:environment_sensor": {
          "filters": {
            "test": "is_underwater", "subject": "self", "operator": "==", "value": true
          },
          "event": "become_wet"
                }
            },
            "wet": {
			"minecraft:physics": {
				"has_gravity": false      
			   },
              "minecraft:environment_sensor": {
          "filters": {
            "test": "is_underwater", "subject": "self", "operator": "==", "value": false
          },
          "event": "become_dry"
                }
            },
			"eaten1": {
				"minecraft:scale": {
					"value": 0.53
				},

				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:timer": {
					"time": [0.05, 0.05],
					"looping": false,
					"time_down_event": {
						"event": "minecraft:die2",
						"target": "self"
					}
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				}
			},
			"eaten2": {
				"minecraft:scale": {
					"value": 0.45
				},
				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:timer": {
					"time": [0.05, 0.05],
					"looping": false,
					"time_down_event": {
						"event": "minecraft:die3",
						"target": "self"
					}
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				}
			},
			"eaten3": {
				"minecraft:scale": {
					"value": 0.37
				},
				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:timer": {
					"time": [0.05, 0.05],
					"looping": false,
					"time_down_event": {
						"event": "minecraft:die4",
						"target": "self"
					}
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				}
			},
			"eaten4": {
				"minecraft:scale": {
					"value": 0.23
				},
				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:timer": {
					"time": [0.05, 0.05],
					"looping": false,
					"time_down_event": {
						"event": "minecraft:die5",
						"target": "self"
					}
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				}
			},
			"eaten5": {
				"minecraft:scale": {
					"value": 0.14
				},
				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:timer": {
					"time": [0.05, 0.05],
					"looping": false,
					"time_down_event": {
						"event": "minecraft:die6",
						"target": "self"
					}
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				}
			},
			"eaten6": {
				"minecraft:scale": {
					"value": 0.07
				},
				"minecraft:health": {
					"value": 23,
					"max": 23
				},
				"minecraft:timer": {
					"time": [0.05, 0.05],
					"looping": false,
					"time_down_event": {
						"event": "minecraft:die7",
						"target": "self"
					}
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				}
			},

			"die": {
				"minecraft:scale": {
					"value": 0
				},
				"minecraft:health": {
					"value": 1,
					"max": 1
				},
				"minecraft:loot": {
					"table": "loot_tables/empty.json"
				},
				"minecraft:transformation": {
					"into": "billey:despawn",
					"delay": 0.01
				}
			},
            "variant1": {
               "minecraft:variant": {
                   "value": 0
              }
           },
            "variant2": {
               "minecraft:variant": {
                   "value": 1
              }
           },
            "variant3": {
               "minecraft:variant": {
                   "value": 2
              }
           },
           //golden anglerfish
            "variant4": {
               "minecraft:variant": {
                   "value": 3
              },
				"minecraft:damage_sensor": [{
					"on_damage": {
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "player"
						},
						"event": "minecraft:die7"
					},
					"deals_damage": false
				}],
				"minecraft:loot": {
					"table": "loot_tables/entities/prizesmall.json"
				},
                   "minecraft:scale": {
					"value": 0.166
				   } 
             
           },
            "variant5": {
               "minecraft:variant": {
                   "value": 4
              }
           },
            "variant6": {
               "minecraft:variant": {
                   "value": 5
              }
           },
            "variant7": {
               "minecraft:variant": {
                   "value": 6
              }
           }
		},

		"components": {
			"minecraft:identifier": {
				"id": "minecraft:zombie"
			},
			"minecraft:type_family": {
				"family": ["angler", "eatscod"]
			},
			"minecraft:collision_box": {
				"width": 1.3,
				"height": 1.0
			},
			"minecraft:loot": {
				"table": "loot_tables/angler.json"
			},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:movement.basic": {
			},
			"minecraft:jump.static": {
			},
			"minecraft:navigation.generic": {
				"is_amphibious": false,
				"can_float": false,
				"can_swim": true,
				"can_walk": false,
				"can_breach": false,
				"can_sink": false
			},
			"minecraft:breathable": {
				"totalSupply": 10,
				"suffocateTime": 0,
				"breathes_air": false,
				"breathes_water": true
			},
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "entity_types": [
          {
            "filters": {
              "any_of": [
                { "test" :  "is_family", "subject" : "other", "value" :  "player"},
                { "test" :  "is_family", "subject" : "other", "value" :  "cod"}
              ]
            },
            "max_dist": 4
            }
        ],
        "must_see": true
      },
			"minecraft:attack": {
				"damage": 10,
				"effect_name": "poison",
				"effect_duration": 30
			},
				"minecraft:damage_sensor": [{
					"on_damage": {
						"filters": {
							"test": "is_family",
							"subject": "other",
							"value": "cod"
						}
					},
					"deals_damage": false
				}],
			"minecraft:behavior.melee_attack": {"require_complete_path": true,
				"priority": 2,
				"speed_multiplier": 1,
				"track_target": true
			},
			"minecraft:behavior.swim_wander": {
				"priority": 4,
				"speed_multiplier": 8.0,
				"interval": 10,
				"look_ahead": 2.0
			},
			"minecraft:behavior.move_towards_restriction": {
				"priority": 3,
				"speed_multiplier": 1
			},
			"minecraft:behavior.random_stroll": {
				"priority": 4,
				"speed_multiplier": 1.0
			},
			"minecraft:behavior.look_at_player": { "probability": 0.01,
				"priority": 5,
				"look_distance": 6.0,
				"probability": 0.02
			},
			"minecraft:physics": {
				"has_gravity": false
			},
			"minecraft:behavior.random_swim": {
				"priority": 3,
				"speed_multiplier": 1.0,
				"xz_dist": 16,
				"y_dist": 4,
				"interval": 0
			},
      "minecraft:behavior.follow_flock": {
        "priority": 2,
        "speed_multiplier": 0.12
      },
      "minecraft:behavior.swim_idle": {
        "priority": 5
      }
		},

		"events": {
    "get_electrocuted": {
       "add": { "component_groups": [
         "electrocuted" ]}
  },
			"minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 100,
            "add": {
              "component_groups": [ "alive", "dry", "variant1" ]
            }
          },
          {
            "weight": 50,
            "add": {
              "component_groups": [ "alive", "dry", "variant2" ]
            }
          },
          {
            "weight": 50,
            "add": {
              "component_groups": [ "alive", "dry", "variant3" ]
            }
          },
          {
            "weight": 5,
            "add": {
              "component_groups": [ "dry", "variant4" ]
            }
          },
          {
            "weight": 50,
            "add": {
              "component_groups": [ "alive", "dry", "variant5" ]
            }
          },
          {
            "weight": 50,
            "add": {
              "component_groups": [ "alive", "dry", "variant6" ]
            }
          },
          {
            "weight": 50,
            "add": {
              "component_groups": [ "alive", "dry", "variant7" ]
            }
          }
        ]
      },
			"become_wet": {

				"add": {
					"component_groups": ["wet"]
				},
				"remove": {
					"component_groups": ["dry"]
				}

			},
			"become_dry": {
				"add": {
					"component_groups": ["dry"]
				},
				"remove": {
					"component_groups": ["wet"]
				}

			},

			"minecraft:die1": {

				"add": {
					"component_groups": ["eaten1"]
				},
				"remove": {
					"component_groups": ["alive"]
				}

			},
			"minecraft:die2": {

				"add": {
					"component_groups": ["eaten2"]
				},
				"remove": {
					"component_groups": ["eaten1"]
				}

			},
			"minecraft:die3": {

				"add": {
					"component_groups": ["eaten3"]
				},
				"remove": {
					"component_groups": ["eaten2"]
				}

			},
			"minecraft:die4": {

				"add": {
					"component_groups": ["eaten4"]
				},
				"remove": {
					"component_groups": ["eaten3"]
				}

			},
			"minecraft:die5": {

				"add": {
					"component_groups": ["eaten5"]
				},
				"remove": {
					"component_groups": ["eaten4"]
				}

			},
			"minecraft:die6": {

				"add": {
					"component_groups": ["eaten6"]
				},
				"remove": {
					"component_groups": ["eaten5"]
				}

			},
			"minecraft:die7": {

				"add": {
					"component_groups": ["die"]
				},
				"remove": {
					"component_groups": ["eaten6"]
				}

			}
		} |
	}
}